Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def send_command(self, command, search, thread_num, exec_cmd, startIP, endIP, ipfile):
"""Execute a command"""
if search == "censys":
self.search = Censys()
elif search == "zoomeye":
self.search = Zoomeye()
elif search == "shodan":
self.search = Shodan()
elif search == "local":
self.search = Local()
else:
print "you got a wrong type of search engine, you can select censys, shodan or zoomeye as your scan engine."
sys.exit()
if self.setQuery(command):
return {'prompt': '', 'busy': False, 'data': 'QUERY => %s\n' % self.query}
elif self.setPage(command):
return {'prompt': '', 'busy': False, 'data': 'PAGE => %d\n' % self.page}
else:
if command == "exploit\n" or command == "run\n":
if not self.search:
print "please select a search engine using the -s or --search option."