Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions httpmethods.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def methods_from_wordlist(wordlist):
with open(options.wordlist, "r") as infile:
methods += infile.read().split()
except Exception as e:
logger.error(f"Had some kind of error loading the wordlist ¯\_(ツ)_/¯: {e}")
logger.error(rf"Had some kind of error loading the wordlist ¯\_(ツ)_/¯: {e}")


def methods_from_http_options(console, options, proxies, headers, cookies):
Expand Down Expand Up @@ -338,7 +338,7 @@ def main(options, logger, console):
test_dangerous_method = "n"
else:
test_dangerous_method = console.input(
f"[bold orange3][?][/bold orange3] Do you really want to test method {method} (can be dangerous)? \[y/N] ")
f"[bold orange3][?][/bold orange3] Do you really want to test method {method} (can be dangerous)? [y/N] ")
if not test_dangerous_method.lower() == "y":
logger.verbose(f"Method {method} will not be tested")
else:
Expand All @@ -365,7 +365,9 @@ def main(options, logger, console):
json_export(results, options.jsonfile)


if __name__ == '__main__':
def cli_entry():
"""Entry point for console script."""
global logger, console, options
try:
print(banner)
options = get_options()
Expand All @@ -375,7 +377,11 @@ def main(options, logger, console):
# Disable warnings of insecure connection for invalid cerificates
requests.packages.urllib3.disable_warnings()
# Allow use of deprecated and weak cipher methods
requests.packages.urllib3.util.ssl_.DEFAULT_CIPHERS += ':HIGH:!DH:!aNULL'
try:
requests.packages.urllib3.util.ssl_.DEFAULT_CIPHERS += ':HIGH:!DH:!aNULL'
except AttributeError:
# urllib3 v2.0+ removed DEFAULT_CIPHERS
pass
try:
requests.packages.urllib3.contrib.pyopenssl.util.ssl_.DEFAULT_CIPHERS += ':HIGH:!DH:!aNULL'
except AttributeError:
Expand All @@ -384,3 +390,7 @@ def main(options, logger, console):
except KeyboardInterrupt:
logger.info("Terminating script...")
raise SystemExit


if __name__ == '__main__':
cli_entry()
33 changes: 33 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
[build-system]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"

[project]
name = "httpmethods"
version = "1.1.0"
description = "HTTP verb tampering & methods enumeration"
readme = "README.md"
authors = [{name = "Shutdown"}]
license = {text = "GPL-3.0"}
requires-python = ">=3.6"
classifiers = [
"Environment :: Console",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python :: 3",
"Topic :: Security",
]
dependencies = [
"requests",
"urllib3",
"rich",
]

[project.urls]
Homepage = "https://github.com/ShutdownRepo/httpmethods"

[project.scripts]
httpmethods = "httpmethods:cli_entry"

[tool.setuptools]
py-modules = ["httpmethods"]
4 changes: 0 additions & 4 deletions requirements.txt

This file was deleted.

34 changes: 0 additions & 34 deletions setup.py

This file was deleted.