From 8c3f222d239dd58879951cbfd61e214f25b0bacf Mon Sep 17 00:00:00 2001 From: anshumanpattnaik Date: Mon, 21 Dec 2020 13:54:24 +0530 Subject: [PATCH] URL path handled for query parameters & fragments --- lib/Utils.py | 6 +++++- smuggle.py | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/Utils.py b/lib/Utils.py index a0447e6..42aa74a 100644 --- a/lib/Utils.py +++ b/lib/Utils.py @@ -71,8 +71,12 @@ def url_parser(self, url): parser["port"] = port path = u_parser.path + query = '?'+u_parser.query if u_parser.query else '' + fragment = '#'+u_parser.fragment if u_parser.fragment else '' + uri_path = f'{path}{query}{fragment}' + if len(path) > 0: - parser["path"] = path + parser["path"] = uri_path else: parser["path"] = '/' return json.dumps(parser) diff --git a/smuggle.py b/smuggle.py index 6653553..eb4e134 100644 --- a/smuggle.py +++ b/smuggle.py @@ -150,8 +150,8 @@ def hrs_detection(host, port, path, method, permute_type, content_length_key, te host = json_res['host'] port = json_res['port'] path = json_res['path'] - - # If host is invalid then it will exit + + #If host is invalid then it will exit if host == None: print(f"Invalid host - {host}") sys.exit(1)