diff --git a/CHANGELOG.md b/CHANGELOG.md index d9460881a..bfe89cac6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - Support non-default network interface - Remove unused dependencies (urllib3, cryptography, cffi, idna, chardet) - Load targets from a Nmap XML report +- Added --urls-only option to output only the full URL ## [0.4.3] - October 2nd, 2022 - Automatically detect the URI scheme (`http` or `https`) if no scheme is provided diff --git a/README.md b/README.md index c8d3b4a74..6316fc276 100644 --- a/README.md +++ b/README.md @@ -266,6 +266,7 @@ Options: Show redirects history --no-color No colored output -q, --quiet-mode Quiet mode + --urls-only Output only the full URLs Output Settings: -o PATH, --output=PATH @@ -343,6 +344,7 @@ crawl = False [view] full-url = False quiet-mode = False +urls-only = Faise color = True show-redirects-history = False diff --git a/config.ini b/config.ini index 21b4413a6..923775926 100644 --- a/config.ini +++ b/config.ini @@ -67,6 +67,7 @@ crawl = False [view] full-url = False quiet-mode = False +urls-only = False color = True show-redirects-history = False diff --git a/lib/core/data.py b/lib/core/data.py index 46292f4d4..c20019556 100755 --- a/lib/core/data.py +++ b/lib/core/data.py @@ -87,6 +87,7 @@ "redirects_history": False, "color": True, "quiet": False, + "urls_only": False, "output_file": None, "output_format": None, "log_file": None, diff --git a/lib/core/options.py b/lib/core/options.py index 03119700d..b9a37c8d4 100755 --- a/lib/core/options.py +++ b/lib/core/options.py @@ -355,6 +355,7 @@ def parse_config(opt): opt.full_url = opt.full_url or config.safe_getboolean("view", "full-url") opt.color = opt.color or config.safe_getboolean("view", "color", True) opt.quiet = opt.quiet or config.safe_getboolean("view", "quiet-mode") + opt.urls_only = opt.urls_only or config.safe_getboolean("view", "urls-only") opt.redirects_history = opt.redirects_history or config.safe_getboolean( "view", "show-redirects-history" ) diff --git a/lib/parse/cmdline.py b/lib/parse/cmdline.py index fb71e9860..1acbf7686 100755 --- a/lib/parse/cmdline.py +++ b/lib/parse/cmdline.py @@ -489,6 +489,9 @@ def parse_arguments(): view.add_option( "-q", "--quiet-mode", action="store_true", dest="quiet", help="Quiet mode" ) + view.add_option( + "--urls-only", action="store_true", dest="urls_only", help="Output only the full URLs" + ) # Output Settings output = OptionGroup(parser, "Output Settings") diff --git a/lib/view/terminal.py b/lib/view/terminal.py index d85b0fb51..d6bb74941 100755 --- a/lib/view/terminal.py +++ b/lib/view/terminal.py @@ -233,4 +233,9 @@ def log_file(*args): pass -interface = QuietCLI() if options["quiet"] else CLI() +class URLOnlyCLI(QuietCLI): + def status_report(self, response, _): + self.new_line(response.url) + + +interface = URLOnlyCLI() if options["urls_only"] else QuietCLI() if options["quiet"] else CLI()