File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2424import pymongo
2525import subprocess
2626import json
27+ import gridfs
2728
2829#Set a list so we can track whether options are set or not to avoid resetting them in subsequent cals to the options menu.
2930global optionSet
@@ -335,9 +336,24 @@ def netAttacks(target):
335336 except :
336337 print "Error: Couldn't list collections. The provided credentials may not have rights."
337338
339+ print "\n "
338340 #Start GridFS enumeration
339341
340-
342+ testGrid = raw_input ("Check for GridFS? " )
343+
344+ if testGrid == "y" or testGrid == "Y" :
345+ for dbItem in dbList :
346+ try :
347+ db = conn [dbItem ]
348+ fs = gridfs .GridFS (db )
349+ files = fs .list ()
350+ print "GridFS enabled on database " + str (dbItem )
351+ print " list of files:"
352+ print "\n " .join (files )
353+
354+ except :
355+ print "GridFS not enabled on " + str (dbItem ) + "."
356+
341357 stealDB = raw_input ("Steal a database? (Requires your own Mongo instance): " )
342358
343359 if stealDB == "y" or stealDB == "Y" :
You can’t perform that action at this time.
0 commit comments