@@ -89,25 +89,26 @@ def mainMenu():
89
89
90
90
91
91
def options ():
92
- global victim
93
- global webPort
94
- global uri
95
- global httpMethod
96
- global myIP
97
- global myPort
92
+
98
93
#Set default value if needed
99
94
if optionSet [0 ] == False :
95
+ global victim
100
96
victim = "Not Set"
101
97
if optionSet [1 ] == False :
98
+ global webPort
102
99
webPort = 80
103
100
optionSet [1 ] = True
104
101
if optionSet [2 ] == False :
102
+ global uri
105
103
uri = "Not Set"
106
104
if optionSet [3 ] == False :
105
+ global httpMethod
107
106
httpMethod = "GET"
108
107
if optionSet [4 ] == False :
108
+ global myIP
109
109
myIP = "Not Set"
110
110
if optionSet [5 ] == False :
111
+ global myPort
111
112
myPort = "Not Set"
112
113
113
114
select = True
@@ -228,7 +229,7 @@ def options():
228
229
victim = reqData [1 ].split ( " " )[1 ].replace ("\r \n " ,"" )
229
230
optionSet [0 ] = True
230
231
uri = methodPath [1 ].replace ("\r \n " ,"" )
231
- optList [2 ] = True
232
+ optionSet [2 ] = True
232
233
233
234
elif select == "9" :
234
235
savePath = raw_input ("Enter file name to save: " )
@@ -836,7 +837,10 @@ def buildUri(origUri, randValue):
836
837
return uriArray [0 ]
837
838
838
839
def stealDBs (myDB ):
839
- menuItem = 1
840
+ menuItem = 1
841
+ if optionSet [4 ] == False :
842
+ raw_input ("No destination database set! Press enter to return to the main menu." )
843
+ mainMenu ()
840
844
841
845
for dbName in dbList :
842
846
print str (menuItem ) + "-" + dbName
@@ -875,8 +879,12 @@ def stealDBs(myDB):
875
879
return ()
876
880
877
881
except :
878
- raw_input ("Something went wrong. Are you sure your MongoDB is running and options are set? Press enter to return..." )
879
- mainMenu ()
882
+ if str (sys .exc_info ()).find ('text search not enabled' ) != 1 :
883
+ raw_input ("Database copied, but text indexing was not enabled on the target. Indexes not moved. Press enter to return..." )
884
+ mainMenu ()
885
+ else :
886
+ raw_input ("Something went wrong. Are you sure your MongoDB is running and options are set? Press enter to return..." )
887
+ mainMenu ()
880
888
881
889
def massMongo ():
882
890
global victim
@@ -906,8 +914,8 @@ def massMongo():
906
914
mainMenu ()
907
915
908
916
909
- print "Debug:"
910
- print ipList
917
+ # print "Debug:"
918
+ # print ipList
911
919
912
920
if loadOpt == "2" :
913
921
while loadCheck == False :
0 commit comments