From 7b5acd535d819cfc1f9c802d320a689995ab6267 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivan=20=C5=A0incek?= <35937483+ivan-sincek@users.noreply.github.com> Date: Fri, 29 Dec 2023 22:33:21 +0100 Subject: [PATCH] Stresser Required Arguments Fix --- README.md | 18 +++++++++--------- pyproject.toml | 4 ++-- src/forbidden/forbidden.py | 7 +++---- src/stresser/stresser.py | 12 ++++++------ 4 files changed, 20 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index dea7218..0863d1c 100644 --- a/README.md +++ b/README.md @@ -110,7 +110,7 @@ python3 -m pip install --upgrade build python3 -m build -python3 -m pip install dist/forbidden-10.4-py3-none-any.whl +python3 -m pip install dist/forbidden-10.5-py3-none-any.whl ``` ## Automation @@ -354,8 +354,8 @@ Inject at the end of the URL path only if it does not end with forward slash. "Host: 127.0.0.1" ], "body": null, - "user_agent": "Forbidden/10.4", - "command": "curl --connect-timeout 60 -m 90 -iskL --max-redirs 10 --path-as-is -A 'Forbidden/10.4' -H 'Host: 127.0.0.1' -X 'GET' 'https://example.com:443/admin'", + "user_agent": "Forbidden/10.5", + "command": "curl --connect-timeout 60 -m 90 -iskL --max-redirs 10 --path-as-is -A 'Forbidden/10.5' -H 'Host: 127.0.0.1' -X 'GET' 'https://example.com:443/admin'", "code": 200, "length": 255408 }, @@ -367,8 +367,8 @@ Inject at the end of the URL path only if it does not end with forward slash. "Host: 127.0.0.1:443" ], "body": null, - "user_agent": "Forbidden/10.4", - "command": "curl --connect-timeout 60 -m 90 -iskL --max-redirs 10 --path-as-is -A 'Forbidden/10.4' -H 'Host: 127.0.0.1:443' -X 'GET' 'https://example.com:443/admin'", + "user_agent": "Forbidden/10.5", + "command": "curl --connect-timeout 60 -m 90 -iskL --max-redirs 10 --path-as-is -A 'Forbidden/10.5' -H 'Host: 127.0.0.1:443' -X 'GET' 'https://example.com:443/admin'", "code": 200, "length": 255408 } @@ -378,7 +378,7 @@ Inject at the end of the URL path only if it does not end with forward slash. ## Usage ```fundamental -Forbidden v10.4 ( github.com/ivan-sincek/forbidden ) +Forbidden v10.5 ( github.com/ivan-sincek/forbidden ) Usage: forbidden -u url -t tests [-f force] [-v values ] [-p path ] [-o out ] Example: forbidden -u https://example.com/admin -t all [-f POST ] [-v values.txt] [-p /home] [-o results.json] @@ -438,7 +438,7 @@ SLEEP -s, --sleep = 500 | etc. USER AGENT User agent to use - Default: Forbidden/10.4 + Default: Forbidden/10.5 -a, --user-agent = curl/3.30.1 | random[-all] | etc. PROXY Web proxy to use @@ -452,7 +452,7 @@ DEBUG ``` ```fundamental -Stresser v10.4 ( github.com/ivan-sincek/forbidden ) +Stresser v10.5 ( github.com/ivan-sincek/forbidden ) Usage: stresser -u url -dir directory -r repeat -th threads [-f force] [-o out ] Example: stresser -u https://example.com/secret -dir results -r 1000 -th 200 [-f GET ] [-o results.json] @@ -488,7 +488,7 @@ THREADS -th, --threads = 20 | etc. USER AGENT User agent to use - Default: Stresser/10.4 + Default: Stresser/10.5 -a, --user-agent = curl/3.30.1 | random[-all] | etc. PROXY Web proxy to use diff --git a/pyproject.toml b/pyproject.toml index 3f6e660..abf828e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,11 +4,11 @@ build-backend = "setuptools.build_meta" [project] name = "forbidden" -version = "10.4" +version = "10.5" authors = [{ name = "Ivan Sincek" }] description = "Bypass 4xx HTTP response status codes and more. Based on PycURL and Python Requests." readme = "README.md" -requires-python = ">=3.7" +requires-python = ">=3.6" classifiers = [ "Programming Language :: Python :: 3", "License :: OSI Approved :: MIT License", diff --git a/src/forbidden/forbidden.py b/src/forbidden/forbidden.py index 6a129d0..8a2a24c 100644 --- a/src/forbidden/forbidden.py +++ b/src/forbidden/forbidden.py @@ -274,7 +274,6 @@ def read_file(file): line = line.strip() if line: tmp.append(line) - stream.close() return unique(tmp) def write_file(data, out): @@ -289,7 +288,7 @@ def write_file(data, out): except FileNotFoundError: print(("Cannot save results to '{0}'").format(out)) -default_user_agent = "Forbidden/10.4" +default_user_agent = "Forbidden/10.5" def get_all_user_agents(): tmp = [] @@ -1490,7 +1489,7 @@ def show(self): class MyArgParser(argparse.ArgumentParser): def print_help(self): - print("Forbidden v10.4 ( github.com/ivan-sincek/forbidden )") + print("Forbidden v10.5 ( github.com/ivan-sincek/forbidden )") print("") print("Usage: forbidden -u url -t tests [-f force] [-v values ] [-p path ] [-o out ]") print("Example: forbidden -u https://example.com/admin -t all [-f POST ] [-v values.txt] [-p /home] [-o results.json]") @@ -1749,7 +1748,7 @@ def main(): if validate.run(): print("###########################################################################") print("# #") - print("# Forbidden v10.4 #") + print("# Forbidden v10.5 #") print("# by Ivan Sincek #") print("# #") print("# Bypass 4xx HTTP response status codes and more. #") diff --git a/src/stresser/stresser.py b/src/stresser/stresser.py index 4150228..d0adaa2 100644 --- a/src/stresser/stresser.py +++ b/src/stresser/stresser.py @@ -155,7 +155,7 @@ def write_file(data, out): except FileNotFoundError: print(("Cannot save results to '{0}'").format(out)) -default_user_agent = "Stresser/10.4" +default_user_agent = "Stresser/10.5" def get_all_user_agents(): tmp = [] @@ -731,7 +731,7 @@ def show(self): class MyArgParser(argparse.ArgumentParser): def print_help(self): - print("Stresser v10.4 ( github.com/ivan-sincek/forbidden )") + print("Stresser v10.5 ( github.com/ivan-sincek/forbidden )") print("") print("Usage: stresser -u url -dir directory -r repeat -th threads [-f force] [-o out ]") print("Example: stresser -u https://example.com/secret -dir results -r 1000 -th 200 [-f GET ] [-o results.json]") @@ -802,12 +802,12 @@ def __init__(self): self.__parser.add_argument("-f" , "--force" , required = False, type = str.upper , default = "" ) self.__parser.add_argument("-i" , "--ignore" , required = False, type = str , default = "" ) self.__parser.add_argument("-l" , "--content-lengths" , required = False, type = str.lower , default = "" ) - self.__parser.add_argument("-r" , "--repeat" , required = False, type = str , default = "" ) - self.__parser.add_argument("-th" , "--threads" , required = False, type = str , default = "" ) + self.__parser.add_argument("-r" , "--repeat" , required = True , type = str , default = "" ) + self.__parser.add_argument("-th" , "--threads" , required = True , type = str , default = "" ) self.__parser.add_argument("-a" , "--user-agent" , required = False, type = str , default = "" ) self.__parser.add_argument("-x" , "--proxy" , required = False, type = str , default = "" ) self.__parser.add_argument("-o" , "--out" , required = False, type = str , default = "" ) - self.__parser.add_argument("-dir" , "--directory" , required = False, type = str , default = "" ) + self.__parser.add_argument("-dir" , "--directory" , required = True , type = str , default = "" ) self.__parser.add_argument("-dbg" , "--debug" , required = False, action = "store_true", default = False) def run(self): @@ -926,7 +926,7 @@ def main(): if validate.run(): print("##########################################################################") print("# #") - print("# Stresser v10.4 #") + print("# Stresser v10.5 #") print("# by Ivan Sincek #") print("# #") print("# Bypass 4xx HTTP response status codes with stress testing. #")