@@ -75,6 +75,16 @@ class SQLMapGenerator {
7575 customUserAgentGroup . style . display = 'none' ;
7676 }
7777 } ) ;
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+ } ) ;
7888 }
7989
8090 setupTabs ( ) {
@@ -210,7 +220,7 @@ class SQLMapGenerator {
210220 if ( data ) config [ '--data' ] = data ;
211221
212222 const paramDel = document . getElementById ( 'paramDel' ) . value . trim ( ) ;
213- if ( paramDel ) config [ '--param-del' ] = paramDel ;
223+ if ( paramDel && paramDel !== "&" ) config [ '--param-del' ] = paramDel ;
214224
215225 const host = document . getElementById ( 'host' ) . value . trim ( ) ;
216226 if ( host ) config [ '--host' ] = host ;
@@ -224,7 +234,7 @@ class SQLMapGenerator {
224234 config [ '--mobile' ] = true ;
225235 }
226236 else if ( userAgent && userAgent === 'custom' ) {
227- const customUserAgent = document . getElementById ( 'customUserAgent' ) . value . trim ( ) ;
237+ const customUserAgent = document . getElementById ( 'customUserAgent' ) . value ;
228238 if ( customUserAgent ) config [ '-A' ] = customUserAgent ;
229239 }
230240 else if ( userAgent ) {
@@ -240,6 +250,44 @@ class SQLMapGenerator {
240250 const cookie = document . getElementById ( 'cookie' ) . value . trim ( ) ;
241251 if ( cookie ) config [ '--cookie' ] = cookie ;
242252
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 ;
243291
244292 // Injection options
245293 const testParams = document . getElementById ( 'testParams' ) . value . trim ( ) ;
@@ -320,12 +368,6 @@ class SQLMapGenerator {
320368 const suffix = document . getElementById ( 'suffix' ) . value . trim ( ) ;
321369 if ( suffix ) config [ '--suffix' ] = suffix ;
322370
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-
329371 const secondUrl = document . getElementById ( 'secondUrl' ) . value . trim ( ) ;
330372 if ( secondUrl ) config [ '--second-url' ] = secondUrl ;
331373
@@ -343,6 +385,9 @@ class SQLMapGenerator {
343385 '--proxy' , '--proxy-cred' , '--proxy-file' , '--proxy-freq' , '--ignore-proxy' ,
344386 '--method' , '--data' , '--param-del' ,
345387 '--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' ,
346391 '-p' , '--skip' , '--level' , '--risk' , '--dbms' , '--os' , '--technique' ,
347392 '--batch' , '-v' , '-t' , '--parse-errors' , '--test-filter' ,
348393 '--current-user' , '--current-db' , '--dbs' , '--tables' , '--columns' , '--schema' , '--dump-all' ,
@@ -459,7 +504,6 @@ class SQLMapGenerator {
459504 copyUrlBtn . classList . remove ( 'copying' ) ;
460505 copyUrlText . textContent = 'COPY URL WITH THIS CONFIG' ;
461506 } , 3000 ) ;
462- debugger ;
463507 location . replace ( "#" + serializedCommand ) ;
464508
465509 } catch ( err ) {
@@ -475,7 +519,6 @@ class SQLMapGenerator {
475519 setTimeout ( ( ) => {
476520 copyUrlText . textContent = 'COPY URL WITH THIS CONFIG' ;
477521 } , 3000 ) ;
478- debugger ;
479522 location . replace ( "#" + serializedCommand ) ;
480523 }
481524 }
@@ -610,6 +653,16 @@ class SQLMapGenerator {
610653 '--referer' : 'referer' ,
611654 '-H' : 'headers' ,
612655 '--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' ,
613666 '-p' : 'testParams' ,
614667 '--skip' : 'skipParams' ,
615668 '--level' : 'level' ,
@@ -694,7 +747,9 @@ class SQLMapGenerator {
694747 } ) ;
695748
696749 // Hide custom user agent field
750+ document . getElementById ( 'customHttpMethodGroup' ) . style . display = 'none' ;
697751 document . getElementById ( 'customUserAgentGroup' ) . style . display = 'none' ;
752+ document . getElementById ( 'customCsrfMethodGroup' ) . style . display = 'none' ;
698753
699754 this . updateCommand ( ) ;
700755 this . showMessage ( 'Configuration deleted' , 'info' ) ;
0 commit comments