Last active
June 12, 2020 18:37
-
-
Save Ge0rg3/1bd8c5dfa4d7f8defca5050f317d9c02 to your computer and use it in GitHub Desktop.
Same algorithm as Sandcastle (https://github.com/0xSearches/sandcastle), but less clunky (and with annoying status messages). Also keeps flushing messages.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import requests as rq | |
import sys | |
if len(sys.argv) < 3: | |
print("Usage: python sandcastle.py companyname wordlist.txt", flush=True) | |
exit() | |
company = sys.argv[1] | |
wordlist_dir = sys.argv[2] | |
with open(wordlist_dir, 'r') as f: | |
wordlist = f.read().split("\n") | |
print(f"Attempting {len(wordlist)} combinations.", flush=True) | |
for index, attempt in enumerate(wordlist): | |
r = rq.head(f"http://{company}{attempt}.s3.amazonaws.com") | |
if r.status_code != 404: | |
print(f"success: {company}{attempt} ({r.status_code})", flush=True) | |
elif index % 25 == 0: | |
print(f"status: {index}", flush=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment