mechanize python XE #23
def __init__(self, shodan_api=None):
"""
Initialize a new Bamf instance
`Optional`
:param str shodan_api: Shodan API key
"""
mechanize.Browser.__init__(self)
self._models = {}
self._targets = {}
self._devices = []
self._threads = []
self._backdoors = []
self._queue = Queue.Queue()
self._query = 'alphanetworks/2.23'
self._ports = [8000, 8080, 8888]
self._semaphore = threading.Semaphore(value=1)
self._database = sqlite3.connect('database.db')
self._database.executescript(self.__tbl_config)
self._database.executescript(self.__tbl_routers)
self._database.executescript(self.__tbl_devices)
self._shodan = self._init_shodan(shodan_api)
self.addheaders = [('User-Agent', 'xmlset_roodkcableoj28840ybtide')]
self.set_handle_robots(False)
self.set_handle_redirect(True)
self.set_handle_refresh(True)
self.set_handle_equiv(True)
self.set_handle_referer(True)
self.set_debug_http(False)
self.set_debug_responses(False)