-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSubScanX.py
More file actions
50 lines (43 loc) · 2.04 KB
/
SubScanX.py
File metadata and controls
50 lines (43 loc) · 2.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import requests
import threading
import argparse
# Function to check URLs
def check_url(target, wordlist, mode):
with open(wordlist, "r") as file:
words = file.read().splitlines()
for word in words:
if mode == "dir":
url = f"{target}/{word}"
elif mode == "sub":
url = f"http://{word}.{target}"
try:
response = requests.get(url, timeout=3)
if response.status_code == 200:
print(f"[+] Found: {url} - Status: {response.status_code}")
except requests.ConnectionError:
pass
# Main function
def main():
parser = argparse.ArgumentParser(description="Simple Gobuster Clone")
parser.add_argument("-u", "--url", required=True, help="Target URL (example.com)")
parser.add_argument("-w", "--wordlist", required=True, help="Path to wordlist file")
parser.add_argument("-m", "--mode", choices=["dir", "sub"], required=True, help="Mode: 'dir' for directory busting, 'sub' for subdomain enumeration")
parser.add_argument("-t", "--threads", type=int, default=10, help="Number of threads (default: 10)")
parser.add_argument("--timeout", type=int, default=3, help="Request timeout in seconds (default: 3)")
args = parser.parse_args()
print("\n--- Gobuster Clone Help ---")
print("Usage:")
print(" python gobuster_clone.py -u http://example.com -w wordlist.txt -m dir")
print(" python gobuster_clone.py -u example.com -w subdomains.txt -m sub")
print("\nOptions:")
print(" -u, --url Target URL (example.com)")
print(" -w, --wordlist Path to wordlist file")
print(" -m, --mode Mode: 'dir' (directory busting) or 'sub' (subdomain enumeration)")
print(" -t, --threads Number of threads (default: 10)")
print(" --timeout Request timeout in seconds (default: 3)")
print("---------------------------\n")
thread = threading.Thread(target=check_url, args=(args.url, args.wordlist, args.mode))
thread.start()
thread.join()
if __name__ == "__main__":
main()