aboutsummaryrefslogtreecommitdiffstats
path: root/examples/complex/xss_scanner.py
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2018-09-07 10:32:40 +0200
committerGitHub <noreply@github.com>2018-09-07 10:32:40 +0200
commit53e776187673a89192cdecd2d806077579f062e1 (patch)
treeced428d5f83424f5c27a8f3e2f1161eba8b77807 /examples/complex/xss_scanner.py
parentb7aa325bfe9e392f5f5089a0b6be648e7ccaf6d7 (diff)
parentdcd8ba34ab652d7f8678637377c30e26f7efdd25 (diff)
downloadmitmproxy-53e776187673a89192cdecd2d806077579f062e1.tar.gz
mitmproxy-53e776187673a89192cdecd2d806077579f062e1.tar.bz2
mitmproxy-53e776187673a89192cdecd2d806077579f062e1.zip
Merge pull request #3294 from elijahbal/master
Fix XSS scanner failure in test_xss_scanner.py
Diffstat (limited to 'examples/complex/xss_scanner.py')
-rwxr-xr-xexamples/complex/xss_scanner.py6
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))