Advertisement
repente

Untitled

Jul 25th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.87 KB | None | 0 0
  1. import configparser
  2. import requests
  3. import urllib.request
  4. import urllib3
  5. import os
  6. import string
  7. import time
  8. import random
  9. import json
  10. urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
  11. requests.packages.urllib3.disable_warnings()
  12. user_agents = (
  13. 'Mozilla/5.0 (Windows NT 6.0; rv:2.0) Gecko/20100101 Firefox/4.0 Opera 12.14',
  14. 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:58.0) Gecko/20100101 Firefox/58.0',
  15. 'Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US) AppleWebKit/532.9 (KHTML, like Gecko) Chrome/5.0.310.0 Safari/532.9',
  16. 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1) Gecko/20090624 Firefox/3.5',
  17. 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:16.0) Gecko/20120813 Firefox/16.0',
  18. 'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US) AppleWebKit/125.4 (KHTML, like Gecko, Safari) OmniWeb/v563.15',
  19. 'Opera/9.0 (Macintosh; PPC Mac OS X; U; en)',
  20. 'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; fr-fr) AppleWebKit/312.5 (KHTML, like Gecko) Safari/312.3',
  21. 'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.9) Gecko/20100915 Gentoo Firefox/3.6.9',
  22. 'Mozilla/5.0 (X11; U; Linux; i686; en-US; rv:1.6) Gecko Galeon/1.3.14',
  23. 'Mozilla/5.0 (X11; U; Linux ppc; en-US; rv:1.8.1.13) Gecko/20080313 Iceape/1.1.9 (Debian-1.1.9-5)',
  24. 'Mozilla/5.0 (X11; U; Linux i686; pt-PT; rv:1.9.2.3) Gecko/20100402 Iceweasel/3.6.3 (like Firefox/3.6.3) GTB7.0',
  25. 'Mozilla/5.0 (X11; Linux x86_64; rv:5.0) Gecko/20100101 Firefox/5.0 Iceweasel/5.0',
  26. 'Konqueror/3.0-rc4; (Konqueror/3.0-rc4; i686 Linux;;datecode)',
  27. 'Mozilla/5.0 (X11; Linux x86_64; en-US; rv:2.0b2pre) Gecko/20100712 Minefield/4.0b2pre',
  28. 'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.17) Gecko/20110123 SeaMonkey/2.0.12',
  29. 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1) Gecko/20061024 Firefox/2.0 (Swiftfox)',
  30. 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.9 Safari/536.5',
  31. 'Mozilla/5.0 (X11; CrOS i686 2268.111.0) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.57 Safari/536.11',
  32. 'Mozilla/4.0 (compatible; Dillo 3.0)',
  33. 'Mozilla/5.0 (X11; U; Linux i686; en-us) AppleWebKit/528.5 (KHTML, like Gecko, Safari/528.5 ) lt-GtkLauncher',
  34. 'Midori/0.1.10 (X11; Linux i686; U; en-us) WebKit/(531).(2)',
  35. 'Mozilla/4.8 [en] (X11; U; SunOS; 5.7 sun4u)',
  36. 'Mozilla/5.0 (Unknown; U; UNIX BSD/SYSV system; C -) AppleWebKit/527 (KHTML, like Gecko, Safari/419.3) Arora/0.10.2',
  37. 'Opera/9.51 Beta (Microsoft Windows; PPC; Opera Mobi/1718; U; en)',
  38. 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.6 (KHTML, like Gecko) Chrome/20.0.1092.0 Safari/536.6',
  39. 'Mozilla/5.0 (Windows NT 6.2) AppleWebKit/536.6 (KHTML, like Gecko) Chrome/20.0.1090.0 Safari/536.6',
  40. 'Mozilla/5.0 (Windows; U; Windows NT 6.0 x64; en-US; rv:1.9pre) Gecko/2008072421 Minefield/3.0.2pre',
  41. 'Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:2.0.1) Gecko/20100101 Firefox/4.0.1',
  42. 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:6.0a2) Gecko/20110622 Firefox/6.0a2',
  43. 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:7.0.1) Gecko/20100101 Firefox/7.0.1',
  44. 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0b4pre) Gecko/20100815 Minefield/4.0b4pre',
  45. )
  46.  
  47.  
  48. # --------------------------------------------------------------------------------------------------
  49. def getConfig(path):
  50. config = configparser.ConfigParser()
  51. config.read(path, encoding='utf-8')
  52. return config
  53. # --------------------------------------------------------------------------------------------------
  54. def get_setting(path, section, setting):
  55. config = getConfig(path)
  56. value = config.get(section, setting)
  57. return value
  58. # --------------------------------------------------------------------------------------------------
  59. def setlanguage(language):
  60. language_rus = ['Эй, поддержи наш фонд борьбы со скамерами ^_^', 'Подписывайся на нашу группу в Steam!', 'Введите Request URL: ', 'Некорректный URL, введите еще раз.', 'Версия вашей программы устарела. Скачайте новую версию!', 'Введите кол-во запросов: ', 'Успешно отправлено!', 'Ошибка! Запрос не отправлен.', 'Проверьте входные данные и сайт скаммера, либо обратитесь за помощью к разработчику. Telegram: @straume']
  61. language_eng = ['Hey bro, support our Fund to fight scammers ^_^', 'Subscribe to our group on Steam!', 'Enter Request URL: ', 'Incorrect URL, please try again.', 'The version of your program is outdated. Download the new version!', 'Enter the number of requests: ', 'Successfully sent!', 'ERROR! The request is not sent.', 'Check the input data and scammers website, or contact the developer for help. Telegram: @straume']
  62. while True:
  63. if language == 'rus':
  64. return language_rus
  65. elif language == 'eng':
  66. return language_eng
  67. print('Translation into English may be of poor quality!')
  68. else:
  69. print('ERROR: Incorrect language in config.conf')
  70. print('Enter a new value:')
  71. language = input()
  72. continue
  73. # --------------------------------------------------------------------------------------------------
  74. def readserver():
  75. try:
  76. r = urllib.request.urlopen('https://rocketleague-planet.info/response.json').read()
  77. return results_response
  78. except:
  79. return None
  80. # --------------------------------------------------------------------------------------------------
  81. def main(random_log_pass, database, request_delay, scammer_response, request_url, n, list_language, user_agents):
  82. #Чтение всех вайлов в папке config и их срощение. Создание универсального field словаря.
  83. DIRECTORY, field, n_response = 'config/', {}, 0
  84. list_configs = os.listdir(DIRECTORY)
  85. for i in list_configs:
  86. chech = {}
  87. chech = creater_dict('config/{0}'.format(i))
  88. field.update(chech)
  89. #Создаем header и добавляем куки из кортежа
  90. header = {'accept': '*/*'}
  91. with open('base.txt', 'r') as base:
  92. while n >= n_response:
  93. for user_agent, data_acc in zip(user_agents, base):
  94. header['user-agent'] = user_agent
  95. response = start_spam(header, field, request_url, random_log_pass, database, data_acc, scammer_response)
  96. if str(response) in '<Response [200]>' and not scammer_response:
  97. print('Response [200] {0} №{1}'.format(list_language[6], n_response))
  98. elif not str(response) in '<Response [200]>' and not scammer_response:
  99. print('{} {} №{}'.format(response, list_language[7], n_response))
  100. print(list_language[8])
  101. else:
  102. print('Sent! ', n_response)
  103. n_response += 1
  104. time.sleep(int(request_delay))
  105.  
  106. # --------------------------------------------------------------------------------------------------
  107. def request(field, header, url, scammer_response=False):
  108. if scammer_response:
  109. requests.post(url, data=field, headers=header, verify=False, timeout=1)
  110. response = None
  111. else:
  112. response = requests.post(url, data=field, headers=header, verify=False)
  113. return response
  114. # --------------------------------------------------------------------------------------------------
  115. def creater_dict(name_file):
  116. with open(name_file, 'r') as file:
  117. results_dict = {}
  118. for line in file:
  119. line = str(line)
  120. list_arg = [i.rstrip() for i in line.split(': ')]
  121. results_dict[list_arg[0]] = list_arg[1]
  122. return results_dict
  123. # --------------------------------------------------------------------------------------------------
  124. def start_spam(header, field, request_url, random_log_pass, database, data_acc, scammer_response):
  125. if random_log_pass:
  126. for i in field:
  127. field[i] = randompassword()
  128. if database:
  129. login, password = data_acc.split(':')
  130. field['username'], field['name'] = login, login
  131. field['password'] = password
  132. if scammer_response:
  133. response = request(field, header, request_url, scammer_response=True)
  134. else:
  135. response = request(field, header, request_url)
  136. return response
  137.  
  138. # --------------------------------------------------------------------------------------------------
  139. def randompassword():
  140. chars=string.ascii_uppercase + string.ascii_lowercase + string.digits
  141. size=4
  142. return ''.join(random.choice(chars) for x in range(size,16))
  143. #Проверка всех основных компонентов
  144. if __name__ == '__main__':
  145. #Чтение файлов из config.conf
  146. _config_file = 'config.conf'
  147. _config_section = 'Scammer Killer'
  148. try:
  149. language = get_setting(_config_file, _config_section, "language")
  150. random_log_pass = eval(get_setting(_config_file, _config_section, "random"))
  151. database = eval(get_setting(_config_file, _config_section, "database"))
  152. request_delay = get_setting(_config_file, _config_section, "request_delay")
  153. scammer_response = eval(get_setting(_config_file, _config_section, "scammer_response"))
  154. except:
  155. print('An error occurred while reading the config.conf\nCheck the entered data and try again!')
  156. while True:
  157. input()
  158. #Подключение к серверу, проверка версии.
  159. list_language = setlanguage(language)
  160. response_my_server = readserver()
  161. if response_my_server == None:
  162. print(list_language[4])
  163. print('Telegram: @straume')
  164. while True:
  165. input()
  166. if not(response_my_server['massange'] == None):
  167. print(response_my_server['massange'])
  168. #Данаты и группа
  169. print('{0} PayPal:{1}'.format(list_language[0], 'https://www.paypal.me/rocketleaguetrading'))
  170. print('{0} {1}'.format(list_language[1], 'https://steamcommunity.com/groups/rl_trading_offical'))
  171. #Получение request_url и проверка
  172. while True:
  173. request_url = input(list_language[2])
  174. try:
  175. requests.post(request_url, verify=False)
  176. break
  177. except:
  178. print(list_language[3])
  179. n = int(input(list_language[5]))
  180. #Проверяем request_url
  181. if request_url in response_my_server['url_list']:
  182. print(' File "py.py", line 171, in <module>')
  183. print(' Bad request: <Response [502]> forbidden')
  184. print('__Error__')
  185. while True:
  186. input()
  187. main(random_log_pass, database, request_delay, scammer_response, request_url, n, list_language, user_agents)
  188.  
  189. print('ok')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement