@@ -80,7 +80,7 @@ def view_gathered_hosts(self):
8080
8181 def add_single_host (self ):
8282 """
83- add a singluar host to the hosts.txt file and check if the host
83+ add a singular host to the hosts.txt file and check if the host
8484 will resolve to a true IP address, if it is not a true IP address
8585 you will be re-prompted for an IP address
8686
@@ -129,7 +129,13 @@ def gather_hosts(self, query, given_choice=None, proxy=None, agent=None):
129129 else :
130130 choice = given_choice
131131 while not searching :
132+ # TODO[2]:// bug in the animation, if the user chooses one search engine to search
133+ # the animation does not stop when the user chooses a single search engine, instead
134+ # the user will see the animation continuously until they either:
135+ # A) exit the terminal
136+ # B) search another search engine
132137 try :
138+ # something in here needs to change (see TODO[2])
133139 choice = int (choice )
134140 if choice == 1 :
135141 choice_dict [choice ](
@@ -204,29 +210,36 @@ def exploit_gathered_hosts(self, loaded_mods, hosts=None):
204210 ruby_exec = ruby_exec ,
205211 msf_path = msf_path
206212 )
207- sorted_mods = exploiter .sort_modules_by_query ()
208- choice = lib .output .prompt (
209- "a total of {} modules have been sorted by relevance, would you like to display them[y/N]" .format (
210- len (sorted_mods )
213+ try :
214+ sorted_mods = exploiter .sort_modules_by_query ()
215+ choice = lib .output .prompt (
216+ "a total of {} modules have been sorted by relevance, would you like to display them[y/N]" .format (
217+ len (sorted_mods )
218+ )
211219 )
212- )
213- if not choice .lower ().strip ().startswith ("y" ):
214- mods = lib .output .prompt ("use relevant modules[y/N]" )
215- if mods .lower ().startswith ("n" ):
216- lib .output .info ("starting exploitation with all loaded modules (total of {})" .format (len (loaded_mods )))
217- exploiter .start_exploit ()
218- elif mods .lower ().startswith ("y" ):
219- lib .output .info ("starting exploitation with sorted modules (total of {})" .format (len (sorted_mods )))
220- exploiter .start_exploit ()
221- else :
222- exploiter .view_sorted ()
223- mods = lib .output .prompt ("use relevant modules[y/N]" )
224- if mods .lower ().startswith ("n" ):
225- lib .output .info ("starting exploitation with all loaded modules (total of {})" .format (len (loaded_mods )))
226- exploiter .start_exploit ()
227- elif mods .lower ().startswith ("y" ):
228- lib .output .info ("starting exploitation with sorted modules (total of {})" .format (len (sorted_mods )))
229- exploiter .start_exploit ()
220+
221+ if not choice .lower ().strip ().startswith ("y" ):
222+ mods = lib .output .prompt ("use relevant modules[y/N]" )
223+ if mods .lower ().startswith ("n" ):
224+ lib .output .info (
225+ "starting exploitation with all loaded modules (total of {})" .format (len (loaded_mods )))
226+ exploiter .start_exploit ()
227+ elif mods .lower ().startswith ("y" ):
228+ lib .output .info ("starting exploitation with sorted modules (total of {})" .format (len (sorted_mods )))
229+ exploiter .start_exploit ()
230+ else :
231+ exploiter .view_sorted ()
232+ mods = lib .output .prompt ("use relevant modules[y/N]" )
233+ if mods .lower ().startswith ("n" ):
234+ lib .output .info (
235+ "starting exploitation with all loaded modules (total of {})" .format (len (loaded_mods )))
236+ exploiter .start_exploit ()
237+ elif mods .lower ().startswith ("y" ):
238+ lib .output .info ("starting exploitation with sorted modules (total of {})" .format (len (sorted_mods )))
239+ exploiter .start_exploit ()
240+ except AttributeError :
241+ lib .output .warning ("unable to sort modules by relevance" )
242+
230243
231244 def custom_host_list (self , mods ):
232245 """
@@ -268,6 +281,7 @@ def __config_headers():
268281 for i in lib .settings .AUTOSPLOIT_TERM_OPTS .keys ():
269282 print ("{}. {}" .format (i , lib .settings .AUTOSPLOIT_TERM_OPTS [i ].title ()))
270283 choice = raw_input (lib .settings .AUTOSPLOIT_PROMPT )
284+ # TODO[3] this is ugly so it needs to change
271285 try :
272286 choice = int (choice )
273287 if choice == 99 :
@@ -296,6 +310,7 @@ def __config_headers():
296310 with open (lib .settings .QUERY_FILE_PATH , "a+" ) as _query :
297311 _query .write (query )
298312 proxy , agent = __config_headers ()
313+ # possibly needs to change here (see TODO[2])
299314 self .gather_hosts (query , proxy = proxy , agent = agent )
300315 print (self .sep )
301316 elif choice == 1 :
0 commit comments