-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHercules.py
164 lines (135 loc) · 6.82 KB
/
Hercules.py
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
import sys, time, requests
class color:
end = '\033[0m'
bold = '\033[1m'
Spartan = '\033[38;5;196m'
quotecolor = '\033[38;5;226m'
blue = '\033[38;5;33m'
green = '\033[38;5;40m'
banner = color.bold + color.Spartan + """
..^!?Y5PGGBGGGP5~ .:..
. P&@@@@@@@@@@@@@@@@~J@@@@&B57^.
.7B@#.&@@@@@@@@@@@@@@@@&&@@@@@@@@@@@#Y:
^G@@@@@G#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&J
~#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&P7:
^#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@B7.
P@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#7.
.&@@@@@@@@@@@@@@@@&#BBBBB###BBBBBBB&@@5:
:@@@@@@@@@@@@@@@&#&&@@@@@@@@@@@@@@@&&7
.&@@@@@@@@@@@@@&&@@@@@@@@@@@@@@@@@@@@&
P@@@@@@@@@@@@@@@@@@@&#GPPGGGGPPPPG#&&.
.&@@@@@@@@@@@@@@@@&GPG#&@@@@@@@@@&#P?:
.Y#@@@@@@@@@@@@@&G#@@@@@@@@@@@@@@@@@@@#!.7B
J@@@@@@@@@@@@@@B&@@@@@@@@@@@@@@@@@@@@@@@@@@.
J@@@@@@@@@@@@@B@@@@@@@@@@@@@@@@@@@@@@@@@@@@~
~@@@@@@@@@@@@#@@@@@@@@@@@@@@@@@@@&@@@@@@@@@J
.@@@@@@@@@@@@&@@@@@@@@@@@@@@@&&@@@@@@@@@@@@B
JG&@@@@@&?!~G@@@@@@@@@@&&&@@@@@@@@@@@@@@@@&
.&@@@@@? ~@@@@&&&&&@@@@@@@@@@@@@@@@@@@@@:
.@@@@#. ?@@@@@@@@@@@@@@@@@@@@@5B#B&@@@@7
^@@G G@@@@@@@@@@@@@@@@@@@?P@&7^^~Y@G
^# .@@@@@@&&&&@@@@@@@@@&#GPGPPP~7&
^@@@@@@@7J@@@@@@@@@@@@@@&#G^7@.
.@@@@@@? &@@@@@@@@@@@@@@@@5?@^
.B@@@@@! Y@@@@@@@@@@@@@@@@B~@7
.J@@@@@5. B@@@@@@@@@@@@@@@@&7#:
.J55J^ .#@@@@@@@@@@@@@@@@&?@~
.7B@@@@@@@@@@@@@@!@P
.!G@@@@@@@@@@@7&@
.~G&@@@@@@@BJ@P
^Y#@@@@@5G@P
.7B&@@BG&5
:7P?
""" + color.end
for char in banner:
sys.stdout.write(char)
sys.stdout.flush()
time.sleep(0.000001)
print(f"{color.quotecolor}Discovering secrets with Hercules.{color.end}".center(125))
def log(i, msg):
if i == "*":
print(f"{color.blue}[*]{color.end} {msg}")
elif i == "+":
print(f"{color.green}[+]{color.end} {msg}")
elif i == "-":
print(f"{color.Spartan}[-]{color.end} {msg}")
elif i == "!":
print(f"{color.bold}[!]{color.end} {msg}")
url = input(f"\n{color.bold}Enter the URL of the website you want to scan: {color.end}")
if not url.startswith("http://") and not url.startswith("https://"):
url = "http://" + url
try:
requests.get(url)
except:
log("-", "Invalid URL")
exit()
log("*", "URL is valid")
log("*", "Starting to scan for endpoints\n")
endpoints = open("endpoints.txt", "r").read().splitlines()
foundendpoints = []
notfoundendpoints = []
for endpoint in endpoints:
try:
r = requests.get(url + endpoint)
if "404" or "Not Found" in r.text:
log("-", f"Endpoint {url + endpoint} not found")
notfoundendpoints.append(url + endpoint)
else:
log("+", f"Found endpoint {url + endpoint}")
foundendpoints.append(url + endpoint)
except KeyboardInterrupt:
log("+", "Exiting")
exit()
except:
log("-", f"Endpoint {url + endpoint} not found")
notfoundendpoints.append(url + endpoint)
log("*", "Starting to scan for params\n")
params = open("params.txt", "r").read().splitlines()
foundparams = []
notfoundparams = []
for param in params:
try:
r = requests.get(url + "?" + param)
if "404" or "Not Found" in r.text:
log("-", f"Param {param} not found")
notfoundparams.append(param)
else:
log("+", f"Found param {param}")
foundparams.append(param)
except KeyboardInterrupt:
log("+", "Exiting")
exit()
except:
log("-", f"Param {param} not found")
notfoundparams.append(param)
log("*", "Done scanning\n")
print(f"{color.bold}Found endpoints:{color.end}")
for endpoint in foundendpoints:
print(f"{color.green}[+]{color.end} {endpoint}")
print(f"{color.bold}\nNot found endpoints:{color.end}")
for endpoint in notfoundendpoints:
print(f"{color.Spartan}[-]{color.end} {endpoint}")
print(f"{color.bold}\nFound params:{color.end}")
for param in foundparams:
print(f"{color.green}[+]{color.end} {param}")
print(f"{color.bold}\nNot found params:{color.end}")
for param in notfoundparams:
print(f"{color.Spartan}[-]{color.end} {param}")
asktosave = input(f"{color.bold}\nDo you want to save the results? (y/n): {color.end}")
if asktosave == "y":
foldername = url
with open(foldername + "/Found Endpoints.txt", "w") as f:
for endpoint in foundendpoints:
f.write(endpoint + "\n")
with open(foldername + "/Not Found Endpoints.txt", "w") as f:
for endpoint in notfoundendpoints:
f.write(endpoint + "\n")
with open(foldername + "/Found Params.txt", "w") as f:
for param in foundparams:
f.write(param + "\n")
with open(foldername + "/Not Found Params.txt", "w") as f:
for param in notfoundparams:
f.write(param + "\n")
log("+", "Saved results")
log("+", "Exiting")
exit()