-
Notifications
You must be signed in to change notification settings - Fork 1
/
types.go
127 lines (109 loc) · 3.44 KB
/
types.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
package c2api
import (
"fyne.io/fyne/v2"
)
type HttpScan struct {
ID string `json:"id"`
ReqID int64 `json:"reqId"`
AgentIDs string `json:"agentIds"`
}
type HttpScanTask struct {
ScanID string `json:"scanId"`
AgentID string `json:"agentId"`
ReqID int64 `json:"reqId"`
Payload string `json:"payload"`
RawRequest string `json:"rawRequest"`
RawResponse string `json:"rawResponse"`
}
type Attack struct {
ID string `json:"id"`
AgentID string `json:"agentId"`
TargetID string `json:"targetId"`
Comment string `json:"comment"`
}
type Agent struct {
ID string `json:"id"`
Hostname string `json:"hostname"`
PubKeyPEM string `json:"pubKeyPem"`
OS string `json:"os"`
Arch string `json:"arch"`
IpAddress string `json:"ipAddress"`
}
type Message struct {
ID string `json:"id"`
AgentID string `json:"agentId"`
PipelineExecutionID string `json:"pipelineExecutionId"`
FriendlyTitle string `json:"friendlyTitle"`
Request string `json:"request"`
Response string `json:"response"`
CreatedAt int64 `json:"createdAt"`
}
type Pipeline struct {
ID string `json:"id"`
Name string `json:"name"`
Desc string `json:"description"`
Category string `json:"category"`
Settings string `json:"settings"` // JSON stringified "PipelineSettings" variable.
}
type PipelineRun struct {
ID string `json:"id"`
PipelineID string `json:"pipelineId"`
FinishedPipeline string `json:"finishedPipeline"` // JSON stringified "Pipeline" variable.
FinishedAt int64 `json:"finishedAt"`
FinishedAtLabel string `json:"finishedAtLabel"`
}
type PipelineSettings struct {
Input map[string]string `json:"input"`
Steps map[string]PipelineStep `json:"steps"`
}
type PipelineStep struct {
ID string `json:"id"`
Name string `json:"name"`
Position fyne.Position `json:"position"`
Tool Tool `json:"tool"`
LinkedTo []string `json:"linkedTo"` // ID of a steps it is linked towards.
}
type Tool struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
ToolCategoryName string `json:"toolCategoryName"`
Inputs map[string]ToolInput `json:"inputs"`
Outputs map[string]ToolOutput `json:"outputs"`
}
type ToolInput struct {
Type string `json:"type"`
Description string `json:"description"`
Value string `json:"value"`
}
type ToolOutput struct {
Type string `json:"type"`
Value string `json:"value"`
}
type FileRecord struct {
Name string `json:"name"`
AbsolutePath string `json:"absolutePath"`
IsDir bool `json:"isDir"`
}
type FileBrowserCtx struct {
WorkingDir string `json:"wd"`
Records []FileRecord `json:"records"`
Err string `json:"err"`
}
// Refers to ToolInput.Type and ToolOutput.Type
const TOOL_IO_TYPE_STRING = "STRING"
const TOOL_IO_TYPE_FILE = "FILE"
type Target struct {
ID string `json:"id"`
Name string `json:"name"`
Value string `json:"value"`
Type string `json:"type"`
}
type File struct {
ID string `json:"id"`
UploadedByAgentID string `json:"uploadedByAgentId"`
OriginalName string `json:"originalName"`
StorageName string `json:"storageName"`
Uploaded bool `json:"uploaded"`
UploadedAt string `json:"uploadedAt"`
}