forked from netcoredor/openc2-cmdgen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
245 lines (238 loc) · 15 KB
/
index.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>OpenC2 Command Generator Version 0.1</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<link rel="stylesheet" href="assets/css/Footer-Basic.css">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="assets/css/styles.css">
<link rel="stylesheet" href="assets/css/tabs-Menu.css">
</head>
<body>
<div id="openc2_Action"></div>
<div id="openc2_Target"></div>
<div id="openc2_TargetSpecifier"></div>
<div>
<div class="container">
<div class="row justify-content-center align-items-center">
<div class="col-md-8 col-lg-11">
<nav class="navbar navbar-dark navbar-expand-md bg-primary">
<div class="container-fluid">
<a class="navbar-brand" href="#">OpenC2</a>
<button class="navbar-toggler" data-toggle="collapse" data-target="#navcol-1">
<span class="sr-only">Toggle navigation</span>
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navcol-1">
<ul class="nav navbar-nav">
<li class="nav-item" role="presentation">
<a class="nav-link" href="#"></a>
</li>
<li class="nav-item" role="presentation">
<a class="nav-link" href="#"></a>
</li>
<li class="nav-item" role="presentation">
<a class="nav-link active" href="#" style="font-size:16px;"> </a>
</li>
<li class="nav-item" role="presentation">
<a class="nav-link" href="#"></a>
</li>
</ul>
</div>
</div>
</nav>
<div></div>
<div class="card">
<div class="card-body">
<h2 class="text-muted card-title mb-2">Build your own OpenC2 command
<br>
</h2>
<p class="card-text">
<br> OpenC2 Command Generator version 0.1 allows you to create an OpenC2 command by simply
creating a sentence based on the action you would like to perform. The generator will generate
the OpenC2 command to preview. You can also download sample code ready to use in curl,
python or nodejs. Want to contribute? This code is located at <a href="https://github.com/netcoredor/openc2-cmdgen">Github</a>.
<H6>Tool tested on Chrome.</H6>
</p>
</div>
</div>
<div class="card">
<div class="card-body">
<h4 class="text-secondary card-title">OpenC2 Command Generation Step by Step</h4>
</div>
<div class="card-body d-inline">
<div class="table-responsive-lg">
<table class="table">
<thead>
<tr></tr>
</thead>
<tbody>
<tr class="actionRow">
<td>I want to</td>
<td class="actionTD">
<div class="dropdown">
<button class="btn btn-light dropdown-toggle visible" data-toggle="dropdown"
aria-expanded="false" type="button" id="actionButtonId">action</button>
<div class="dropdown-menu" role="menu" id="actionId"></div>
</div>
</td>
</tr>
<tr class="targetRow">
<td>on a </td>
<td class="targetTD">
<div class="dropdown targetDropDown">
<button class="btn btn-light dropdown-toggle" data-toggle="dropdown" aria-expanded="false"
type="button" id="targetButtonId">target</button>
<div class="dropdown-menu" role="menu" id="targetId"></div>
</div>
</td>
</tr>
<tr class="actuatorRow">
<td>and I want it executed by</td>
<td class="actuatorTD">
<div class="dropdown">
<button class="btn btn-light dropdown-toggle" data-toggle="dropdown" aria-expanded="false"
type="button" id="actuatorButtonId">actuator</button>
<div class="dropdown-menu" role="menu" id="actuatorId"></div>
</div>
</td>
</tr>
<tr>
<td></td>
<td>
<button class="btn btn-success" type="button" id="generateCodeId">Generate Code</button>
<button class="btn btn-warning m-auto" type="button"
id="resetSelectionsId">Reset Selections</button>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div></div>
<div>
<a class="btn btn-dark btn-block" data-toggle="collapse" aria-expanded="false" aria-controls="collapse-1"
role="button" href="#collapse-1" id="viewSampleCommandId">Raw OpenC2 Command</a>
<div class="collapse" id="collapse-1">
<p id="commandSampleContent">
<pre><div id="commandSampleContentPre">{}</div></pre>
</p>
</div>
</div>
<div>
<a class="btn btn-info btn-block d-block float-none" data-toggle="collapse" aria-expanded="false" aria-controls="collapse-2"
role="button" href="#collapse-2" id="sampleCodeDownloadId">Sample Code to Download</a>
<div class="collapse" id="collapse-2">
<div class="card">
<div class="card-body">
<h4 class="card-title">Code</h4>
<p class="card-text">After selecting your desired command, you can download sample code to run with these
three different programs.</p>
<div>
<ul class="nav nav-tabs">
<li class="nav-item" id="curlTabId">
<a class="nav-link" role="tab" data-toggle="tab" href="#tab-1">Curl</a>
</li>
<li class="nav-item" id="nodeJsTabId">
<a class="nav-link" role="tab" data-toggle="tab" href="#tab-2">NodeJs</a>
</li>
<li class="nav-item">
<a class="nav-link active" role="tab" data-toggle="tab" href="#tab-3" id="pythonTabId">Python</a>
</li>
</ul>
<div class="tab-content">
<div class="tab-pane" role="tabpanel" id="tab-1">
<p>
<pre><div id="curlCodeText">Custom Curl Code</div></pre>
</p>
</div>
<div class="tab-pane" role="tabpanel" id="tab-2">
<p>
<pre><div id="nodejsCodeText">Custom Nodejs Code</div></pre>
</p>
</div>
<div class="tab-pane active" role="tabpanel" id="tab-3">
<p>
<pre><div id="pythonCodeText">Custom Python Code</div></pre>
</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div>
<a class="btn btn-secondary btn-block d-block float-none" data-toggle="collapse" aria-expanded="true"
aria-controls="collapse-3" role="button" href="#collapse-3" id="oc2ServerSetup">OpenC2 Server Connection Setup and Execution</a>
<div class="collapse" id="collapse-3">
<div class="card">
<div class="card-body">
<h5 class="card-title">OpenC2 Connection information</h5>
<div class="table-responsive">
<table class="table">
<thead>
<tr>
<th>OpenC2 Server URI</th>
<th>
<input type="url" value="http://localhost:1512/oc2/" inputmode="url"
id="oc2ServerId" onkeydown="$(this).attr('size', $(this).val().length);"
/>
<br />
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<strong>OpenC2 Server API Key</strong>
<br />
</td>
<td>
<input type="text" value="07849cf8aade4ed278b43796ba8c3d3171f424bc38e597e95fd45d536f886ba4"
id="oc2ServerKeyId" size="30" />
</td>
</tr>
<tr>
<td>
<strong>Execute Command</strong>
<br />
</td>
<td>
<button class="btn btn-danger m-auto" type="button" id="executeNowId">Execute Command</button>
</td>
</tr>
<tr></tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="footer-basic">
<footer class="align-items-center">
<ul class="list-inline">
<li class="list-inline-item">
<a href="#">Home</a>
</li>
<li class="list-inline-item">
<a href="#">About</a>
</li>
</ul>
<p class="copyright"><a href="/license.txt">Apache 2 License</a></p>
</footer>
</div>
<script src="http://code.jquery.com/jquery-3.3.1.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
<script type="text/javascript" src="assets/js/myscript.js"></script>
</body>
</html>