forked from Cl0udG0d/SZhe_Scan
-
Notifications
You must be signed in to change notification settings - Fork 0
/
POCScan.py
22 lines (21 loc) · 901 Bytes
/
POCScan.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from init import app,redispool
from exts import db
from models import POC,BugList
import core
import requests
def POCScanConsole(attackurl,url):
allpoc=POC.query.all()
with app.app_context():
for poc in allpoc:
try:
rep = requests.get(url+poc.rule, headers=core.GetHeaders(),timeout=2)
if rep.status_code!=404 and poc.expression in rep.text:
bug = BugList(oldurl=attackurl, bugurl=url, bugname=poc.name,buggrade=redispool.hget('bugtype', poc.name), payload=url+poc,
bugdetail=rep.text)
redispool.pfadd(redispool.hget('bugtype', poc.name), url)
redispool.pfadd(poc.name, url)
db.session.add(bug)
except Exception as e:
print(e)
pass
db.session.commit()