From 051d01847c4ad0db9ffb96d61a4b879592d7999a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivan=20=C5=A0incek?= <35937483+ivan-sincek@users.noreply.github.com> Date: Sun, 15 Sep 2024 16:42:30 +0200 Subject: [PATCH] Import Fixes and Version Bump --- README.md | 18 +++++++++--------- pyproject.toml | 2 +- src/forbidden/forbidden.py | 12 ++++++------ src/stresser/stresser.py | 16 ++++++++-------- 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index a473d56..c2432d8 100644 --- a/README.md +++ b/README.md @@ -143,7 +143,7 @@ python3 -m pip install --upgrade build python3 -m build -python3 -m pip install dist/forbidden-12.3-py3-none-any.whl +python3 -m pip install dist/forbidden-12.4-py3-none-any.whl ``` ## Single URL @@ -427,8 +427,8 @@ Inject at the end of the URL path only if it does not end with forward slash. ], "cookies": [], "body": null, - "user_agent": "Forbidden/12.3", - "command": "curl --connect-timeout 60 -m 60 -iskL --max-redirs 10 --path-as-is -A 'Forbidden/12.3' -H 'Host: 127.0.0.1' -X 'GET' 'https://example.com:443/admin'", + "user_agent": "Forbidden/12.4", + "command": "curl --connect-timeout 60 -m 60 -iskL --max-redirs 10 --path-as-is -A 'Forbidden/12.4' -H 'Host: 127.0.0.1' -X 'GET' 'https://example.com:443/admin'", "code": 200, "length": 255408 }, @@ -441,8 +441,8 @@ Inject at the end of the URL path only if it does not end with forward slash. ], "cookies": [], "body": null, - "user_agent": "Forbidden/12.3", - "command": "curl --connect-timeout 60 -m 60 -iskL --max-redirs 10 --path-as-is -A 'Forbidden/12.3' -H 'Host: 127.0.0.1:443' -X 'GET' 'https://example.com:443/admin'", + "user_agent": "Forbidden/12.4", + "command": "curl --connect-timeout 60 -m 60 -iskL --max-redirs 10 --path-as-is -A 'Forbidden/12.4' -H 'Host: 127.0.0.1:443' -X 'GET' 'https://example.com:443/admin'", "code": 200, "length": 255408 } @@ -452,7 +452,7 @@ Inject at the end of the URL path only if it does not end with forward slash. ## Usage ```fundamental -Forbidden v12.3 ( github.com/ivan-sincek/forbidden ) +Forbidden v12.4 ( 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] @@ -527,7 +527,7 @@ SLEEP -s, --sleep = 500 | etc. USER AGENT User agent to use - Default: Forbidden/12.3 + Default: Forbidden/12.4 -a, --user-agent = curl/3.30.1 | random[-all] | etc. PROXY Web proxy to use @@ -553,7 +553,7 @@ DEBUG ``` ```fundamental -Stresser v12.3 ( github.com/ivan-sincek/forbidden ) +Stresser v12.4 ( 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] @@ -603,7 +603,7 @@ THREADS -th, --threads = 20 | etc. USER AGENT User agent to use - Default: Stresser/12.3 + Default: Stresser/12.4 -a, --user-agent = curl/3.30.1 | random[-all] | etc. PROXY Web proxy to use diff --git a/pyproject.toml b/pyproject.toml index 972ccda..2d0c23b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "forbidden" -version = "12.3" +version = "12.4" authors = [{ name = "Ivan Sincek" }] description = "Bypass 4xx HTTP response status codes and more. Based on PycURL and Python Requests." readme = "README.md" diff --git a/src/forbidden/forbidden.py b/src/forbidden/forbidden.py index 564d557..f803c1c 100644 --- a/src/forbidden/forbidden.py +++ b/src/forbidden/forbidden.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 -import alive_progress, argparse, base64, colorama, concurrent.futures, copy, datetime, io, json, jwt, os, pycurl, random, regex as re, requests, socket, subprocess, sys, tabulate, tempfile, termcolor, threading, urllib.parse +import alive_progress, argparse, base64, colorama, concurrent.futures, copy, datetime, io, json, jwt, os, pycurl, random, regex as re, requests, socket, sys, tabulate, tempfile, termcolor, threading, time, urllib.parse colorama.init(autoreset = True) @@ -334,7 +334,7 @@ def write_file(data, out): # ---------------------------------------- -default_user_agent = "Forbidden/12.3" +default_user_agent = "Forbidden/12.4" def get_all_user_agents(): tmp = [] @@ -345,7 +345,7 @@ def get_all_user_agents(): line = line.strip() if line: tmp.append(line) - return tmp if tmp else [default_agent] + return tmp if tmp else [default_user_agent] def get_random_user_agent(): tmp = get_all_user_agents() @@ -708,7 +708,7 @@ def __inspect_cookies(self, cookies = None): return tmp def __get_user_agent(self): - return self.__user_agents[random.randint(0, self.__user_agents_len - 1)] if self.__user_agents_len > 1 else self.__user_agents[0] + return self.__user_agents[random.randint(0, self.__user_agents_len - 1)] def __build_command(self, record): tmp = ["curl", ("--connect-timeout {0}").format(self.__connect_timeout), ("-m {0}").format(self.__read_timeout), "-iskL", ("--max-redirs {0}").format(self.__max_redirects), "--path-as-is"] @@ -1695,7 +1695,7 @@ def show_results(self): class MyArgParser(argparse.ArgumentParser): def print_help(self): - print("Forbidden v12.3 ( github.com/ivan-sincek/forbidden )") + print("Forbidden v12.4 ( 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]") @@ -2038,7 +2038,7 @@ def main(): if validate.run(): print("###########################################################################") print("# #") - print("# Forbidden v12.3 #") + print("# Forbidden v12.4 #") 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 030d7ba..ca36278 100644 --- a/src/stresser/stresser.py +++ b/src/stresser/stresser.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 -import alive_progress, argparse, colorama, concurrent.futures, copy, datetime, io, json, os, pycurl, random, regex as re, requests, socket, subprocess, sys, tabulate, tempfile, termcolor, threading, urllib.parse +import alive_progress, argparse, colorama, concurrent.futures, copy, datetime, io, json, os, pycurl, random, regex as re, requests, socket, sys, tabulate, tempfile, termcolor, threading, time, urllib.parse colorama.init(autoreset = True) @@ -201,7 +201,7 @@ def write_file(data, out): # ---------------------------------------- -default_user_agent = "Stresser/12.3" +default_user_agent = "Stresser/12.4" def get_all_user_agents(): tmp = [] @@ -212,7 +212,7 @@ def get_all_user_agents(): line = line.strip() if line: tmp.append(line) - return tmp if tmp else [default_agent] + return tmp if tmp else [default_user_agent] def get_random_user_agent(): tmp = get_all_user_agents() @@ -238,7 +238,7 @@ def __init__(self, url, ignore_qsf, ignore_requests, force, headers, cookies, ig self.__repeat = repeat self.__threads = threads self.__user_agents = user_agents - self.__user_agents_len = len(self.__user_agents) + self.__user_agents_len = len(self.__user_agents) self.__proxy = proxy self.__status_codes = status_codes self.__show_table = show_table @@ -537,7 +537,7 @@ def __inspect_cookies(self, cookies = None): return tmp def __get_user_agent(self): - return self.__user_agents[random.randint(0, self.__user_agents_len - 1)] if self.__user_agents_len > 1 else self.__user_agents[0] + return self.__user_agents[random.randint(0, self.__user_agents_len - 1)] def __build_command(self, record): tmp = ["curl", ("--connect-timeout {0}").format(self.__connect_timeout), ("-m {0}").format(self.__read_timeout), "-iskL", ("--max-redirs {0}").format(self.__max_redirects), "--path-as-is"] @@ -909,7 +909,7 @@ def show_results(self): class MyArgParser(argparse.ArgumentParser): def print_help(self): - print("Stresser v12.3 ( github.com/ivan-sincek/forbidden )") + print("Stresser v12.4 ( 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]") @@ -932,7 +932,7 @@ def print_help(self): print("HEADER") print(" Specify any number of extra HTTP request headers") print(" Extra HTTP request headers will not override test's HTTP request headers") - print(" Semi-colon, in e.g., 'Content-Type;' will expand to an empty HTTP request header") + print(" Semi-colon in, e.g., 'Content-Type;' will expand to an empty HTTP request header") print(" -H, --header = \"Authorization: Bearer ey...\" | Content-Type; | etc.") print("COOKIE") print(" Specify any number of extra HTTP cookies") @@ -1187,7 +1187,7 @@ def main(): if validate.run(): print("##########################################################################") print("# #") - print("# Stresser v12.3 #") + print("# Stresser v12.4 #") print("# by Ivan Sincek #") print("# #") print("# Bypass 4xx HTTP response status codes with stress testing. #")