@@ -32,7 +32,7 @@ def mainMenu():
32
32
select = True
33
33
while select :
34
34
os .system ('clear' )
35
- print "NoSQLMap v0.08 -by Russell Butturini([email protected] )"
35
+ print "NoSQLMap v0.08a -by Russell Butturini([email protected] )"
36
36
print "\n "
37
37
print "1-Set options (do this first)"
38
38
print "2-NoSQL DB Access Attacks"
@@ -261,51 +261,53 @@ def webApps():
261
261
randInjDelta = abs (injLen - randLength )
262
262
263
263
if (randInjDelta >= 100 ) and (injLen != 0 ) :
264
- print "Not equals injection respnose varied " + str (randInjDelta ) + " bytes from random parameter! Injection works!"
264
+ print "Not equals injection response varied " + str (randInjDelta ) + " bytes from random parameter! Injection works!"
265
265
266
266
elif (randInjDelta > 0 ) and (randInjDelta < 100 ) and (injLen != 0 ) :
267
267
print "Response variance was only " + str (randInjDelta ) + " bytes. Injection might have worked but difference is too small to be certain. "
268
268
269
269
elif (randInjDelta == 0 ):
270
270
print "Random string response size and not equals injection were the same. Injection did not work."
271
271
else :
272
- print "Got zero length response. Injection did not work ."
272
+ print "Injected response was smaller than random response. Injection may have worked but requires verification ."
273
273
274
274
print "Testing Mongo <2.4 $where all Javascript string escape attack for all records...\n "
275
275
print " Injecting " + whereStrUri
276
276
whereStrLen = int (len (urllib .urlopen (whereStrUri ).read ()))
277
277
whereStrDelta = abs (whereStrLen - randLength )
278
278
279
- if whereStrDelta >= 100 and (whereStrLen != 0 ):
279
+ if ( whereStrDelta >= 100 ) and (whereStrLen > 0 ):
280
280
print "Java $where escape varied " + str (whereStrDelta ) + " bytes from random parameter! Where injection works!"
281
281
282
- elif (whereStrDelta > 0 ) and (whereStrDelta < 100 ) and (whereStrLen != 0 ):
282
+ elif (whereStrDelta > 0 ) and (whereStrDelta < 100 ) and (whereStrLen - randLength > 0 ):
283
283
print " response variance was only " + str (whereStrDelta ) + "bytes. Injection might have worked but difference is too small to be certain."
284
284
285
285
elif (whereStrDelta == 0 ):
286
286
print "Random string response size and $where injection were the same. Injection did not work."
287
287
288
288
else :
289
- print "Got zero length response. Injection did not work ."
289
+ print "Injected response was smaller than random response. Injection may have worked but requires verification ."
290
290
291
291
print "\n "
292
292
print "Testing Mongo <2.4 $where Javascript integer escape attack for all records...\n "
293
293
print " Injecting " + whereIntUri
294
294
295
295
whereIntLen = int (len (urllib .urlopen (whereIntUri ).read ()))
296
296
whereIntDelta = abs (whereIntLen - randLength )
297
+ #print "whereIntLen debug: " + str(whereIntLen)
298
+ #print "whereIntDelta debug: " + str(whereIntDelta)
297
299
298
- if (whereIntDelta >= 100 ) and (whereIntLen != 0 ):
300
+ if (whereIntDelta >= 100 ) and (whereIntLen - randLength > 0 ):
299
301
print "Java $where escape varied " + str (whereIntDelta ) + " bytes from random parameter! Where injection works!"
300
302
301
- elif (whereIntDelta > 0 ) and (whereIntDelta < 100 ) and (whereIntLen != 0 ):
303
+ elif (whereIntDelta > 0 ) and (whereIntDelta < 100 ) and (whereIntLen - randLength > 0 ):
302
304
print " response variance was only " + str (whereIntDelta ) + "bytes. Injection might have worked but difference is too small to be certain."
303
305
304
306
elif (whereIntDelta == 0 ):
305
307
print "Random string response size and $where injection were the same. Injection did not work."
306
308
307
309
else :
308
- print "Got zero length response. Injection did not work ."
310
+ print "Injected response was smaller than random response. Injection may have worked but requires verification ."
309
311
#Start a single record attack
310
312
311
313
print "Testing Mongo <2.4 $where all Javascript string escape attack for one record...\n "
@@ -317,17 +319,17 @@ def webApps():
317
319
else :
318
320
whereOneStrDelta = 0
319
321
320
- if (whereOneStrDelta >= 100 ) and (whereOneStrLen != 0 ):
322
+ if (whereOneStrDelta >= 100 ) and (whereOneStrLen - randLength > 0 ):
321
323
print "Java $where escape varied " + str (whereOneStrDelta ) + " bytes from random parameter! Where injection works!"
322
324
323
- elif (whereOneStrDelta > 0 ) and (whereOneStrDelta < 100 ) and (whereOneStrLen != 0 ):
325
+ elif (whereOneStrDelta > 0 ) and (whereOneStrDelta < 100 ) and (whereOneStrLen - randLength > 0 ):
324
326
print " response variance was only " + str (whereOneStrDelta ) + "bytes. Injection might have worked but difference is too small to be certain."
325
327
326
328
elif (whereOneStrDelta == 0 ):
327
329
print "Random string response size and $where single injection were the same. Injection did not work."
328
330
329
331
else :
330
- print "Got zero length response. Injection did not work ."
332
+ print "Injected response was smaller than random response. Injection may have worked but requires verification ."
331
333
print "\n "
332
334
print "Testing Mongo <2.4 $where Javascript integer escape attack for one record...\n "
333
335
print " Injecting " + whereOneInt
@@ -339,17 +341,17 @@ def webApps():
339
341
else :
340
342
whereOneIntDelta = 0
341
343
342
- if (whereOneIntDelta >= 100 ) and (whereOneIntLen != 0 ):
344
+ if (whereOneIntDelta >= 100 ) and (whereOneIntLen - randLength > 0 ):
343
345
print "Java $where escape varied " + str (whereOneIntDelta ) + " bytes from random parameter! Where injection works!"
344
346
345
- elif (whereOneIntDelta > 0 ) and (whereOneIntDelta < 100 ) and (whereOneIntLen != 0 ):
347
+ elif (whereOneIntDelta > 0 ) and (whereOneIntDelta < 100 ) and (whereOneIntLen - randLength > 0 ):
346
348
print " response variance was only " + str (whereOneIntDelta ) + "bytes. Injection might have worked but difference is too small to be certain."
347
349
348
350
elif (whereOneIntDelta == 0 ):
349
351
print "Random string response size and $where single record injection were the same. Injection did not work."
350
352
351
353
else :
352
- print "Got zero length response. Injection did not work ."
354
+ print "Injected response was smaller than random response. Injection may have worked but requires verification ."
353
355
354
356
raw_input ("Press enter to continue..." )
355
357
return ()
0 commit comments