Пример #1
0
 def get(self):
     del_type = self.get_argument("type")
     if del_type in ['waiting', 'finished', 'running', 'vulnerable']:
         conn.delete(del_type)
     elif del_type == "flushdb":
         conn.flushdb()
         return self.write(out.jump("/"))
     return self.write(out.jump("/list?type=" + del_type))
Пример #2
0
 def get(self):
     if config.load()['scan_stat'].lower() == 'false':
         return self.write(out.jump("/"))
     stat = conn.rpoplpush("running", "waiting")
     while stat:
         stat = conn.rpoplpush("running", "waiting")
     return self.write(out.alert("reset success!", "/scan_stat?stat=true"))
Пример #3
0
 def get(self):
     stat = secure.clear(self.get_argument("stat"))
     config_all = config.load()
     config_all['scan_stat'] = stat
     config.update(config_all)
     if stat.lower() == "true":
         thread = threading.Thread(target=scan.scan_start, args=())
         thread.setDaemon(True)
         thread.start()
     return self.write(out.jump("/scan_config"))
Пример #4
0
 def get(self):
     """
     将全部运行中的记录改为等待状态
     """
     if config.load()['scan_stat'].lower() == 'false':
         return self.write(out.jump("/"))
     conn.update({"status": ITEM_STATUS.RUNNING},
                 {"$set": {
                     "status": ITEM_STATUS.WAITING
                 }})
     return self.write(out.alert("reset success!", "/scan_stat?stat=true"))
Пример #5
0
 def get(self):
     """
     清理数据
     """
     del_type = self.get_argument("type")
     if del_type in [
             ITEM_STATUS.RUNNING, ITEM_STATUS.FINISHED, ITEM_STATUS.WAITING
     ]:
         ReqItem.delete(del_type)
     elif del_type == "flushdb":  # 清空数据库
         ReqItem.delete()
     else:
         pass  # TODO 用户提示
     return self.write(out.jump("/"))
Пример #6
0
 def post(self):
     start = []
     rule = ["sqlireflect", "sqlitime", "xpath", "xss", "sqlibool"]
     conf = config.load_rule()
     for i in rule:
         on = self.get_argument(i + "_start")
         if on == "true":
             start.append(i)
         rules = self.get_argument(i + "_rule")
         config.rule_write(i, rules)
         if i == "sqlmap":
             address = self.get_argument("sqlmap_api")
             conf['sqlmap_api'] = address
     conf['scan_type'] = start
     config.update_rule(conf)
     return self.write(out.jump("/scan_config"))
Пример #7
0
 def post(self):
     proxy_type = self.get_argument("type")
     if proxy_type == "mix_proxy":
         conf = config.load()
         conf["mix_addr"] = secure.clear(self.get_argument("mix_addr"))
         conf["mix_port"] = secure.clear(self.get_argument("mix_port"))
         config.update(conf)
     elif proxy_type == "scapy":
         conf = config.load()
         conf['scapy_out'] = secure.clear(self.get_argument('scapy_out'))
         conf['scapy_network_card'] = self.get_argument(
             'scapy_network_card')
         config.update(conf)
     elif proxy_type == "tornado":
         conf = config.load()
         conf['tornado_address'] = secure.clear(
             self.get_argument('tornado_address'))
         conf['tornado_port'] = secure.clear(
             self.get_argument('tornado_port'))
         config.update(conf)
     return self.write(out.jump("/proxy?type=" + proxy_type))
Пример #8
0
 def get(self):
     proxy_type = self.get_argument("type")
     conf = {}
     if proxy_type == "mix_proxy":
         conf['mix_addr'] = config.load()['mix_addr']
         conf['mix_port'] = config.load()['mix_port']
         stat = config.load()['mix_stat']
         try:
             start_stat = self.get_argument("stat")
             start_conf = config.load()
             start_conf['mix_stat'] = start_stat
             config.update(start_conf)
             if start_stat.lower() == "true":
                 thread = threading.Thread(target=mix_proxy.main)
                 thread.setDaemon(True)
                 thread.start()
             else:
                 secure.kill(config.load()['mix_addr'],
                             int(config.load()['mix_port']), "GE")
             return self.write(out.jump("/proxy?type=" + proxy_type))
         except:
             pass
     elif proxy_type == "scapy":
         conf['scapy_out'] = config.load()['scapy_out']
         conf['scapy_network_card'] = config.load()['scapy_network_card']
         stat = config.load()['scapy_stat']
         try:
             start_stat = secure.clear(self.get_argument("stat"))
             start_conf = config.load()
             start_conf['scapy_stat'] = start_stat
             config.update(start_conf)
             if start_stat.lower() == "true":
                 thread = threading.Thread(target=pyscapy.main)
                 thread.setDaemon(True)
                 thread.start()
             return self.write(out.jump("/proxy?type=" + proxy_type))
         except:
             pass
     elif proxy_type == "tornado":
         conf['tornado_address'] = config.load()['tornado_address']
         conf['tornado_port'] = config.load()['tornado_port']
         stat = config.load()['tornado_stat']
         try:
             start_stat = secure.clear(self.get_argument("stat"))
             start_conf = config.load()
             start_conf['tornado_stat'] = start_stat
             config.update(start_conf)
             if start_stat.lower() == "true" and config.load(
             )['tornado_run_stat'] == 'false':
                 thread = threading.Thread(target=proxy_io.main)
                 thread.setDaemon(True)
                 thread.start()
                 start_conf = config.load()
                 start_conf['tornado_run_stat'] = 'true'
                 config.update(start_conf)
             return self.write(out.jump("/proxy?type=" + proxy_type))
         except:
             pass
     else:
         return self.write(out.jump("/"))
     return self.render("proxy.html",
                        proxy_type=proxy_type,
                        conf=conf,
                        stat=stat)