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 -q --quiet switch to show only result #205

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
17 changes: 13 additions & 4 deletions sublist3r.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ def parse_args():
parser.add_argument('-e', '--engines', help='Specify a comma-separated list of search engines')
parser.add_argument('-o', '--output', help='Save the results to text file')
parser.add_argument('-n', '--no-color', help='Output without color', default=False, action='store_true')
parser.add_argument('-q', '--quiet', help='Show only result', default=False, action='store_true')
return parser.parse_args()


Expand Down Expand Up @@ -876,7 +877,7 @@ def run(self):
t.start()


def main(domain, threads, savefile, ports, silent, verbose, enable_bruteforce, engines):
def main(domain, threads, savefile, ports, silent, verbose, enable_bruteforce, engines, quiet):
bruteforce_list = set()
search_list = set()

Expand Down Expand Up @@ -975,7 +976,7 @@ def main(domain, threads, savefile, ports, silent, verbose, enable_bruteforce, e
pscan = portscan(subdomains, ports)
pscan.run()

elif not silent:
elif not silent or quiet:
for subdomain in subdomains:
print(G + subdomain + W)
return subdomains
Expand All @@ -990,12 +991,20 @@ def interactive():
enable_bruteforce = args.bruteforce
verbose = args.verbose
engines = args.engines
quiet = args.quiet

if verbose or verbose is None:
verbose = True
if args.no_color:
no_color()
banner()
res = main(domain, threads, savefile, ports, silent=False, verbose=verbose, enable_bruteforce=enable_bruteforce, engines=engines)

if quiet:
silent = True
else:
silent = False
banner()

res = main(domain, threads, savefile, ports, silent, verbose=verbose, enable_bruteforce=enable_bruteforce, engines=engines, quiet=quiet)

if __name__ == "__main__":
interactive()