Skip to content

Commit c77aa77

Browse files
committed
Subchecker script
1 parent 858aa63 commit c77aa77

3 files changed

Lines changed: 85 additions & 0 deletions

File tree

SCRIPTS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,3 +98,4 @@
9898
| 64\. | RapidScan | The Multi-Tool Web Vulnerability Scanner | [Take me](./RapidScan)
9999
| 64\. | CredPhish | CredPhish is a PowerShell script designed to invoke credential prompts and exfiltrate passwords. | [Take me](./CredPhish)
100100
| 64\. | WebStor | This script is designed to perform reconnaissance and vulnerability assessment across websites within an organization's networks | [Take me](./WebStor)
101+
| 65\. | Subchecker | Penetration testers and bug hunters often use domain enumeration tools to discover subdomains and gather information about a target domain. | [Take me](./Subchecker)

Subchecker/Readme.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Subchecker
2+
3+
Penetration testers and bug hunters often use domain enumeration tools to discover subdomains and gather information about a target domain.

Subchecker/subchecker.py

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
2+
yellow = "\033[93m"
3+
green = "\033[92m"
4+
blue = "\033[94m"
5+
red = "\033[91m"
6+
bold = "\033[1m"
7+
end = "\033[0m"
8+
9+
10+
from concurrent.futures import ThreadPoolExecutor as executor # sudo pip install futures
11+
import sys, requests, argparse
12+
13+
14+
def printer(url):
15+
sys.stdout.write(url+" \r")
16+
sys.stdout.flush()
17+
return True
18+
19+
20+
21+
def check(out, url):
22+
printer("Testing: " + url)
23+
url = 'http://' + url
24+
try:
25+
req = requests.head(url, timeout=10)
26+
scode = str(req.status_code)
27+
if scode.startswith("2"):
28+
print(green + "[+] "+scode+" | Found: " + end + "[ " + url + " ]")
29+
elif scode.startswith("3"):
30+
link = req.headers['Location']
31+
print(yellow + "[*] "+scode+" | Redirection: " + end + "[ " + url + " ]" + yellow + " -> " + end + "[ " + link + " ]")
32+
elif st.startswith("4"):
33+
print(blue+"[!] "+scode+" | Check: " + end + "[ " + url + " ]")
34+
35+
if out != 'None':
36+
with open(out, 'a') as f:
37+
f.write(url+"\n")
38+
f.close()
39+
40+
return True
41+
42+
except Exception:
43+
return False
44+
45+
46+
47+
48+
def main():
49+
parser = argparse.ArgumentParser()
50+
parser.add_argument("-w", "--wordlist", help="Domains List File", type=str, required=True)
51+
parser.add_argument("-t", "--thread", help="Theads Number - (Default: 10)", type=int)
52+
parser.add_argument("-o", "--output", help="Save Results In a File", type=str) #action='store_true'
53+
54+
args = parser.parse_args()
55+
56+
wlist = str(args.wordlist)
57+
threads = str(args.thread)
58+
out = str(args.output)
59+
60+
if threads == 'None':
61+
threads = 10
62+
else:
63+
threads = threads
64+
65+
lines = len(open(wlist).readlines())
66+
print(blue +"["+red+"+"+blue+"] File: " + end + wlist)
67+
print(blue +"["+red+"+"+blue+"] Length: " + end + str(lines))
68+
print(blue +"["+red+"+"+blue+"] Threads: " + end + str(threads))
69+
print(blue +"["+red+"+"+blue+"] Output: " + end + str(out))
70+
print(red+bold+"\n[+] Results:\n"+end)
71+
72+
urls = open(wlist, 'r')
73+
74+
with executor(max_workers=int(threads)) as exe:
75+
[exe.submit(check, out, url.strip('\n')) for url in urls]
76+
77+
78+
79+
80+
if __name__=='__main__':
81+
main()

0 commit comments

Comments
 (0)