Skip to content

Commit

Permalink
added waybackpy API
Browse files Browse the repository at this point in the history
  • Loading branch information
Miguel Sanchez authored and Miguel Sanchez committed Aug 13, 2022
1 parent c339a26 commit 239096d
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 3 deletions.
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Web Security Scanner


,~,
((()- - GSec v0.8
((()- - GSec v0.9
-''-. - by c0deninja
(\ /\) - @gotr00t0day (Instagram)
~______\) | `\
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions gsec.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ colorama
urllib3
python-whois
dnspython
shodan
shodan
waybackpy
22 changes: 21 additions & 1 deletion utils/passive_recon.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
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")




0 comments on commit 239096d

Please sign in to comment.