@@ -75,6 +75,16 @@ class SQLMapGenerator {
75
75
customUserAgentGroup . style . display = 'none' ;
76
76
}
77
77
} ) ;
78
+
79
+ // CSRF method custom field toggle
80
+ document . getElementById ( 'csrfMethod' ) . addEventListener ( 'change' , ( e ) => {
81
+ const customCsrfMethodGroup = document . getElementById ( 'customCsrfMethodGroup' ) ;
82
+ if ( e . target . value === 'custom' ) {
83
+ customCsrfMethodGroup . style . display = 'block' ;
84
+ } else {
85
+ customCsrfMethodGroup . style . display = 'none' ;
86
+ }
87
+ } ) ;
78
88
}
79
89
80
90
setupTabs ( ) {
@@ -210,7 +220,7 @@ class SQLMapGenerator {
210
220
if ( data ) config [ '--data' ] = data ;
211
221
212
222
const paramDel = document . getElementById ( 'paramDel' ) . value . trim ( ) ;
213
- if ( paramDel ) config [ '--param-del' ] = paramDel ;
223
+ if ( paramDel && paramDel !== "&" ) config [ '--param-del' ] = paramDel ;
214
224
215
225
const host = document . getElementById ( 'host' ) . value . trim ( ) ;
216
226
if ( host ) config [ '--host' ] = host ;
@@ -224,7 +234,7 @@ class SQLMapGenerator {
224
234
config [ '--mobile' ] = true ;
225
235
}
226
236
else if ( userAgent && userAgent === 'custom' ) {
227
- const customUserAgent = document . getElementById ( 'customUserAgent' ) . value . trim ( ) ;
237
+ const customUserAgent = document . getElementById ( 'customUserAgent' ) . value ;
228
238
if ( customUserAgent ) config [ '-A' ] = customUserAgent ;
229
239
}
230
240
else if ( userAgent ) {
@@ -240,6 +250,44 @@ class SQLMapGenerator {
240
250
const cookie = document . getElementById ( 'cookie' ) . value . trim ( ) ;
241
251
if ( cookie ) config [ '--cookie' ] = cookie ;
242
252
253
+ const cookieDel = document . getElementById ( 'cookieDel' ) . value . trim ( ) ;
254
+ if ( cookieDel ) config [ '--cookie-del' ] = cookieDel ;
255
+
256
+ const cookieLive = document . getElementById ( 'cookieLive' ) . value . trim ( ) ;
257
+ if ( cookieLive ) config [ '--live-cookies' ] = cookieLive ;
258
+
259
+ const cookieLoad = document . getElementById ( 'cookieLoad' ) . value . trim ( ) ;
260
+ if ( cookieLoad ) config [ '--load-cookies' ] = cookieLoad ;
261
+
262
+ const cookieDrop = document . getElementById ( 'cookieDrop' ) . checked ;
263
+ if ( cookieDrop ) config [ '--drop-set-cookie' ] = cookieDrop ;
264
+
265
+ const authType = document . getElementById ( 'authType' ) . value ;
266
+ const authCred = document . getElementById ( 'authCred' ) . value . trim ( ) ;
267
+ if ( authType && authCred ) {
268
+ config [ '--auth-type' ] = authType ;
269
+ config [ '--auth-cred' ] = authCred ;
270
+ }
271
+
272
+ const authFile = document . getElementById ( 'authFile' ) . value . trim ( ) ;
273
+ if ( authFile ) config [ '--auth-file' ] = authFile ;
274
+
275
+ const csrfToken = document . getElementById ( 'csrfToken' ) . value . trim ( ) ;
276
+ if ( csrfToken ) config [ '--csrf-token' ] = csrfToken ;
277
+
278
+ const csrfMethod = document . getElementById ( 'csrfMethod' ) . value ;
279
+ if ( csrfMethod && csrfMethod !== 'custom' ) {
280
+ config [ '--csrf-method' ] = csrfMethod ;
281
+ } else if ( csrfMethod === 'custom' ) {
282
+ const customCsrfMethod = document . getElementById ( 'customCsrfMethod' ) . value ;
283
+ if ( customCsrfMethod ) config [ '--csrf-method' ] = customCsrfMethod ;
284
+ }
285
+
286
+ const csrfUrl = document . getElementById ( 'csrfUrl' ) . value . trim ( ) ;
287
+ if ( csrfUrl ) config [ '--csrf-url' ] = csrfUrl ;
288
+
289
+ const csrfRetries = document . getElementById ( 'csrfRetries' ) . value . trim ( ) ;
290
+ if ( csrfRetries && csrfRetries > 0 ) config [ '--csrf-retries' ] = csrfRetries ;
243
291
244
292
// Injection options
245
293
const testParams = document . getElementById ( 'testParams' ) . value . trim ( ) ;
@@ -320,12 +368,6 @@ class SQLMapGenerator {
320
368
const suffix = document . getElementById ( 'suffix' ) . value . trim ( ) ;
321
369
if ( suffix ) config [ '--suffix' ] = suffix ;
322
370
323
- const csrfToken = document . getElementById ( 'csrfToken' ) . value . trim ( ) ;
324
- if ( csrfToken ) config [ '--csrf-token' ] = csrfToken ;
325
-
326
- const csrfUrl = document . getElementById ( 'csrfUrl' ) . value . trim ( ) ;
327
- if ( csrfUrl ) config [ '--csrf-url' ] = csrfUrl ;
328
-
329
371
const secondUrl = document . getElementById ( 'secondUrl' ) . value . trim ( ) ;
330
372
if ( secondUrl ) config [ '--second-url' ] = secondUrl ;
331
373
@@ -343,6 +385,9 @@ class SQLMapGenerator {
343
385
'--proxy' , '--proxy-cred' , '--proxy-file' , '--proxy-freq' , '--ignore-proxy' ,
344
386
'--method' , '--data' , '--param-del' ,
345
387
'--host' , '-A' , '--mobile' , '--random-agent' , "--referer" , "-H" ,
388
+ '--cookie' , '--cookie-del' , '--live-cookies' , '--load-cookies' , '--drop-set-cookie' ,
389
+ '--auth-type' , '--auth-cred' , '--auth-file' ,
390
+ '--csrf-token' , '--csrf-url' , '--csrf-method' , '--csrf-retries' ,
346
391
'-p' , '--skip' , '--level' , '--risk' , '--dbms' , '--os' , '--technique' ,
347
392
'--batch' , '-v' , '-t' , '--parse-errors' , '--test-filter' ,
348
393
'--current-user' , '--current-db' , '--dbs' , '--tables' , '--columns' , '--schema' , '--dump-all' ,
@@ -459,7 +504,6 @@ class SQLMapGenerator {
459
504
copyUrlBtn . classList . remove ( 'copying' ) ;
460
505
copyUrlText . textContent = 'COPY URL WITH THIS CONFIG' ;
461
506
} , 3000 ) ;
462
- debugger ;
463
507
location . replace ( "#" + serializedCommand ) ;
464
508
465
509
} catch ( err ) {
@@ -475,7 +519,6 @@ class SQLMapGenerator {
475
519
setTimeout ( ( ) => {
476
520
copyUrlText . textContent = 'COPY URL WITH THIS CONFIG' ;
477
521
} , 3000 ) ;
478
- debugger ;
479
522
location . replace ( "#" + serializedCommand ) ;
480
523
}
481
524
}
@@ -610,6 +653,16 @@ class SQLMapGenerator {
610
653
'--referer' : 'referer' ,
611
654
'-H' : 'headers' ,
612
655
'--cookie' : 'cookie' ,
656
+ '--cookie-del' : 'cookieDel' ,
657
+ '--live-cookies' : 'cookieLive' ,
658
+ '--drop-set-cookie' : 'cookieDrop' ,
659
+ '--auth-type' : 'authType' ,
660
+ '--auth-cred' : 'authCred' ,
661
+ '--auth-file' : 'authFile' ,
662
+ '--csrf-token' : 'csrfToken' ,
663
+ '--csrf-url' : 'csrfUrl' ,
664
+ '--csrf-method' : 'csrfMethod' ,
665
+ '--csrf-retries' : 'csrfRetries' ,
613
666
'-p' : 'testParams' ,
614
667
'--skip' : 'skipParams' ,
615
668
'--level' : 'level' ,
@@ -694,7 +747,9 @@ class SQLMapGenerator {
694
747
} ) ;
695
748
696
749
// Hide custom user agent field
750
+ document . getElementById ( 'customHttpMethodGroup' ) . style . display = 'none' ;
697
751
document . getElementById ( 'customUserAgentGroup' ) . style . display = 'none' ;
752
+ document . getElementById ( 'customCsrfMethodGroup' ) . style . display = 'none' ;
698
753
699
754
this . updateCommand ( ) ;
700
755
this . showMessage ( 'Configuration deleted' , 'info' ) ;
0 commit comments