From 239096d80f2e31e1aa5ce4197bf0cb29c00fe808 Mon Sep 17 00:00:00 2001 From: Miguel Sanchez Date: Sat, 13 Aug 2022 16:57:23 -0400 Subject: [PATCH] added waybackpy API --- README.md | 11 ++++++++++- gsec.py | 1 + requirements.txt | 3 ++- utils/passive_recon.py | 22 +++++++++++++++++++++- 4 files changed, 34 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 527ae7c..be4e05e 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Web Security Scanner ,~, - ((()- - GSec v0.8 + ((()- - GSec v0.9 -''-. - by c0deninja (\ /\) - @gotr00t0day (Instagram) ~______\) | `\ @@ -43,6 +43,15 @@ Gsec will fetch the shodan API key from the core directory, the passive recon sc please save your shodan key in core/.shodan for the scan to be able to work. +``` + +## 📁 OUTPUT + +```bash + +Some outputs that are too large will be saved in a file in the output folder / directory. + + ``` ## Usage diff --git a/gsec.py b/gsec.py index 45ae023..2ccc13c 100644 --- a/gsec.py +++ b/gsec.py @@ -71,6 +71,7 @@ def commands(cmd): passive_recon.whois_scan(args.target) passive_recon.dns_info(args.target) passive_recon.shodan_search(args.target) + passive_recon.waybackurls_scan(args.target) else: fetch_requests.do_requests(args.target) ip = urltoip.get_ip(args.target) diff --git a/requirements.txt b/requirements.txt index 073c7f1..99823f9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,4 +4,5 @@ colorama urllib3 python-whois dnspython -shodan \ No newline at end of file +shodan +waybackpy \ No newline at end of file diff --git a/utils/passive_recon.py b/utils/passive_recon.py index 583381f..44cab99 100644 --- a/utils/passive_recon.py +++ b/utils/passive_recon.py @@ -3,6 +3,13 @@ import dns.resolver import shodan import socket +import subprocess + +def commands(cmd): + try: + subprocess.check_call(cmd, shell=True) + except: + pass def whois_scan(domain: str) -> str: @@ -47,4 +54,17 @@ def shodan_search(domain: str) -> str: except shodan.APIError: print(f"{Fore.MAGENTA}[+] {Fore.CYAN}-{Fore.YELLOW} Shodan Key: {Fore.GREEN} Invalid Key") except socket.herror: - pass \ No newline at end of file + pass + +def waybackurls_scan(domain: str) -> str: + cmd = f"waybackpy --url {domain} --user_agent 'my-user-agent' --known_urls | head -10000" + p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + check, err = p.communicate() + check = check.decode() + with open("output/waybackurls.txt", "a") as f: + f.writelines(check) + print(f"{Fore.MAGENTA}[+] {Fore.CYAN}-{Fore.WHITE} Waybackurls: {Fore.GREEN} Saved to /output/waybackurls.txt") + + + +