@@ -297,15 +297,16 @@ func Scan(target string, options model.Options, sid string) (model.Result, error
297
297
ptype = GetPType (av )
298
298
}
299
299
}
300
- // Add plain XSS Query
301
- tq , tm := optimization .MakeRequestQuery (target , k , customPayload , "inHTML" + ptype , "toAppend" , "NaN" , options )
302
- query [tq ] = tm
303
- // Add URL encoded XSS Query
304
- etq , etm := optimization .MakeRequestQuery (target , k , customPayload , "inHTML" + ptype , "toAppend" , "urlEncode" , options )
305
- query [etq ] = etm
306
- // Add HTML Encoded XSS Query
307
- htq , htm := optimization .MakeRequestQuery (target , k , customPayload , "inHTML" + ptype , "toAppend" , "htmlEncode" , options )
308
- query [htq ] = htm
300
+ encoders := []string {
301
+ "NaN" ,
302
+ "urlEncode" ,
303
+ "urlDoubleEncode" ,
304
+ "htmlEncode" ,
305
+ }
306
+ for _ , encoder := range encoders {
307
+ tq , tm := optimization .MakeRequestQuery (target , k , customPayload , "inHTML" + ptype , "toAppend" , encoder , options )
308
+ query [tq ] = tm
309
+ }
309
310
}
310
311
}
311
312
}
@@ -340,15 +341,16 @@ func Scan(target string, options model.Options, sid string) (model.Result, error
340
341
cpArr = append (cpArr , v )
341
342
arc := optimization .SetPayloadValue (getCommonPayload (), options )
342
343
for _ , avv := range arc {
343
- // Add plain XSS Query
344
- tq , tm := optimization .MakeRequestQuery (target , v , avv , "inHTML-URL" , "toAppend" , "NaN" , options )
345
- query [tq ] = tm
346
- // Add URL encoded XSS Query
347
- etq , etm := optimization .MakeRequestQuery (target , v , avv , "inHTML-URL" , "toAppend" , "urlEncode" , options )
348
- query [etq ] = etm
349
- // Add HTML Encoded XSS Query
350
- htq , htm := optimization .MakeRequestQuery (target , v , avv , "inHTML-URL" , "toAppend" , "htmlEncode" , options )
351
- query [htq ] = htm
344
+ encoders := []string {
345
+ "NaN" ,
346
+ "urlEncode" ,
347
+ "urlDoubleEncode" ,
348
+ "htmlEncode" ,
349
+ }
350
+ for _ , encoder := range encoders {
351
+ tq , tm := optimization .MakeRequestQuery (target , v , avv , "inHTML-URL" , "toAppend" , encoder , options )
352
+ query [tq ] = tm
353
+ }
352
354
}
353
355
}
354
356
}
@@ -358,15 +360,16 @@ func Scan(target string, options model.Options, sid string) (model.Result, error
358
360
cpdArr = append (cpdArr , v )
359
361
arc := optimization .SetPayloadValue (getCommonPayload (), options )
360
362
for _ , avv := range arc {
361
- // Add plain XSS Query
362
- tq , tm := optimization .MakeRequestQuery (target , v , avv , "inHTML-FORM" , "toAppend" , "NaN" , options )
363
- query [tq ] = tm
364
- // Add URL encoded XSS Query
365
- etq , etm := optimization .MakeRequestQuery (target , v , avv , "inHTML-FORM" , "toAppend" , "urlEncode" , options )
366
- query [etq ] = etm
367
- // Add HTML Encoded XSS Query
368
- htq , htm := optimization .MakeRequestQuery (target , v , avv , "inHTML-FORM" , "toAppend" , "htmlEncode" , options )
369
- query [htq ] = htm
363
+ encoders := []string {
364
+ "NaN" ,
365
+ "urlEncode" ,
366
+ "urlDoubleEncode" ,
367
+ "htmlEncode" ,
368
+ }
369
+ for _ , encoder := range encoders {
370
+ tq , tm := optimization .MakeRequestQuery (target , v , avv , "inHTML-FORM" , "toAppend" , encoder , options )
371
+ query [tq ] = tm
372
+ }
370
373
}
371
374
}
372
375
}
@@ -445,10 +448,30 @@ func Scan(target string, options model.Options, sid string) (model.Result, error
445
448
// Injected pattern
446
449
injectedPoint := strings .Split (av , "/" )
447
450
injectedPoint = injectedPoint [1 :]
451
+ injectedChars := params [k ][:len (params [k ])- 1 ]
448
452
for _ , ip := range injectedPoint {
449
453
var arr []string
450
454
if strings .Contains (ip , "inJS" ) {
451
- arr = optimization .SetPayloadValue (getInJsPayload (ip ), options )
455
+ checkInJS := false
456
+ if strings .Contains (ip , "double" ) {
457
+ for _ , injectedChar := range injectedChars {
458
+ if strings .Contains (injectedChar , "\" " ) {
459
+ checkInJS = true
460
+ }
461
+ }
462
+ }
463
+ if strings .Contains (ip , "single" ) {
464
+ for _ , injectedChar := range injectedChars {
465
+ if strings .Contains (injectedChar , "'" ) {
466
+ checkInJS = true
467
+ }
468
+ }
469
+ }
470
+ if checkInJS {
471
+ arr = optimization .SetPayloadValue (getInJsPayload (ip ), options )
472
+ } else {
473
+ arr = optimization .SetPayloadValue (getInJsBreakScriptPayload (ip ), options )
474
+ }
452
475
}
453
476
if strings .Contains (ip , "inHTML" ) {
454
477
arr = optimization .SetPayloadValue (getHTMLPayload (ip ), options )
@@ -458,15 +481,16 @@ func Scan(target string, options model.Options, sid string) (model.Result, error
458
481
}
459
482
for _ , avv := range arr {
460
483
if optimization .Optimization (avv , badchars ) {
461
- // Add plain XSS Query
462
- tq , tm := optimization .MakeRequestQuery (target , k , avv , ip + ptype , "toAppend" , "NaN" , options )
463
- query [tq ] = tm
464
- // Add URL Encoded XSS Query
465
- etq , etm := optimization .MakeRequestQuery (target , k , avv , ip + ptype , "toAppend" , "urlEncode" , options )
466
- query [etq ] = etm
467
- // Add HTML Encoded XSS Query
468
- htq , htm := optimization .MakeRequestQuery (target , k , avv , ip + ptype , "toAppend" , "htmlEncode" , options )
469
- query [htq ] = htm
484
+ encoders := []string {
485
+ "NaN" ,
486
+ "urlEncode" ,
487
+ "urlDoubleEncode" ,
488
+ "htmlEncode" ,
489
+ }
490
+ for _ , encoder := range encoders {
491
+ tq , tm := optimization .MakeRequestQuery (target , k , avv , ip + ptype , "toAppend" , encoder , options )
492
+ query [tq ] = tm
493
+ }
470
494
}
471
495
}
472
496
}
@@ -477,15 +501,16 @@ func Scan(target string, options model.Options, sid string) (model.Result, error
477
501
for _ , avv := range arc {
478
502
if ! containsFromArray (cpArr , k ) {
479
503
if optimization .Optimization (avv , badchars ) {
480
- // Add plain XSS Query
481
- tq , tm := optimization .MakeRequestQuery (target , k , avv , "inHTML" + ptype , "toAppend" , "NaN" , options )
482
- query [tq ] = tm
483
- // Add URL encoded XSS Query
484
- etq , etm := optimization .MakeRequestQuery (target , k , avv , "inHTML" + ptype , "toAppend" , "urlEncode" , options )
485
- query [etq ] = etm
486
- // Add HTML Encoded XSS Query
487
- htq , htm := optimization .MakeRequestQuery (target , k , avv , "inHTML" + ptype , "toAppend" , "htmlEncode" , options )
488
- query [htq ] = htm
504
+ encoders := []string {
505
+ "NaN" ,
506
+ "urlEncode" ,
507
+ "urlDoubleEncode" ,
508
+ "htmlEncode" ,
509
+ }
510
+ for _ , encoder := range encoders {
511
+ tq , tm := optimization .MakeRequestQuery (target , k , avv , "inHTML" + ptype , "toAppend" , encoder , options )
512
+ query [tq ] = tm
513
+ }
489
514
}
490
515
}
491
516
}
@@ -530,17 +555,17 @@ func Scan(target string, options model.Options, sid string) (model.Result, error
530
555
for _ , bpayload := range bpayloads {
531
556
// Add plain XSS Query
532
557
bp := strings .Replace (bpayload , "CALLBACKURL" , bcallback , 10 )
533
- tq , tm := optimization . MakeRequestQuery ( target , k , bp , "toBlind" + ptype , "toAppend" , "NaN" , options )
534
- tm [ "payload" ] = "toBlind"
535
- query [ tq ] = tm
536
- // Add URL encoded XSS Query
537
- etq , etm := optimization . MakeRequestQuery ( target , k , bp , "toBlind" + ptype , "toAppend" , "urlEncode" , options )
538
- etm [ "payload" ] = "toBlind"
539
- query [ etq ] = etm
540
- // Add HTML Encoded XSS Query
541
- htq , htm := optimization . MakeRequestQuery ( target , k , bp , "toBlind" + ptype , "toAppend" , "htmlEncode" , options )
542
- htm [ "payload" ] = "toBlind"
543
- query [ htq ] = htm
558
+ encoders := [] string {
559
+ "NaN" ,
560
+ "urlEncode" ,
561
+ "urlDoubleEncode" ,
562
+ "htmlEncode" ,
563
+ }
564
+ for _ , encoder := range encoders {
565
+ tq , tm := optimization . MakeRequestQuery ( target , k , bp , "toBlind" + ptype , "toAppend" , encoder , options )
566
+ tm [ "payload" ] = "toBlind"
567
+ query [ tq ] = tm
568
+ }
544
569
}
545
570
}
546
571
}
@@ -572,15 +597,16 @@ func Scan(target string, options model.Options, sid string) (model.Result, error
572
597
ptype = GetPType (av )
573
598
}
574
599
}
575
- // Add plain XSS Query
576
- tq , tm := optimization .MakeRequestQuery (target , k , remotePayload , "inHTML" + ptype , "toAppend" , "NaN" , options )
577
- query [tq ] = tm
578
- // Add URL encoded XSS Query
579
- etq , etm := optimization .MakeRequestQuery (target , k , remotePayload , "inHTML" + ptype , "toAppend" , "urlEncode" , options )
580
- query [etq ] = etm
581
- // Add HTML Encoded XSS Query
582
- htq , htm := optimization .MakeRequestQuery (target , k , remotePayload , "inHTML" + ptype , "toAppend" , "htmlEncode" , options )
583
- query [htq ] = htm
600
+ encoders := []string {
601
+ "NaN" ,
602
+ "urlEncode" ,
603
+ "urlDoubleEncode" ,
604
+ "htmlEncode" ,
605
+ }
606
+ for _ , encoder := range encoders {
607
+ tq , tm := optimization .MakeRequestQuery (target , k , remotePayload , "inHTML" + ptype , "toAppend" , encoder , options )
608
+ query [tq ] = tm
609
+ }
584
610
}
585
611
}
586
612
}
0 commit comments