Skip to content

Commit

Permalink
Import Fixes and Version Bump
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan-sincek committed Sep 15, 2024
1 parent cc2c837 commit 051d018
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 24 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
},
Expand All @@ -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
}
Expand All @@ -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]
Expand Down Expand Up @@ -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
Expand All @@ -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]
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
12 changes: 6 additions & 6 deletions src/forbidden/forbidden.py
Original file line number Diff line number Diff line change
@@ -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)

Expand Down Expand Up @@ -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 = []
Expand All @@ -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()
Expand Down Expand Up @@ -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"]
Expand Down Expand Up @@ -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]")
Expand Down Expand Up @@ -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. #")
Expand Down
16 changes: 8 additions & 8 deletions src/stresser/stresser.py
Original file line number Diff line number Diff line change
@@ -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)

Expand Down Expand Up @@ -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 = []
Expand All @@ -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()
Expand All @@ -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
Expand Down Expand Up @@ -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"]
Expand Down Expand Up @@ -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]")
Expand All @@ -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")
Expand Down Expand Up @@ -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. #")
Expand Down

0 comments on commit 051d018

Please sign in to comment.