forked from proabiral/inception
-
Notifications
You must be signed in to change notification settings - Fork 0
/
providerCreate.html
450 lines (351 loc) · 18.6 KB
/
providerCreate.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
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
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
<!DOCTYPE html>
<html lang="en">
<script>
const hintText="{{ Fill details above for new test case }}";
const PayloadHeaderDiv="<br><div id=\"payloadHeaderDiv\"> <div class=\"row\"> <div class=\"col\"> Header Name <input class=\"form-control\" type=\"text\" name=\"payload1\" required class=\"payload\"> </div> <div class=\"col\"> Header Value <input type=\"text\" class=\"form-control\" name=\"payload2\" class=\"payload\" required></div><div class=\"col-2\"> <br><input type=\"button\" class=\"btn\" value=\"+\" onclick=\"addHeaderField()\"> <input id=\"minusbuttonID\" class=\"btn\" type=\"button\" value=\"-\" onclick=\"minusButton(this.parentElement)\"></div> </div>";
const PayloadBodyDiv="<div id=\"payloadBodyDiv\"> <div class=\"row\"> <div class=\"col\"> <input class=\"form-control\" type=\"text\" name=\"payload\" value=\"/\" class=\"payload\" required> </div> <div class=\"col-2\"><input type=\"button\" class=\"btn\" value=\"+\" onclick=\"addEndpointField()\"> <input type=\"button\" class=\"btn\" value=\"-\" onclick=\"minusButton(this.parentElement)\"> <br> <br> </div></div></div>";
const StatusCodeBodyDiv=" <div id=\"StatusCodeBodyDiv\"> <div class=\"row\"> <div class=\"col-2\">Status Code : </div> <div class=\"col-4\"> <input class=\"form-control\" type=\"number\" id=\"statusCode\"></div><div class=\"col-2\"> <input type=\"button\" class=\"btn\" value=\"+\" onclick=\"addStatuCodeField()\"> <input id=\"minusbuttonID\" class=\"btn\" type=\"button\" value=\"-\" onclick=\"minusButton(this.parentElement)\"><br> <br></div></div> </div>";
const responseBodyDivS="<div id=\"responseDiv\"><select onchange=\"changeOption(this)\" class=\"delimiter\"> <option value=\"||||\">OR</option> <option value=\"&&&&\">AND</option></select> <br><br> What to check for in Response Body <div class=\"row\"> <div class=\"col\"> <input type=\"text\" class=\"form-control response \" name=\"payload1\"> </div> <div class=\"col-2\"> <input type=\"button\" class=\"btn\" value=\"+\" onclick=\"addResponseField()\"> <input id=\"minusbuttonID\" class=\"btn\" type=\"button\" value=\"-\" onclick=\"minusButton(this.parentElement.parentElement)\"> <br> <br> </div> </div></div>";
const responseBodyDiv="<div id=\"responseDiv\">\n" +
" <div class=\"row\">\n" +
" <div class=\"col\">\n" +
" <label>What to check for in Response Body</label>\n" +
" <input class=\"form-control response\" placeholder=\"PHP Version\" type=\"text\" name=\"checkFor\" id=\"checkFor\" required> <br>\n" +
" </div>\n" +
" <div class=\"col-2\">\n" +
" <br>\n" +
" <input type=\"button\" class=\"btn\" value=\"+\" onclick=\"addResponseField()\">\n" +
" </div>\n" +
" </div>\n";
" </div>";
const responseHeaderDivS="<div id=\"responseDiv\"><select onchange=\"changeOption(this)\" class=\"delimiter\"> <option value=\"||||\">OR</option> <option value=\"&&&&\">AND</option></select> <br><br> What to check for in Response Header <div class=\"row\"> <div class=\"col\"> <label>Header Name</label> <input type=\"text\" class=\"form-control response\" name=\"payload1\" > </div> <div class=\"col\"> <label> Header Value </label> <input class=\"form-control response \" type=\"text\" name=\"payload2\" > </div> <div class=\"col-2\"> <br> <input type=\"button\" class=\"btn\" value=\"+\" onclick=\"addResponseField()\"> <input id=\"minusbuttonID\" class=\"btn\" type=\"button\" value=\"-\" onclick=\"minusButton(this.parentElement.parentElement)\"> </div></div><br> <br> </div>";
const responseHeaderDiv="<div id=\"responseDiv\"> What to check for in Response Header <div class=\"row\"> <div class=\"col\"> <label>Header Name</label> <input type=\"text\" class=\"form-control response\" name=\"payload1\" > </div> <div class=\"col\"> <label> Header Value </label> <input class=\"form-control response \" type=\"text\" name=\"payload2\" > </div> <div class=\"col-2\"> <br> <input type=\"button\" class=\"btn\" value=\"+\" onclick=\"addResponseField()\"> </div></div> <br> <br> </div>";
function changeOption(xoxo){
document.querySelectorAll(".delimiter").forEach(function(element) {element.selectedIndex=xoxo.selectedIndex})
}
function responseDiv(){
if(document.getElementById('checkIn').value == "responseHeader") {
document.querySelector("#responseDiv").innerHTML=responseHeaderDiv;
document.getElementById('minusbuttonID').style="display:none"
}
else{
document.querySelector("#responseDiv").innerHTML=responseBodyDiv
}
}
jsonIndex=0;
function jsonGenerator() {
json[jsonIndex]={};
json[jsonIndex].vulnerability=document.querySelector("#vulnerability").value;
json[jsonIndex].method=document.querySelector("#method").value;
json[jsonIndex].color=document.querySelector("#color").value;
json[jsonIndex].body=document.querySelector("#postBody").value;
json[jsonIndex].endpoint=[];
json[jsonIndex].headers=[];
endpoints=document.querySelectorAll("#endPointPDiv input[type=\"text\"]");
for (var i = 0; i < endpoints.length; i++) {
json[jsonIndex].endpoint[i]=endpoints[i].value;
}
json[jsonIndex].headers=[];
headers=document.querySelectorAll("#headerPDiv input[type=\"text\"]");
for (var i=0; i < headers.length; i+=2){
if (headers[i].value!=""){
j=i/2;
json[jsonIndex].headers[j]=[];
json[jsonIndex].headers[j][0]=headers[i].value;
json[jsonIndex].headers[j][1]=headers[i+1].value
}
}
json[jsonIndex].checkIn=document.querySelector("#checkIn").value;
if (document.querySelector("#contentLength").value != "") {
json[jsonIndex].contentLength = {}
json[jsonIndex].contentLength.operator = document.querySelector("#contentLenOperator").value
json[jsonIndex].contentLength.length = Number(document.querySelector("#contentLength").value)
}
y=document.querySelectorAll(".response");
if (document.getElementById("statusCode").value != "") {
json[jsonIndex].statusCode=[];
statusCode=document.querySelectorAll("#StatusCodeBodyDiv input[type=\"number\"]");
for (var i = 0; i < statusCode.length; i++) {
json[jsonIndex].statusCode[i]=Number(statusCode[i].value);
}
}
json[jsonIndex].regexCheck=document.querySelector("#regexCheck").checked;
json[jsonIndex].checkFor="";
if(document.getElementById('checkIn').value == "responseBody") {
for (var i=0; i < y.length; i++){
if (i==0){
json[jsonIndex].checkFor=y[i].value
}
else if (y[i].value !== ""){
delimiter=document.querySelector(".delimiter").value;
json[jsonIndex].checkFor=y[i].value+delimiter+json[jsonIndex].checkFor
}
}
}
else{
for (var i=0; i < y.length; i+=2){
if (i==0){
json[jsonIndex].checkFor=y[i].value+": "+y[i+1].value
}
else if (y[i].value !== ""){
delimiter=document.querySelector(".delimiter").value;
json[jsonIndex].checkFor=y[i].value+": "+y[i+1].value+delimiter+json[jsonIndex].checkFor
}
}
}
}
function addEndpointField() {
document.querySelector("#endPointPDiv").insertAdjacentHTML("beforeend",PayloadBodyDiv)
}
function addStatuCodeField() {
document.querySelector("#StatusCodeBodyDiv").insertAdjacentHTML("beforeend",StatusCodeBodyDiv)
}
function addHeaderField() {
document.querySelector("#headerPDiv").insertAdjacentHTML("beforeend",PayloadHeaderDiv)
}
function addResponseField(){
if(document.getElementById('checkIn').value == "responseBody") {
document.querySelector("#responseDiv").insertAdjacentHTML("beforeend",responseBodyDivS)
}
else{
document.querySelector("#responseDiv").insertAdjacentHTML("beforeend",responseHeaderDivS)
}
document.querySelectorAll(".delimiter").forEach(function(element) {element.selectedIndex=document.querySelector('.delimiter').selectedIndex})
}
function minusButton(xoxo){
xoxo.parentElement.parentElement.removeChild(xoxo.parentElement)
}
function vulnerabilityIsEmpty(){
if (document.forms[0].vulnerability.value=="") {
alert("fill up the vulnerability details");
return true
}
else{
return false
}
}
function payloadIsEmpty(){
var payloadFieldArray=document.querySelectorAll(".payload");
for (var i = 0; i < payloadFieldArray.length; i++) {
if (payloadFieldArray[i].value==""){
alert("fill up all payload section");
return true
}
else{
return false
}
}
}
function isNotEmpty(){
if (!vulnerabilityIsEmpty() && !payloadIsEmpty()){
return true
}
}
function saveValue(){
}
function moreVulnerability(xoxo){
if (isNotEmpty()){
console.log("works");
jsonGenerator();
jsonIndex++;
previousValueCheckIn = document.querySelector("#checkIn").value;
if (document.querySelector(".delimiter")){
previousID = document.querySelector(".delimiter").selectedIndex
}
xoxo.form.reset();
document.querySelector("#checkIn").value = previousValueCheckIn;
document.querySelectorAll(".delimiter").forEach(function(element) {element.selectedIndex=previousID});
document.querySelector('#jsonOutput').value=JSON.stringify(json, null, 4);
document.getElementById('hint').innerText=hintText;
}
}
function jsonPrint(xoxo){
if (isNotEmpty()){
jsonGenerator();
previousValueCheckIn = document.querySelector("#checkIn").value;
xoxo.form.reset();
document.querySelector("#checkIn").value = previousValueCheckIn;
document.querySelector('#jsonOutput').value=JSON.stringify(json, null, 4)
}
}
</script>
<body onload="json=[]; responseDiv()">
<h1>
Create Fingerprints for <a href="https://github.com/proabiral/inception">inception</a>
</h1>
<br>
<form class="form-horizontal">
<div class="form-group">
<div class="row">
<div class="col-2">
<label for="Vulnerability Name"> Vulnerability Name: </label>
</div>
<div class="col-8">
<input type="text" name="vulnerability" placeholder="PHP info Page disclosure" id="vulnerability" required class="form-control">
</div>
</div>
</div>
<div class="form-group">
<div class="row">
<div class="col-2">
<label for="Method" style="padding-top: 6%">
Method :
</label>
</div>
<div class="col-2">
<select name="method" id="method" class="form-control">
<option value="GET">GET</option>
<option value="HEAD">HEAD</option>
<option value="POST">POST</option>
<option value="PUT">PUT</option>
<option value="DELETE">DELETE</option>
</select>
</div>
</div>
</div>
<div class="form-group">
<div id="endPointPDiv">
<div id="endpointDiv">
<label for="Endpoint">
Endpoint where request will be send:
</label>
<div class="row">
<div class="col">
<input class="form-control" type="text" placeholder="/phpinfo.php" class="payload" value="/" required>
</div>
<div class="col-2">
<input type="button" class="btn" value="+" onclick="addEndpointField()"> <br><br>
</div>
</div>
</div>
</div>
</div>
<div class="form-group">
<div id="headerPDiv">
Headers to be send {leave empty if you don't want any custom header}
<div id="headerDiv">
<div class="row">
<div class="col">
<label>Header Name</label>
<input type="text" name="payload1" class="form-control" placeholder="Referer">
</div>
<div class="col">
<label>
Header Value
</label>
<input class="form-control" type="text" name="payload2" class="payload" placeholder="https://google.com">
</div>
<div class="col-2">
<br>
<input type="button" class="btn" value="+" onclick="addHeaderField()">
<input id="minusbuttonID" type="button" value="-" onclick="minusButton(this)" style="display: none;">
</div>
</div>
</div>
</div>
<div class="form-group">
<br>
<label> Body to be send in request </label>
<textarea class="form-control" rows="11" cols="80" id="postBody" placeholder='Place post data as follows ; make sure to use appropriate Content-Type: header if needed; {"username":"admin","password":"secret"} or field1=value1&field2=value2 or --boundary Content-Disposition: form-data; name="field1" value1 --boundary Content-Disposition: form-data; name="field2"; filename="example.txt" '></textarea>
<br>
</div>
<div class="form-group">
<div id="StatusCodeBodyDiv">
<div class="row">
<div class="col-2">
<label style="padding-top: 6%">
Status Code :
</label>
</div>
<div class="col-4">
<input class="form-control" type="number" id="statusCode" placeholder="200">
</div>
<div class="col-2">
<input type="button" class="btn" value="+" onclick="addStatuCodeField()"><br><br>
</div>
</div>
</div>
{Status code that need to be matched for vulnerability detection, leave empty if status code check is not needed.}
<br><br>
<div class="form-group">
<div id="ContentLengthDiv">
<div class="row">
<div class="col-2">
<label style="padding-top: 6%">
Content Length
</label>
</div>
<div class="col-4">
<select class="form-control" id="contentLenOperator">
<option value="<">Less Than</option>
<option value="=">Equals</option>
<option value=">">Greater Than</option>
</select> <!-- drop down responseBody --><br>
</div>
<div class="col-4">
<input class="form-control" type="number" id="contentLength">
</div>
</div>
</div>
{Content Length that need to be matched for vulnerability detection, leave empty if Content Length check is not needed.}
<br><br>
<div class="form-group"><br>
<div class="row">
<div class="col-2">
<label style="padding-top: 6%">
Check in :
</label>
</div>
<div class="col-4">
<select class="form-control" name="checkIn" id="checkIn" onchange="responseDiv()">
<option value="responseBody">Response Body</option>
<option value="responseHeader">Response Header</option>
</select> <!-- drop down responseBody --><br>
</div>
</div>
</div>
<div class="form-group">
<div id="responsePdiv">
<div id="responseDiv">
{{/* Will be filled on body onload*/}}
</div>
{Case Sensitive ; Leave empty if you want to only send request}
</div>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" id="regexCheck">
<label for="regexCheck" class="form-check-label">
Perform Regex Check
<label>
</div>
<div class="form-group">
<br>
<label>
Severity to Assign
</label>
<select name="color" id="color" class="form-control">
<option value="blue">Low</option>
<option value="yellow">Medium</option>
<option value="red">High</option>
</select>
</div>
<input type="button" class="btn" value="Add more vulnerabilities" onclick="moreVulnerability(this);">
<div id="hint"> </div>
<br> <br>
<input type="button" class="btn" value="Generate JSON" onclick="jsonPrint(this)">
<br> <br>
</form>
<textarea id="jsonOutput" rows="40" cols="90">
</textarea>
</body>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<style>
body {
display: block;
margin: 8px;
margin-top: 8px;
margin-right: 20%;
margin-left: 20%;
}
</style>
</html>