diff options
author | Maximilian Hils <git@maximilianhils.com> | 2018-09-07 14:46:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-07 14:46:19 +0200 |
commit | 03cb77a5e0bea9f33115d9ac3f8b4ffee2c2246e (patch) | |
tree | fdbbd289c8b5a52d019a72af1f3b9d507ef5b615 /examples/complex/xss_scanner.py | |
parent | 3f14a485d3e6803d6257d947f508f0eabb35fa1c (diff) | |
parent | 9564b7a0b264157f627d4ad14595b5fe22115aad (diff) | |
download | mitmproxy-03cb77a5e0bea9f33115d9ac3f8b4ffee2c2246e.tar.gz mitmproxy-03cb77a5e0bea9f33115d9ac3f8b4ffee2c2246e.tar.bz2 mitmproxy-03cb77a5e0bea9f33115d9ac3f8b4ffee2c2246e.zip |
Merge branch 'master' into feature_correct_lib_version
Diffstat (limited to 'examples/complex/xss_scanner.py')
-rwxr-xr-x | examples/complex/xss_scanner.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/complex/xss_scanner.py b/examples/complex/xss_scanner.py index 55fc2fe7..cdaaf478 100755 --- a/examples/complex/xss_scanner.py +++ b/examples/complex/xss_scanner.py @@ -37,9 +37,9 @@ Line: 1029zxcs'd"ao<ac>so[sb]po(pc)se;sl/bsl\eq=3847asd from html.parser import HTMLParser from typing import Dict, Union, Tuple, Optional, List, NamedTuple -from socket import gaierror, gethostbyname from urllib.parse import urlparse import re +import socket import requests @@ -109,8 +109,8 @@ def find_unclaimed_URLs(body: str, requestUrl: bytes) -> None: url_parser = urlparse(url) domain = url_parser.netloc try: - gethostbyname(domain) - except gaierror: + socket.gethostbyname(domain) + except socket.gaierror: ctx.log.error("XSS found in %s due to unclaimed URL \"%s\"." % (requestUrl, url)) |