-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathprofile.go
264 lines (219 loc) · 11.6 KB
/
profile.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
package malleable
type Profile struct {
SampleName string `parser:"( \"set\" \"sample_name\" @String \";\""`
SleepTime int `parser:"| \"set\" \"sleeptime\" @String \";\""`
Jitter int `parser:"| \"set\" \"jitter\" @String \";\""`
UserAgent string `parser:"| \"set\" \"useragent\" @String \";\""`
DataJitter int `parser:"| \"set\" \"data_jitter\" @String \";\""`
HostStage Boolean `parser:"| \"set\" \"host_stage\" @String \";\""`
Pipename string `parser:"| \"set\" \"pipename\" @String \";\""`
PipenameStager string `parser:"| \"set\" \"pipename_stager\" @String \";\""`
SMBFrameHeader string `parser:"| \"set\" \"smb_frame_header\" @String \";\""`
TCPPort int `parser:"| \"set\" \"tcp_port\" @String \";\""`
TCPFrameHeader string `parser:"| \"set\" \"tcp_frame_header\" @String \";\""`
SSHBanner string `parser:"| \"set\" \"ssh_banner\" @String \";\""`
SSHPipename string `parser:"| \"set\" \"ssh_pipename\" @String \";\""`
StealTokenAccessMask int `parser:"| \"set\" \"steal_token_access_mask\" @String \";\""`
TasksMaxSize int `parser:"| \"set\" \"tasks_max_size\" @String \";\""`
TasksProxyMaxSize int `parser:"| \"set\" \"tasks_proxy_max_size\" @String \";\""`
TasksDNSProxyMaxSize int `parser:"| \"set\" \"tasks_dns_proxy_max_size\" @String \";\""`
HeadersRemove CommaSeparatedList `parser:"| \"set\" \"headers_remove\" @String \";\""`
DNSBeacon []DNSBeacon `parser:"| \"dns-beacon\" @@"`
HTTPBeacon []HTTPBeacon `parser:"| \"http-beacon\" @@"`
HTTPSCertificate []HTTPSCertificate `parser:"| \"https-certificate\" @@"`
CodeSigner CodeSigner `parser:"| \"code-signer\" \"{\" @@ \"}\""`
HTTPConfig HTTPConfig `parser:"| \"http-config\" \"{\" @@ \"}\""`
HTTPGet []HTTPGet `parser:"| \"http-get\" @@"`
HTTPPost []HTTPPost `parser:"| \"http-post\" @@"`
HTTPStager []HTTPStager `parser:"| \"http-stager\" @@"`
Stage Stage `parser:"| \"stage\" \"{\" @@ \"}\""`
ProcessInject ProcessInject `parser:"| \"process-inject\" \"{\" @@ \"}\""`
PostEx PostEx `parser:"| \"post-ex\" \"{\" @@ \"}\" )*"`
}
func (d Profile) String() string {
return printStruct(0, d)
}
type DNSBeacon struct {
Name string `parser:"@String? \"{\""`
DNSIdle string `parser:"( \"set\" \"dns_idle\" @String \";\""`
DNSMaxTXT int `parser:"| \"set\" \"dns_max_txt\" @String \";\""`
DNSSleep int `parser:"| \"set\" \"dns_sleep\" @String \";\""`
DNSTTL int `parser:"| \"set\" \"dns_ttl\" @String \";\""`
MaxDNS int `parser:"| \"set\" \"maxdns\" @String \";\""`
DNSStagerPrepend string `parser:"| \"set\" \"dns_stager_prepend\" @String \";\""`
DNSStagerSubhost string `parser:"| \"set\" \"dns_stager_subhost\" @String \";\""`
Beacon string `parser:"| \"set\" \"beacon\" @String \";\""`
GetA string `parser:"| \"set\" \"get_A\" @String \";\""`
GetAAAA string `parser:"| \"set\" \"get_AAAA\" @String \";\""`
GetTXT string `parser:"| \"set\" \"get_TXT\" @String \";\""`
PutMetadata string `parser:"| \"set\" \"put_metadata\" @String \";\""`
PutOutput string `parser:"| \"set\" \"put_output\" @String \";\""`
NSResponse string `parser:"| \"set\" \"ns_response\" @String \";\")* \"}\""`
}
func (b DNSBeacon) String() string {
return printNamed(0, "dns-beacon", b.Name, b)
}
type HTTPBeacon struct {
Name string `parser:"@String? \"{\""`
Library string `parser:"( \"set\" \"library\" @String \";\")* \"}\""`
}
func (b HTTPBeacon) String() string {
return printNamed(0, "http-beacon", b.Name, b)
}
type HTTPSCertificate struct {
Name string `parser:"@String? \"{\""`
Keystore string `parser:"( \"set\" \"keystore\" @String \";\""`
Password string `parser:"| \"set\" \"password\" @String \";\""`
C string `parser:"| \"set\" \"C\" @String \";\""`
CN string `parser:"| \"set\" \"CN\" @String \";\""`
L string `parser:"| \"set\" \"L\" @String \";\""`
O string `parser:"| \"set\" \"O\" @String \";\""`
OU string `parser:"| \"set\" \"OU\" @String \";\""`
ST string `parser:"| \"set\" \"ST\" @String \";\""`
Validity int `parser:"| \"set\" \"validity\" @String \";\")* \"}\""`
}
func (b HTTPSCertificate) String() string {
return printNamed(0, "https-certificate", b.Name, b)
}
type CodeSigner struct {
Keystore string `parser:"( \"set\" \"keystore\" @String \";\""`
Password string `parser:"| \"set\" \"password\" @String \";\""`
Alias string `parser:"| \"set\" \"alias\" @String \";\""`
DigestAlgorithm string `parser:"| \"set\" \"digest_algorithm\" @String \";\""`
Timestamp Boolean `parser:"| \"set\" \"timestamp\" @String \";\""`
TimestampURL string `parser:"| \"set\" \"timestamp_url\" @String \";\" )*"`
}
func (b CodeSigner) String() string {
return printUnnamed(0, "code-signer", b)
}
type HTTPConfig struct {
HeadersOrder CommaSeparatedList `parser:"( \"set\" \"headers\" @String \";\""`
Headers []Header `parser:"| \"header\" @@ \";\""`
TrustXForwardedFor Boolean `parser:"| \"set\" \"trust_x_forwarded_for\" @String \";\""`
BlockUserAgents CommaSeparatedList `parser:"| \"set\" \"block_useragents\" @String \";\""`
AllowUserAgents CommaSeparatedList `parser:"| \"set\" \"allow_useragents\" @String \";\")*"`
}
func (b HTTPConfig) String() string {
return printUnnamed(0, "http-config", b)
}
type HTTPGet struct {
Name string `parser:"@String? \"{\""`
Verb string `parser:"( \"set\" \"verb\" @String \";\""`
URI SpaceSeparatedList `parser:"| \"set\" \"uri\" @String \";\""`
Client HTTPGetClient `parser:"| \"client\" \"{\" @@ \"}\""`
Server HTTPServer `parser:"| \"server\" \"{\" @@ \"}\" )* \"}\""`
}
func (b HTTPGet) String() string {
return printNamed(0, "http-get", b.Name, b)
}
type HTTPGetClient struct {
Headers []Header `parser:"( \"header\" @@ \";\""`
Parameters []Parameter `parser:"| \"parameter\" @@ \";\""`
Metadata []Function `parser:"| \"metadata\" \"{\" @@* \"}\" )*"`
}
func (b HTTPGetClient) String() string {
return printUnnamed(1, "client", b)
}
type HTTPPost struct {
Name string `parser:"@String? \"{\""`
Verb string `parser:"( \"set\" \"verb\" @String \";\""`
URI SpaceSeparatedList `parser:"| \"set\" \"uri\" @String \";\""`
Client HTTPPostClient `parser:"| \"client\" \"{\" @@ \"}\""`
Server HTTPServer `parser:"| \"server\" \"{\" @@ \"}\" )* \"}\""`
}
func (b HTTPPost) String() string {
return printNamed(0, "http-post", b.Name, b)
}
type HTTPPostClient struct {
Headers []Header `parser:"( \"header\" @@ \";\""`
Parameters []Parameter `parser:"| \"parameter\" @@ \";\""`
Output []Function `parser:"| \"output\" \"{\" @@* \"}\""`
ID []Function `parser:"| \"id\" \"{\" @@* \"}\" )*"`
}
func (b HTTPPostClient) String() string {
return printUnnamed(1, "client", b)
}
type HTTPStager struct {
Name string `parser:"@String? \"{\""`
URIx86 SpaceSeparatedList `parser:"( \"set\" \"uri_x86\" @String \";\""`
URIx64 SpaceSeparatedList `parser:"| \"set\" \"uri_x64\" @String \";\""`
Client HTTPStagerClient `parser:"| \"client\" \"{\" @@ \"}\""`
Server HTTPServer `parser:"| \"server\" \"{\" @@ \"}\" )* \"}\""`
}
func (b HTTPStager) String() string {
return printNamed(0, "http-stager", b.Name, b)
}
type HTTPStagerClient struct {
Headers []Header `parser:"( \"header\" @@ \";\""`
Parameters []Parameter `parser:"| \"parameter\" @@ \";\" )*"`
}
func (b HTTPStagerClient) String() string {
return printUnnamed(1, "client", b)
}
type HTTPServer struct {
Headers []Header `parser:"( \"header\" @@ \";\""`
Output []Function `parser:"| \"output\" \"{\" @@* \"}\" )*"`
}
func (b HTTPServer) String() string {
return printUnnamed(1, "server", b)
}
type Stage struct {
Checksum int `parser:"( \"set\" \"checksum\" @String \";\""`
CompileTime string `parser:"| \"set\" \"compile_time\" @String \";\""`
EntryPoint int `parser:"| \"set\" \"entry_point\" @String \";\""`
ImageSizeX86 int `parser:"| \"set\" \"image_size_x86\" @String \";\""`
ImageSizeX64 int `parser:"| \"set\" \"image_size_x64\" @String \";\""`
Name string `parser:"| \"set\" \"name\" @String \";\""`
RichHeader string `parser:"| \"set\" \"rich_header\" @String \";\""`
UseRWX Boolean `parser:"| \"set\" \"userwx\" @String \";\""`
Cleanup Boolean `parser:"| \"set\" \"cleanup\" @String \";\""`
SleepMask Boolean `parser:"| \"set\" \"sleep_mask\" @String \";\""`
StompPE Boolean `parser:"| \"set\" \"stomppe\" @String \";\""`
Obfuscate Boolean `parser:"| \"set\" \"obfuscate\" @String \";\""`
Allocator string `parser:"| \"set\" \"allocator\" @String \";\""`
MagicMZX86 string `parser:"| \"set\" \"magic_mz_x86\" @String \";\""`
MagicMZX64 string `parser:"| \"set\" \"magic_mz_x64\" @String \";\""`
MagicPE string `parser:"| \"set\" \"magic_pe\" @String \";\""`
SmartInject Boolean `parser:"| \"set\" \"smartinject\" @String \";\""`
ModuleX86 string `parser:"| \"set\" \"module_x86\" @String \";\""`
ModuleX64 string `parser:"| \"set\" \"module_x64\" @String \";\""`
SyscallMethod string `parser:"| \"set\" \"syscall_method\" @String \";\""`
TransformX86 []Function `parser:"| \"transform-x86\" \"{\" @@* \"}\""`
TransformX64 []Function `parser:"| \"transform-x64\" \"{\" @@* \"}\""`
Data []Data `parser:"| \"data\" @String \";\""`
Strings []String `parser:"| \"string\" @String \";\""`
SwtringsW []StringW `parser:"| \"stringw\" @String \";\" )*"`
}
func (b Stage) String() string {
return printUnnamed(0, "stage", b)
}
type ProcessInject struct {
Allocator string `parser:"( \"set\" \"allocator\" @String \";\""`
BOFAllocator string `parser:"| \"set\" \"bof_allocator\" @String \";\""`
BOFReuseMemory Boolean `parser:"| \"set\" \"bof_reuse_memory\" @String \";\""`
MinAlloc int `parser:"| \"set\" \"min_alloc\" @String \";\""`
UseRWX Boolean `parser:"| \"set\" \"userwx\" @String \";\""`
StartRWX Boolean `parser:"| \"set\" \"startrwx\" @String \";\""`
TransformX86 []Function `parser:"| \"transform-x86\" \"{\" @@* \"}\""`
TransformX64 []Function `parser:"| \"transform-x64\" \"{\" @@* \"}\""`
Execute []Function `parser:"| \"execute\" \"{\" @@* \"}\" )*"`
}
func (b ProcessInject) String() string {
return printUnnamed(0, "process-inject", b)
}
type PostEx struct {
SpawnToX86 string `parser:"( \"set\" \"spawnto_x86\" @String \";\""`
SpawnToX64 string `parser:"| \"set\" \"spawnto_x64\" @String \";\""`
Obfuscate Boolean `parser:"| \"set\" \"obfuscate\" @String \";\""`
SmartInject Boolean `parser:"| \"set\" \"smartinject\" @String \";\""`
AmsiDisable Boolean `parser:"| \"set\" \"amsi_disable\" @String \";\""`
Cleanup Boolean `parser:"| \"set\" \"cleanup\" @String \";\""`
ThreadHint string `parser:"| \"set\" \"thread_hint\" @String \";\""`
PipeName string `parser:"| \"set\" \"pipename\" @String \";\""`
Keylogger string `parser:"| \"set\" \"keylogger\" @String \";\""`
TransformX86 []Function `parser:"| \"transform-x86\" \"{\" @@* \"}\""`
TransformX64 []Function `parser:"| \"transform-x64\" \"{\" @@* \"}\" )*"`
}
func (b PostEx) String() string {
return printUnnamed(0, "post-ex", b)
}