Skip to content

Commit 4798bbf

Browse files
committed
eventing update
1 parent 4a3a81a commit 4798bbf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+815
-373
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,17 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [v0.1.4] - 2019-03-22
8+
### Added
9+
- Added connection test prior to login
10+
11+
### Changed
12+
- Event printing moved to task
13+
- Event creation moved to Covenant controllers
14+
15+
### Fixed
16+
- Fixed bad command causing following commands to fail
17+
718
## [v0.1.3] - 2019-03-14
819
### Added
920
- Added credentials menu

Elite/API/Models/BinaryLauncher.cs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ public BinaryLauncher()
2727
/// <param name="type">Possible values include: 'Wmic', 'Regsvr32',
2828
/// 'Mshta', 'Cscript', 'Wscript', 'PowerShell', 'Binary', 'MSBuild',
2929
/// 'InstallUtil'</param>
30-
public BinaryLauncher(int? id = default(int?), int? listenerId = default(int?), DotNetVersion? dotNetFrameworkVersion = default(DotNetVersion?), string launcherString = default(string), LauncherType? type = default(LauncherType?), string name = default(string), string description = default(string), bool? usePipes = default(bool?), string pipeName = default(string), int? delay = default(int?), int? jitter = default(int?), int? connectAttempts = default(int?), string stagerCode = default(string), string base64ILByteString = default(string))
30+
/// <param name="commType">Possible values include: 'HTTP',
31+
/// 'SMB'</param>
32+
public BinaryLauncher(int? id = default(int?), int? listenerId = default(int?), DotNetVersion? dotNetFrameworkVersion = default(DotNetVersion?), string launcherString = default(string), LauncherType? type = default(LauncherType?), string name = default(string), string description = default(string), CommunicationType? commType = default(CommunicationType?), string smbPipeName = default(string), int? delay = default(int?), int? jitter = default(int?), int? connectAttempts = default(int?), string stagerCode = default(string), string base64ILByteString = default(string))
3133
{
3234
Id = id;
3335
ListenerId = listenerId;
@@ -36,8 +38,8 @@ public BinaryLauncher()
3638
Type = type;
3739
Name = name;
3840
Description = description;
39-
UsePipes = usePipes;
40-
PipeName = pipeName;
41+
CommType = commType;
42+
SmbPipeName = smbPipeName;
4143
Delay = delay;
4244
Jitter = jitter;
4345
ConnectAttempts = connectAttempts;
@@ -91,14 +93,15 @@ public BinaryLauncher()
9193
public string Description { get; set; }
9294

9395
/// <summary>
96+
/// Gets or sets possible values include: 'HTTP', 'SMB'
9497
/// </summary>
95-
[JsonProperty(PropertyName = "usePipes")]
96-
public bool? UsePipes { get; set; }
98+
[JsonProperty(PropertyName = "commType")]
99+
public CommunicationType? CommType { get; set; }
97100

98101
/// <summary>
99102
/// </summary>
100-
[JsonProperty(PropertyName = "pipeName")]
101-
public string PipeName { get; set; }
103+
[JsonProperty(PropertyName = "smbPipeName")]
104+
public string SmbPipeName { get; set; }
102105

103106
/// <summary>
104107
/// </summary>
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
// <auto-generated>
2+
// Code generated by Microsoft (R) AutoRest Code Generator.
3+
// Changes may cause incorrect behavior and will be lost if the code is
4+
// regenerated.
5+
// </auto-generated>
6+
7+
namespace Covenant.API.Models
8+
{
9+
using Newtonsoft.Json;
10+
using Newtonsoft.Json.Converters;
11+
using System.Runtime;
12+
using System.Runtime.Serialization;
13+
14+
/// <summary>
15+
/// Defines values for CommunicationType.
16+
/// </summary>
17+
[JsonConverter(typeof(StringEnumConverter))]
18+
public enum CommunicationType
19+
{
20+
[EnumMember(Value = "HTTP")]
21+
HTTP,
22+
[EnumMember(Value = "SMB")]
23+
SMB
24+
}
25+
internal static class CommunicationTypeEnumExtension
26+
{
27+
internal static string ToSerializedValue(this CommunicationType? value)
28+
{
29+
return value == null ? null : ((CommunicationType)value).ToSerializedValue();
30+
}
31+
32+
internal static string ToSerializedValue(this CommunicationType value)
33+
{
34+
switch( value )
35+
{
36+
case CommunicationType.HTTP:
37+
return "HTTP";
38+
case CommunicationType.SMB:
39+
return "SMB";
40+
}
41+
return null;
42+
}
43+
44+
internal static CommunicationType? ParseCommunicationType(this string value)
45+
{
46+
switch( value )
47+
{
48+
case "HTTP":
49+
return CommunicationType.HTTP;
50+
case "SMB":
51+
return CommunicationType.SMB;
52+
}
53+
return null;
54+
}
55+
}
56+
}

Elite/API/Models/CscriptLauncher.cs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ public CscriptLauncher()
2929
/// <param name="type">Possible values include: 'Wmic', 'Regsvr32',
3030
/// 'Mshta', 'Cscript', 'Wscript', 'PowerShell', 'Binary', 'MSBuild',
3131
/// 'InstallUtil'</param>
32-
public CscriptLauncher(ScriptingLanguage? scriptLanguage = default(ScriptingLanguage?), string progId = default(string), string diskCode = default(string), int? id = default(int?), int? listenerId = default(int?), DotNetVersion? dotNetFrameworkVersion = default(DotNetVersion?), string launcherString = default(string), LauncherType? type = default(LauncherType?), string name = default(string), string description = default(string), bool? usePipes = default(bool?), string pipeName = default(string), int? delay = default(int?), int? jitter = default(int?), int? connectAttempts = default(int?), string stagerCode = default(string), string base64ILByteString = default(string))
32+
/// <param name="commType">Possible values include: 'HTTP',
33+
/// 'SMB'</param>
34+
public CscriptLauncher(ScriptingLanguage? scriptLanguage = default(ScriptingLanguage?), string progId = default(string), string diskCode = default(string), int? id = default(int?), int? listenerId = default(int?), DotNetVersion? dotNetFrameworkVersion = default(DotNetVersion?), string launcherString = default(string), LauncherType? type = default(LauncherType?), string name = default(string), string description = default(string), CommunicationType? commType = default(CommunicationType?), string smbPipeName = default(string), int? delay = default(int?), int? jitter = default(int?), int? connectAttempts = default(int?), string stagerCode = default(string), string base64ILByteString = default(string))
3335
{
3436
ScriptLanguage = scriptLanguage;
3537
ProgId = progId;
@@ -41,8 +43,8 @@ public CscriptLauncher()
4143
Type = type;
4244
Name = name;
4345
Description = description;
44-
UsePipes = usePipes;
45-
PipeName = pipeName;
46+
CommType = commType;
47+
SmbPipeName = smbPipeName;
4648
Delay = delay;
4749
Jitter = jitter;
4850
ConnectAttempts = connectAttempts;
@@ -112,14 +114,15 @@ public CscriptLauncher()
112114
public string Description { get; set; }
113115

114116
/// <summary>
117+
/// Gets or sets possible values include: 'HTTP', 'SMB'
115118
/// </summary>
116-
[JsonProperty(PropertyName = "usePipes")]
117-
public bool? UsePipes { get; set; }
119+
[JsonProperty(PropertyName = "commType")]
120+
public CommunicationType? CommType { get; set; }
118121

119122
/// <summary>
120123
/// </summary>
121-
[JsonProperty(PropertyName = "pipeName")]
122-
public string PipeName { get; set; }
124+
[JsonProperty(PropertyName = "smbPipeName")]
125+
public string SmbPipeName { get; set; }
123126

124127
/// <summary>
125128
/// </summary>

Elite/API/Models/DownloadEvent.cs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,15 @@ public DownloadEvent()
2828
/// 'Warning', 'Highlight', 'Error'</param>
2929
/// <param name="type">Possible values include: 'Normal',
3030
/// 'Download'</param>
31-
public DownloadEvent(string fileName = default(string), string fileContents = default(string), DownloadProgress? progress = default(DownloadProgress?), int? id = default(int?), System.DateTime? time = default(System.DateTime?), string message = default(string), EventLevel? level = default(EventLevel?), EventType? type = default(EventType?), string context = default(string))
31+
public DownloadEvent(string fileName = default(string), string fileContents = default(string), DownloadProgress? progress = default(DownloadProgress?), int? id = default(int?), System.DateTime? time = default(System.DateTime?), string messageHeader = default(string), string messageBody = default(string), EventLevel? level = default(EventLevel?), EventType? type = default(EventType?), string context = default(string))
3232
{
3333
FileName = fileName;
3434
FileContents = fileContents;
3535
Progress = progress;
3636
Id = id;
3737
Time = time;
38-
Message = message;
38+
MessageHeader = messageHeader;
39+
MessageBody = messageBody;
3940
Level = level;
4041
Type = type;
4142
Context = context;
@@ -75,8 +76,13 @@ public DownloadEvent()
7576

7677
/// <summary>
7778
/// </summary>
78-
[JsonProperty(PropertyName = "message")]
79-
public string Message { get; set; }
79+
[JsonProperty(PropertyName = "messageHeader")]
80+
public string MessageHeader { get; set; }
81+
82+
/// <summary>
83+
/// </summary>
84+
[JsonProperty(PropertyName = "messageBody")]
85+
public string MessageBody { get; set; }
8086

8187
/// <summary>
8288
/// Gets or sets possible values include: 'Silent', 'Info', 'Warning',

Elite/API/Models/EventModel.cs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,12 @@ public EventModel()
2626
/// 'Warning', 'Highlight', 'Error'</param>
2727
/// <param name="type">Possible values include: 'Normal',
2828
/// 'Download'</param>
29-
public EventModel(int? id = default(int?), System.DateTime? time = default(System.DateTime?), string message = default(string), EventLevel? level = default(EventLevel?), EventType? type = default(EventType?), string context = default(string))
29+
public EventModel(int? id = default(int?), System.DateTime? time = default(System.DateTime?), string messageHeader = default(string), string messageBody = default(string), EventLevel? level = default(EventLevel?), EventType? type = default(EventType?), string context = default(string))
3030
{
3131
Id = id;
3232
Time = time;
33-
Message = message;
33+
MessageHeader = messageHeader;
34+
MessageBody = messageBody;
3435
Level = level;
3536
Type = type;
3637
Context = context;
@@ -54,8 +55,13 @@ public EventModel()
5455

5556
/// <summary>
5657
/// </summary>
57-
[JsonProperty(PropertyName = "message")]
58-
public string Message { get; set; }
58+
[JsonProperty(PropertyName = "messageHeader")]
59+
public string MessageHeader { get; set; }
60+
61+
/// <summary>
62+
/// </summary>
63+
[JsonProperty(PropertyName = "messageBody")]
64+
public string MessageBody { get; set; }
5965

6066
/// <summary>
6167
/// Gets or sets possible values include: 'Silent', 'Info', 'Warning',

Elite/API/Models/Grunt.cs

Lines changed: 43 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -22,40 +22,45 @@ public Grunt()
2222
/// <summary>
2323
/// Initializes a new instance of the Grunt class.
2424
/// </summary>
25+
/// <param name="commType">Possible values include: 'HTTP',
26+
/// 'SMB'</param>
2527
/// <param name="dotNetFrameworkVersion">Possible values include:
2628
/// 'Net40', 'Net35', 'NetCore21'</param>
2729
/// <param name="status">Possible values include: 'Uninitialized',
28-
/// 'Stage0', 'Stage1', 'Stage2', 'Active', 'Lost', 'Killed'</param>
30+
/// 'Stage0', 'Stage1', 'Stage2', 'Active', 'Lost', 'Killed',
31+
/// 'Disconnected'</param>
2932
/// <param name="integrity">Possible values include: 'Untrusted',
3033
/// 'Low', 'Medium', 'High', 'System'</param>
31-
public Grunt(int? id = default(int?), string name = default(string), string originalServerGuid = default(string), string guid = default(string), DotNetVersion? dotNetFrameworkVersion = default(DotNetVersion?), int? listenerId = default(int?), string covenantIPAddress = default(string), string childGrunts = default(string), bool? usePipes = default(bool?), string pipeName = default(string), int? delay = default(int?), int? jitter = default(int?), int? connectAttempts = default(int?), string lastCheckIn = default(string), GruntStatus? status = default(GruntStatus?), IntegrityLevel? integrity = default(IntegrityLevel?), string process = default(string), string userDomainName = default(string), string userName = default(string), string ipAddress = default(string), string operatingSystem = default(string), string gruntSharedSecretPassword = default(string), string gruntRSAPublicKey = default(string), string gruntNegotiatedSessionKey = default(string), string gruntChallenge = default(string), string cookieAuthKey = default(string))
34+
public Grunt(int? id = default(int?), string name = default(string), string originalServerGuid = default(string), string guid = default(string), string childGrunts = default(string), CommunicationType? commType = default(CommunicationType?), string smbPipeName = default(string), int? listenerId = default(int?), string covenantIPAddress = default(string), int? delay = default(int?), int? jitter = default(int?), int? connectAttempts = default(int?), DotNetVersion? dotNetFrameworkVersion = default(DotNetVersion?), GruntStatus? status = default(GruntStatus?), IntegrityLevel? integrity = default(IntegrityLevel?), string process = default(string), string userDomainName = default(string), string userName = default(string), string ipAddress = default(string), string hostname = default(string), string operatingSystem = default(string), string gruntSharedSecretPassword = default(string), string gruntRSAPublicKey = default(string), string gruntNegotiatedSessionKey = default(string), string gruntChallenge = default(string), string cookieAuthKey = default(string), System.DateTime? activationTime = default(System.DateTime?), System.DateTime? lastCheckIn = default(System.DateTime?))
3235
{
3336
Id = id;
3437
Name = name;
3538
OriginalServerGuid = originalServerGuid;
3639
Guid = guid;
37-
DotNetFrameworkVersion = dotNetFrameworkVersion;
40+
ChildGrunts = childGrunts;
41+
CommType = commType;
42+
SmbPipeName = smbPipeName;
3843
ListenerId = listenerId;
3944
CovenantIPAddress = covenantIPAddress;
40-
ChildGrunts = childGrunts;
41-
UsePipes = usePipes;
42-
PipeName = pipeName;
4345
Delay = delay;
4446
Jitter = jitter;
4547
ConnectAttempts = connectAttempts;
46-
LastCheckIn = lastCheckIn;
48+
DotNetFrameworkVersion = dotNetFrameworkVersion;
4749
Status = status;
4850
Integrity = integrity;
4951
Process = process;
5052
UserDomainName = userDomainName;
5153
UserName = userName;
5254
IpAddress = ipAddress;
55+
Hostname = hostname;
5356
OperatingSystem = operatingSystem;
5457
GruntSharedSecretPassword = gruntSharedSecretPassword;
5558
GruntRSAPublicKey = gruntRSAPublicKey;
5659
GruntNegotiatedSessionKey = gruntNegotiatedSessionKey;
5760
GruntChallenge = gruntChallenge;
5861
CookieAuthKey = cookieAuthKey;
62+
ActivationTime = activationTime;
63+
LastCheckIn = lastCheckIn;
5964
CustomInit();
6065
}
6166

@@ -77,43 +82,38 @@ public Grunt()
7782
/// <summary>
7883
/// </summary>
7984
[JsonProperty(PropertyName = "originalServerGuid")]
80-
public string OriginalServerGuid { get; private set; }
85+
public string OriginalServerGuid { get; set; }
8186

8287
/// <summary>
8388
/// </summary>
8489
[JsonProperty(PropertyName = "guid")]
8590
public string Guid { get; set; }
8691

8792
/// <summary>
88-
/// Gets or sets possible values include: 'Net40', 'Net35', 'NetCore21'
8993
/// </summary>
90-
[JsonProperty(PropertyName = "dotNetFrameworkVersion")]
91-
public DotNetVersion? DotNetFrameworkVersion { get; set; }
92-
93-
/// <summary>
94-
/// </summary>
95-
[JsonProperty(PropertyName = "listenerId")]
96-
public int? ListenerId { get; set; }
94+
[JsonProperty(PropertyName = "childGrunts")]
95+
public string ChildGrunts { get; set; }
9796

9897
/// <summary>
98+
/// Gets or sets possible values include: 'HTTP', 'SMB'
9999
/// </summary>
100-
[JsonProperty(PropertyName = "covenantIPAddress")]
101-
public string CovenantIPAddress { get; set; }
100+
[JsonProperty(PropertyName = "commType")]
101+
public CommunicationType? CommType { get; set; }
102102

103103
/// <summary>
104104
/// </summary>
105-
[JsonProperty(PropertyName = "childGrunts")]
106-
public string ChildGrunts { get; set; }
105+
[JsonProperty(PropertyName = "smbPipeName")]
106+
public string SmbPipeName { get; set; }
107107

108108
/// <summary>
109109
/// </summary>
110-
[JsonProperty(PropertyName = "usePipes")]
111-
public bool? UsePipes { get; set; }
110+
[JsonProperty(PropertyName = "listenerId")]
111+
public int? ListenerId { get; set; }
112112

113113
/// <summary>
114114
/// </summary>
115-
[JsonProperty(PropertyName = "pipeName")]
116-
public string PipeName { get; set; }
115+
[JsonProperty(PropertyName = "covenantIPAddress")]
116+
public string CovenantIPAddress { get; set; }
117117

118118
/// <summary>
119119
/// </summary>
@@ -131,13 +131,14 @@ public Grunt()
131131
public int? ConnectAttempts { get; set; }
132132

133133
/// <summary>
134+
/// Gets or sets possible values include: 'Net40', 'Net35', 'NetCore21'
134135
/// </summary>
135-
[JsonProperty(PropertyName = "lastCheckIn")]
136-
public string LastCheckIn { get; set; }
136+
[JsonProperty(PropertyName = "dotNetFrameworkVersion")]
137+
public DotNetVersion? DotNetFrameworkVersion { get; set; }
137138

138139
/// <summary>
139140
/// Gets or sets possible values include: 'Uninitialized', 'Stage0',
140-
/// 'Stage1', 'Stage2', 'Active', 'Lost', 'Killed'
141+
/// 'Stage1', 'Stage2', 'Active', 'Lost', 'Killed', 'Disconnected'
141142
/// </summary>
142143
[JsonProperty(PropertyName = "status")]
143144
public GruntStatus? Status { get; set; }
@@ -169,6 +170,11 @@ public Grunt()
169170
[JsonProperty(PropertyName = "ipAddress")]
170171
public string IpAddress { get; set; }
171172

173+
/// <summary>
174+
/// </summary>
175+
[JsonProperty(PropertyName = "hostname")]
176+
public string Hostname { get; set; }
177+
172178
/// <summary>
173179
/// </summary>
174180
[JsonProperty(PropertyName = "operatingSystem")]
@@ -199,5 +205,15 @@ public Grunt()
199205
[JsonProperty(PropertyName = "cookieAuthKey")]
200206
public string CookieAuthKey { get; set; }
201207

208+
/// <summary>
209+
/// </summary>
210+
[JsonProperty(PropertyName = "activationTime")]
211+
public System.DateTime? ActivationTime { get; set; }
212+
213+
/// <summary>
214+
/// </summary>
215+
[JsonProperty(PropertyName = "lastCheckIn")]
216+
public System.DateTime? LastCheckIn { get; set; }
217+
202218
}
203219
}

0 commit comments

Comments
 (0)