@@ -879,14 +879,22 @@ def stealDBs(myDB):
879
879
880
880
def massMongo ():
881
881
global victim
882
+ loadCheck = False
882
883
success = []
883
884
print "\n "
884
885
print "MongoDB Default Access Scanner"
885
886
print "=============================="
886
- loadPath = raw_input ("Enter file name with IP list to scan: " )
887
+
888
+ while loadCheck == False :
889
+ loadPath = raw_input ("Enter file name with IP list to scan: " )
887
890
888
- with open (loadPath ) as f :
889
- ipList = f .readlines ()
891
+ try :
892
+ with open (loadPath ) as f :
893
+ ipList = f .readlines ()
894
+ loadCheck = True
895
+ except :
896
+ print "Couldn't open file."
897
+
890
898
891
899
print "\n "
892
900
for target in ipList :
@@ -933,18 +941,22 @@ def gen_pass(user, passw):
933
941
934
942
935
943
def brute_pass (user ,key ):
936
- dictionary = raw_input ("Enter path to password dictionary: " )
937
- #print user
938
- #print key
939
- print "Preparing dictionary attack..."
940
- with open (dictionary ) as f :
941
- passList = f .readlines ()
942
-
943
- print "debug: " + str (passList )
944
-
944
+ loadCheck = False
945
+
946
+ while loadCheck == False :
947
+ dictionary = raw_input ("Enter path to password dictionary: " )
948
+ try :
949
+ with open (dictionary ) as f :
950
+ passList = f .readlines ()
951
+ loadCheck = True
952
+ except :
953
+ print " Couldn't load file."
954
+
955
+
956
+ print "Running dictionary attack..."
945
957
for passGuess in passList :
946
958
temp = passGuess .split ("\n " )[0 ]
947
- #print "debug: " + temp
959
+
948
960
if gen_pass (user , temp ) == key :
949
961
print "\n Found - " + user + ":" + passGuess
950
962
return passGuess
0 commit comments