Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add --urls-only option #1394

Closed
wants to merge 3 commits into from
Closed
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -343,6 +344,7 @@ crawl = False
[view]
full-url = False
quiet-mode = False
urls-only = Faise
color = True
show-redirects-history = False

Expand Down
1 change: 1 addition & 0 deletions config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ crawl = False
[view]
full-url = False
quiet-mode = False
urls-only = False
color = True
show-redirects-history = False

Expand Down
1 change: 1 addition & 0 deletions lib/core/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
"redirects_history": False,
"color": True,
"quiet": False,
"urls_only": False,
"output_file": None,
"output_format": None,
"log_file": None,
Expand Down
1 change: 1 addition & 0 deletions lib/core/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down
3 changes: 3 additions & 0 deletions lib/parse/cmdline.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
7 changes: 6 additions & 1 deletion lib/view/terminal.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Loading