-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopenapi.yaml
More file actions
316 lines (316 loc) · 7.92 KB
/
Copy pathopenapi.yaml
File metadata and controls
316 lines (316 loc) · 7.92 KB
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
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
openapi: "3.0.3"
info:
title: ShardC2 Operator API
version: "0.2.0"
description: REST API for ShardC2 command and control framework operator management.
servers:
- url: http://localhost:8443/api/v1
description: Local development
security:
- bearerAuth: []
components:
securitySchemes:
bearerAuth:
type: http
scheme: bearer
description: JWT token from /auth/login or bootstrap token for initial admin creation.
schemas:
Error:
type: object
properties:
error:
type: string
Bot:
type: object
properties:
id: { type: string, format: uuid }
hostname: { type: string }
ip_address: { type: string }
os: { type: string }
architecture: { type: string }
username: { type: string }
mode: { type: string, enum: [beacon, session] }
status: { type: string }
last_seen: { type: string, format: date-time }
Command:
type: object
properties:
id: { type: string, format: uuid }
bot_id: { type: string, format: uuid }
type: { type: string }
payload: { type: string }
status: { type: string }
Campaign:
type: object
properties:
id: { type: string, format: uuid }
name: { type: string }
type: { type: string }
status: { type: string }
Credential:
type: object
properties:
id: { type: string, format: uuid }
username: { type: string }
password: { type: string, description: "Masked by default. Use /credentials/{id}/reveal to see plaintext." }
target: { type: string }
port: { type: integer }
valid: { type: boolean }
Build:
type: object
properties:
id: { type: string, format: uuid }
goos: { type: string }
goarch: { type: string }
profile: { type: string }
status: { type: string, enum: [pending, building, completed, failed] }
Plugin:
type: object
properties:
name: { type: string }
version: { type: string }
description: { type: string }
execution: { type: string, enum: [disabled] }
paths:
/health:
get:
summary: Health check
security: []
responses:
"200":
description: Service healthy
/auth/login:
post:
summary: Operator login
security: []
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
username: { type: string }
password: { type: string }
responses:
"200":
description: JWT token returned
"401":
description: Invalid credentials
"429":
description: Rate limited
/bots:
get:
summary: List registered bots
responses:
"200":
description: Bot list
/bots/{id}:
get:
summary: Get bot details
parameters:
- name: id
in: path
required: true
schema: { type: string, format: uuid }
responses:
"200":
description: Bot details
delete:
summary: Remove bot
parameters:
- name: id
in: path
required: true
schema: { type: string, format: uuid }
responses:
"200":
description: Bot removed
/commands:
post:
summary: Create command
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
bot_id: { type: string, format: uuid }
type: { type: string }
payload: { type: string }
timeout: { type: integer }
responses:
"201":
description: Command created
/commands/batch:
post:
summary: Batch create commands
responses:
"201":
description: Commands created
/commands/history/{bot_id}:
get:
summary: Command history for bot
parameters:
- name: bot_id
in: path
required: true
schema: { type: string, format: uuid }
responses:
"200":
description: Command history
/credentials:
get:
summary: List credentials (passwords masked)
responses:
"200":
description: Credential list
/credentials/{id}/reveal:
get:
summary: Reveal plaintext password (audited)
parameters:
- name: id
in: path
required: true
schema: { type: string, format: uuid }
responses:
"200":
description: Plaintext password
/campaigns:
post:
summary: Create campaign
responses:
"201":
description: Campaign created
get:
summary: List campaigns
responses:
"200":
description: Campaign list
/campaigns/{id}:
get:
summary: Get campaign
parameters:
- name: id
in: path
required: true
schema: { type: string, format: uuid }
responses:
"200":
description: Campaign details
/campaigns/{id}/launch:
post:
summary: Launch campaign
parameters:
- name: id
in: path
required: true
schema: { type: string, format: uuid }
responses:
"200":
description: Campaign launched
/campaigns/validate:
post:
summary: Dry-run validate campaign config
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
type: { type: string }
config: { type: string }
responses:
"200":
description: Validation result with target counts and policy warnings
/exfil:
get:
summary: List exfiltrated data
responses:
"200":
description: Exfil list
/exfil/{id}:
get:
summary: Download exfil data
parameters:
- name: id
in: path
required: true
schema: { type: string, format: uuid }
responses:
"200":
description: File download
/builds:
post:
summary: Request agent build
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
goos: { type: string }
goarch: { type: string }
profile: { type: string }
responses:
"202":
description: Build queued
/builds/{id}:
get:
summary: Get build status
parameters:
- name: id
in: path
required: true
schema: { type: string, format: uuid }
responses:
"200":
description: Build details
/builds/{id}/download:
get:
summary: Download build artifact
parameters:
- name: id
in: path
required: true
schema: { type: string, format: uuid }
responses:
"200":
description: Agent binary
/plugins:
get:
summary: List installed plugins
responses:
"200":
description: Plugin list
/stats:
get:
summary: Server statistics
responses:
"200":
description: Stats
/operators:
post:
summary: Create operator (admin only, or bootstrap token for first admin)
responses:
"201":
description: Operator created
get:
summary: List operators (admin only)
responses:
"200":
description: Operator list
/operators/{id}:
delete:
summary: Deactivate operator (admin only)
parameters:
- name: id
in: path
required: true
schema: { type: string, format: uuid }
responses:
"200":
description: Operator deactivated