mirror of
https://github.com/shmilylty/OneForAll.git
synced 2026-08-26 04:47:48 +08:00
请求异常也加入结果
This commit is contained in:
+6
-1
@@ -135,7 +135,7 @@ def get(url, resp_list, session):
|
|||||||
resp = session.get(url, timeout=timeout, allow_redirects=redirect, proxies=proxy)
|
resp = session.get(url, timeout=timeout, allow_redirects=redirect, proxies=proxy)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.log('DEBUG', e.args)
|
logger.log('DEBUG', e.args)
|
||||||
return
|
resp = e
|
||||||
resp_list.append((url, resp))
|
resp_list.append((url, resp))
|
||||||
|
|
||||||
|
|
||||||
@@ -194,6 +194,11 @@ def bulk_request(urls):
|
|||||||
|
|
||||||
|
|
||||||
def gen_new_info(info, resp):
|
def gen_new_info(info, resp):
|
||||||
|
if isinstance(resp, Exception):
|
||||||
|
info['reason'] = str(resp.args)
|
||||||
|
info['request'] = 0
|
||||||
|
info['alive'] = 0
|
||||||
|
return info
|
||||||
info['reason'] = resp.reason
|
info['reason'] = resp.reason
|
||||||
code = resp.status_code
|
code = resp.status_code
|
||||||
info['status'] = code
|
info['status'] = code
|
||||||
|
|||||||
+2
-1
@@ -1,6 +1,7 @@
|
|||||||
import re
|
import re
|
||||||
import time
|
import time
|
||||||
from urllib import parse
|
from urllib import parse
|
||||||
|
from requests import Response
|
||||||
|
|
||||||
from common import utils
|
from common import utils
|
||||||
from common import resolve
|
from common import resolve
|
||||||
@@ -192,7 +193,7 @@ def find_subdomains(domain, data):
|
|||||||
|
|
||||||
resp_data = request.bulk_request(js_urls)
|
resp_data = request.bulk_request(js_urls)
|
||||||
for _, resp in resp_data:
|
for _, resp in resp_data:
|
||||||
if not resp:
|
if not isinstance(resp, Response):
|
||||||
continue
|
continue
|
||||||
text = utils.decode_resp_text(resp)
|
text = utils.decode_resp_text(resp)
|
||||||
subdomains.update(find_in_resp(domain, resp.url, text))
|
subdomains.update(find_in_resp(domain, resp.url, text))
|
||||||
|
|||||||
Reference in New Issue
Block a user