From fc5c09b8a3805b816ed7cb919255d3d3023f3f20 Mon Sep 17 00:00:00 2001 From: Tung Pun Date: Sun, 13 Sep 2020 21:15:12 +0700 Subject: [PATCH 1/2] fixed https://github.com/GerbenJavado/LinkFinder/issues/82 --- linkfinder.py | 8 ++++---- requirements.txt | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/linkfinder.py b/linkfinder.py index a33f53f..8d0661b 100755 --- a/linkfinder.py +++ b/linkfinder.py @@ -28,7 +28,7 @@ # Regex used regex_str = r""" - (?:"|') # Start newline delimiter + (?:"|'|=) # Start newline delimiter ( ((?:[a-zA-Z]{1,10}://|//) # Match a scheme [a-Z]*1-10 or // @@ -38,8 +38,8 @@ | ((?:/|\.\./|\./) # Start with /,../,./ - [^"'><,;| *()(%%$^/\\\[\]] # Next character can't be... - [^"'><,;|()]{1,}) # Rest of the characters can't be + [^"'><,;|\ *()(%%$^/\\\[\]] # Next character can't be... + [^"'><,;|\ ()]{1,}) # Rest of the characters can't be | @@ -63,7 +63,7 @@ ) - (?:"|') # End newline delimiter + (?:"|'|\ ) # End newline delimiter """ diff --git a/requirements.txt b/requirements.txt index fb0d438..3e95d40 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1,2 @@ jsbeautifier +pytest \ No newline at end of file From d86512ff544a5a3e36bbbf31ba411ef975032395 Mon Sep 17 00:00:00 2001 From: Tung Pun Date: Mon, 14 Sep 2020 15:28:39 +0700 Subject: [PATCH 2/2] disabled cert check --- linkfinder.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/linkfinder.py b/linkfinder.py index 8d0661b..911075c 100755 --- a/linkfinder.py +++ b/linkfinder.py @@ -130,11 +130,11 @@ def send_request(url): q.add_header('Cookie', args.cookies) try: - sslcontext = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2) - response = urlopen(q, timeout=args.timeout, context=sslcontext) - except: + response = urlopen(q, timeout=args.timeout, context=ssl._create_unverified_context()) + except Exception as e: + print(e) sslcontext = ssl.SSLContext(ssl.PROTOCOL_TLSv1) - response = urlopen(q, timeout=args.timeout, context=sslcontext) + response = urlopen(q, timeout=args.timeout, context=ssl._create_unverified_context()) if response.info().get('Content-Encoding') == 'gzip': data = GzipFile(fileobj=readBytesCustom(response.read())).read()