Ejemplo n.º 1
0
 def payloadverify(self, plug, host):
     '''插件验证'''
     #logging.info('check %s-%s-%s'%(plug.__class__,host.host,host.port))
     filter = bool(self.args.get('filter', 1))  #是否需要过滤、
     try:
         socket.setdefaulttimeout(360)
         if not filter or plug.filter(host):
             logging.info(
                 'filter %s-%s-%s-%s' %
                 (plug.__class__, host.service, host.host, host.port))
             for user, pwd in self.auths if plug.BRUTE else [(None,
                                                              '123456')]:
                 if user:
                     verify = plug.verify(host, user=user, pwd=pwd)
                 else:
                     verify = plug.verify(host, pwd=pwd)
                 if verify:
                     logging.warn(
                         'verify %s-%s-%s-%s-%s' %
                         (plug.__class__, host.host, host.port, user, pwd))
                     return self.callback_bug(plug)
     except Exception as e:
         type, value, tb = sys.exc_info()
         e = '\n'.join(set(traceback.format_exception(type, value, tb)))
         logging.error(str(e))
Ejemplo n.º 2
0
 def request(self, req):
     req = self.reqhook(req)
     try:
         res = req.response()
         self.ResQueue.put((req, res))
         self.parse(res)
         #app 识别
         #for app in APP.find(res):
         #    self.website.content = app
     except ConnectionError:
         logging.warn('ConnectionError')
         time.sleep(self.settings['sleep'])
     except Exception as e:
         logging.warn(str(e))
Ejemplo n.º 3
0
 def request(self, req):
     req = self.session.prepare_request(req.prepare())
     req = self.reqhook(req)
     try:
         res = self.session.send(req,
                                 verify=False,
                                 proxies=self.settings['proxy'],
                                 timeout=self.settings['timeout'])
         self.ResQueue.put((req, res))
         self.parse(res)
         #app 识别
         for app in APP.find(res):
             self.website.content = app
     except ConnectionError as e:
         logging.warn(str(e))
         time.sleep(self.settings['sleep'])
     except Exception as e:
         logging.warn(str(e))
Ejemplo n.º 4
0
 def request(self, req):
     #req = self.session.prepare_request(req.prepare())
     req = self.reqhook(req)
     try:
         #res = self.session.send(req,
         #    verify=False,
         #    proxies=self.settings['proxy'],
         #    timeout=self.settings['timeout'])
         res = req.response()
         self.ResQueue.put((req, res))
         self.parse(res)
         #app 识别
         #for app in APP.find(res):
         #    self.website.content = app
     except ConnectionError as e:
         logging.warn(str(e))
         time.sleep(self.settings['sleep'])
     except Exception as e:
         type, value, tb = sys.exc_info()
         e = '\n'.join(set(traceback.format_exception(type, value, tb)))
         logging.error(str(e))
Ejemplo n.º 5
0
 def payloadverify(self, plug, host):
     '''插件验证'''
     logging.info('check %s-%s-%s' % (plug.__class__, host.host, host.port))
     filter = int(self.args.get('filter', 1))  #是否需要过滤、
     try:
         socket.setdefaulttimeout(360)
         if not filter or plug.filter(host):
             logging.info('filter %s-%s-%s-%s-%s' %
                          (plug.__class__, host.host, host.port))
             for user, pwd in self.auths if plug.BRUTE else [(None,
                                                              '123456')]:
                 if user:
                     verify = plug.verify(host, user=user, pwd=pwd)
                 else:
                     verify = plug.verify(host, pwd=pwd)
                 if verify:
                     logging.warn(
                         'verify %s-%s-%s-%s-%s' %
                         (plug.__class__, host.host, host.port, user, pwd))
                     return self.callback_bug(plug)
     except Exception as e:
         logging.error(str(e))