diff --git a/fileserver.py b/fileserver.py index 2fa2504..7a43bf8 100755 --- a/fileserver.py +++ b/fileserver.py @@ -79,9 +79,14 @@ class FileServerRequestHandler(BaseHTTPRequestHandler): result = route(self) blacklist_headers = ["transfer-encoding", "content-length", "content-encoding", "allow", "connection"] - status_code = 200 if len(result) < 1 else result[0] - data = b"" if len(result) < 2 else result[1] - headers = { } if len(result) < 3 else result[2] + if isinstance(result, tuple): + status_code = 200 if len(result) < 1 else result[0] + data = b"" if len(result) < 2 else result[1] + headers = { } if len(result) < 3 else result[2] + else: + status_code = result + data = b"" + headers = {} if path in self.server.dumpRequests: headers["Access-Control-Allow-Origin"] = "*" @@ -123,6 +128,7 @@ class FileServerRequestHandler(BaseHTTPRequestHandler): print("==========") except Exception as e: print("Exception on handling http", str(e)) + raise e def log_message(self, format, *args): if self.server.logRequests: diff --git a/template.py b/template.py index 3dd38d1..72d3ee3 100755 --- a/template.py +++ b/template.py @@ -4,10 +4,10 @@ import sys def generate_template(base_url, features): - if "proxy" in features or "burp" in features: + if "proxies" in features or "burp" in features: proxy = """ - if \"proxy\" not in kwargs: - kwargs[\"proxy\"] = {\"http\":\"http://127.0.0.1:8080\", \"https\":\"http://127.0.0.1:8080\"} + if \"proxies\" not in kwargs: + kwargs[\"proxies\"] = {\"http\":\"http://127.0.0.1:8080\", \"https\":\"http://127.0.0.1:8080\"} """ else: proxy = "" diff --git a/util.py b/util.py index 4e76d95..ac2db6b 100755 --- a/util.py +++ b/util.py @@ -83,6 +83,13 @@ def assert_header_present(res, header, err=None): err = f"[-] '{res.url}' did not return header: {header}" if err is None else err exit_with_error(res, err) +def assert_empty(res, err=None): + if not res.content or len(res.content) == 0: + return + + err = f"[-] '{res.url}' did not return unexpected data" if err is None else err + exit_with_error(res, err) + def assert_not_empty(res, err=None): if len(res.content) > 0: return diff --git a/win/FullPowers.exe b/win/FullPowers.exe new file mode 100644 index 0000000..cee79b1 Binary files /dev/null and b/win/FullPowers.exe differ