Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
maurosoria authored Nov 22, 2023
2 parents edcb34f + be82462 commit 9ff08ac
Show file tree
Hide file tree
Showing 14 changed files with 31 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Changelog

## [Unreleased]
- Support non-default network interface

- Remove unused dependencies (urllib3, cryptography, cffi, idna, chardet)

Expand Down
3 changes: 3 additions & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@
- [kosyan62](https://https://github.com/kosyan62)
- [Maxence Zolnieurck](https://github.com/mxcezl)
- [Giorgos Drosos](https://github.com/gdrosos)
- [huyphan](https://github.com/huyphan)
- [Sean Wei](https://www.sean.taipei/about-en)
- [FantasqueX](https://www.github.com/FantasqueX)

Special thanks to all the people who are named here!

Expand Down
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ RUN apk add \
libffi-dev

RUN pip install -r requirements.txt
RUN chmod +x dirsearch.py

ENTRYPOINT ["./dirsearch.py"]
CMD ["--help"]
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<img src="static/logo.png" alt="dirsearch" width="675px">
<img src="static/logo.png#gh-light-mode-only" alt="dirsearch logo (light)" width="675px">
<img src="static/logo-dark.png#gh-dark-mode-only" alt="dirsearch logo (dark)" width="675px">

dirsearch - Web path discovery
=========
Expand Down Expand Up @@ -252,6 +253,8 @@ Options:
--max-rate=RATE Max requests per second
--retries=RETRIES Number of retries for failed requests
--ip=IP Server IP address
--interface=NETWORK_INTERFACE
Network interface to use
Advanced Settings:
--crawl Crawl for new paths in responses
Expand Down
1 change: 1 addition & 0 deletions config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ max-retries = 1
# proxies = ["localhost:8080"]
# proxies-file = /path/to/proxies.txt
# replay-proxy = localhost:8000
# network-interface = eth0

[advanced]
crawl = False
Expand Down
3 changes: 2 additions & 1 deletion db/dicc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4084,6 +4084,7 @@ configuration.swp
configuration/
configuration~
configure
configure.php
configure.php.bak
configure.scan
config~
Expand Down Expand Up @@ -5096,8 +5097,8 @@ Gemfile.lock
GEMINI/
gen/
general
geoserver/index.html
Generated_Code/
geoserver/index.html
get
GET
get.php
Expand Down
15 changes: 13 additions & 2 deletions lib/connection/requester.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
import threading
import time

from requests.adapters import HTTPAdapter
from requests.auth import AuthBase, HTTPBasicAuth, HTTPDigestAuth
from requests.packages import urllib3
from requests_ntlm import HttpNtlmAuth
from requests_toolbelt.adapters.socket_options import SocketOptionsAdapter
from urllib.parse import urlparse

from lib.core.data import options
Expand Down Expand Up @@ -83,9 +83,20 @@ def __init__(self):
if options["data"] and "content-type" not in self.headers:
self.set_header("content-type", guess_mimetype(options["data"]))

socket_options = []
if options["network_interface"]:
socket_options.append(
(socket.SOL_SOCKET, socket.SO_BINDTODEVICE, options["network_interface"].encode("utf-8"))
)

for scheme in ("http://", "https://"):
self.session.mount(
scheme, HTTPAdapter(max_retries=0, pool_maxsize=options["thread_count"])
scheme,
SocketOptionsAdapter(
max_retries=0,
pool_maxsize=options["thread_count"],
socket_options=socket_options,
)
)

def _fetch_agents(self):
Expand Down
2 changes: 1 addition & 1 deletion lib/controller/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ def get_output_extension(self):
if options["output_format"] in ("plain", "simple"):
return "txt"

return {options["output_format"]}
return options["output_format"]

def setup_reports(self):
"""Create report file"""
Expand Down
1 change: 1 addition & 0 deletions lib/core/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
"scheme": None,
"max_rate": 0,
"max_retries": 1,
"network_interface": None,
"ip": None,
"exit_on_error": False,
"crawl": False,
Expand Down
1 change: 1 addition & 0 deletions lib/core/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ def parse_config(opt):
"connection", "scheme", None, ("http", "https")
)
opt.replay_proxy = opt.replay_proxy or config.safe_get("connection", "replay-proxy")
opt.network_interface = opt.network_interface or config.safe_get("connection", "network-interface")

# Advanced
opt.crawl = opt.crawl or config.safe_getboolean("advanced", "crawl")
Expand Down
1 change: 1 addition & 0 deletions lib/parse/cmdline.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,7 @@ def parse_arguments():
help="Number of retries for failed requests",
)
connection.add_option("--ip", action="store", dest="ip", help="Server IP address")
connection.add_option("--interface", action="store", dest="network_interface", help="Network interface to use")

# Advanced Settings
advanced = OptionGroup(parser, "Advanced Settings")
Expand Down
1 change: 1 addition & 0 deletions lib/utils/pickle.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

ALLOWED_PICKLE_CLASSES = (
"collections.OrderedDict",
"http.cookiejar.Cookie",
"http.cookiejar.DefaultCookiePolicy",
"requests.adapters.HTTPAdapter",
"requests.cookies.RequestsCookieJar",
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ pyparsing>=2.4.7
beautifulsoup4>=4.8.0
mysql-connector-python>=8.0.20
psycopg[binary]>=3.0
requests-toolbelt>=1.0.0
Binary file added static/logo-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 9ff08ac

Please sign in to comment.