Guest User

лиса

a guest
Jan 26th, 2022
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.97 KB | None | 0 0
  1. '''
  2. Гайд по установке
  3. Установленный python 3.7+(если будет время потом скомпилирую,или скомпилируй ты анонче)
  4. потом в терминал
  5. pip install requests
  6. pip install selenium
  7. pip install webdriver-manager
  8.  
  9. Нихуя не надо, просто запускай.
  10.  
  11. Вроде прокси не требуются,ну если возникли проблемы с регой - юзай впн
  12.  
  13. По всем вопросам,багам в тред
  14. КТО БУДЕТ ПИСАТЬ СООБЩЕНИЯ ПО ТИПУ - "КОКОКО ГОВНОКОД","ХРЮХРЮХРЮ ПИТОН";Просьба пойти срать на хабр
  15. Удачного вечера анон!
  16. '''
  17.  
  18. import requests
  19. import string,random,time,re
  20. import warnings
  21. import uuid
  22. from selenium import webdriver
  23. #from webdriver_manager.chrome import ChromeDriverManager
  24. warnings.filterwarnings("ignore")
  25.  
  26. banner = """
  27. +-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+ +-+-+-+-+-+
  28. |O|P|E|R|A|T|I|O|N| |B|L|A|C|K| |M|A|M|B|A|
  29. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  30. |B|y| |A|n|o|n| |f|o|r| |2|c|h|.|h|k|
  31. +-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+
  32. |V|e|r| |1|.|2|b|
  33. +-+-+-+ +-+-+-+-+
  34. """
  35. class Post_shift():
  36.  
  37. postshift_api_hash = ""
  38. mail = {"email":"","key":""}
  39. def __generate_random_string(self,min: int = 12, max: int = 16):
  40. return ''.join(random.choice(string.ascii_lowercase) for i in range(random.randint(min, max)))
  41.  
  42. #не исользуется(защита от дебилов)
  43. def Regestration(self):
  44. try:
  45. resp = requests.get(f"https://post-shift.ru/api.php?action=reg&email={self.__generate_random_string()}@domain.ru")
  46. if resp.status_code != 200:
  47. raise Exception
  48. return True
  49. except Exception as e:
  50. print(f"Ошибка при регистрации на postshift!!!\nЛог:{e}")
  51. return False
  52.  
  53. def CreateMail(self):
  54. try:
  55. # resp = requests.get(f"https://post-shift.ru/api.php?action=new&hash={self.postshift_api_hash}")
  56. resp = requests.post(f"https://api.mail.tm/accounts")
  57. if resp.status_code != 200:
  58. raise Exception
  59. resp = resp.json()
  60. self.mail["email"] = resp["email"]
  61. self.mail["key"] = resp["key"]
  62. return True
  63. except Exception as e:
  64. print(f"Ошибка при получении ящика!!!\nЛог:{e}")
  65. return False
  66.  
  67. def Clear(self):
  68. try:
  69. resp = requests.get(f"https://post-shift.ru/api.php?action=deleteall")
  70. if resp.status_code != 200:
  71. raise Exception
  72. return True
  73. except Exception as e:
  74. print(f"Ошибка при Удалении ящиков!!!\nЛог:{e}")
  75. return False
  76.  
  77. def getEmailMessage(self, token):
  78. resp = requests.get('https://api.mail.tm/messages', headers={'Authorization': 'Bearer ' + token})
  79. if resp.status_code != 200:
  80. raise Exception
  81. emails = resp.json()['hydra:member']
  82. if len(emails) != 0:
  83. id = emails[0]['id']
  84. resp = requests.get('https://api.mail.tm/messages/' + id, headers={'Authorization': 'Bearer ' + token})
  85. if resp.status_code != 200:
  86. raise Exception
  87. return resp.json()['html'][0]
  88. return None
  89.  
  90.  
  91. def GetEmailList(self):
  92. try:
  93. resp = requests.get(f"https://post-shift.ru/api.php?action=getlist&hash={self.postshift_api_hash}&key={self.mail['key']}")
  94. if resp.status_code != 200:
  95. raise Exception
  96. return resp.json()
  97. except Exception as e:
  98. print(f"Ошибка при Получении списка сообщений!!!\nЛог:{e}")
  99. return None
  100.  
  101. def GetEmailText(self):
  102. try:
  103. resp = requests.get(f"https://post-shift.ru/api.php?action=getmail&hash={self.postshift_api_hash}&key={self.mail['key']}&id=1")
  104. if resp.status_code != 200:
  105. raise Exception
  106. return resp.json()
  107. except Exception as e:
  108. print(f"Ошибка при Получении списка сообщений!!!\nЛог:{e}")
  109. return None
  110. def __init__(self,hash):
  111. self.postshift_api_hash=hash
  112. def ExtractPwd(message):
  113. match = re.search(r'href=[\'"]?([^\'" >]+)', message)
  114. if match:
  115. return match.group(0).replace('href="',"")
  116. else:
  117. return None
  118.  
  119. def GenPassword(min: int = 20, max: int = 20):
  120. pwd = ""
  121. special_list = ["!","@","#","$","%"]
  122. pwd += ''.join(random.choice(string.ascii_uppercase) for i in range(5))
  123. pwd += ''.join(random.choice(string.ascii_lowercase) for i in range(5))
  124. pwd += ''.join(random.choice(string.digits) for i in range(5))
  125. pwd += ''.join(random.choice(special_list) for i in range(5))
  126. return ''.join(random.sample(pwd,len(pwd)))
  127.  
  128. def main():
  129. itter = 0
  130. print(banner)
  131. # apihash = input("Ввдите api ключ от post shift: ")
  132. apihash = '542524'
  133. # if len(apihash) != 32:
  134. # print("Неверный api hash!")
  135. # return 0
  136. while True:
  137. try:
  138. login = uuid.uuid4().hex.replace('-', '-')
  139. resp = requests.post(f"https://api.mail.tm/accounts", json={"address": login + "@sinaite.net",
  140. "password": "2@k6O8iJ"})
  141. if resp.status_code != 201:
  142. raise Exception
  143. email = resp.json()['address']
  144.  
  145. resp = requests.post(f"https://api.mail.tm/token", json={"address": email,
  146. "password": "2@k6O8iJ"})
  147. if resp.status_code != 200:
  148. raise Exception
  149. token = resp.json()['token']
  150.  
  151. resp = requests.get('https://api.mail.tm/messages', headers={'Authorization': 'Bearer ' + token})
  152. if resp.status_code != 200:
  153. raise Exception
  154.  
  155. a = Post_shift(apihash)
  156. #options = webdriver.ChromeOptions()
  157. #options.add_extension('./ub.crx')
  158.  
  159. #driver = webdriver.Chrome(ChromeDriverManager().install(), options=options)
  160. driver = webdriver.Firefox()
  161. driver.install_addon('D:\\ublock_origin-1.40.8-an+fx.xpi', temporary=True)
  162. driver.implicitly_wait(5)
  163. driver.get("https://63.ru/text/education/2022/01/25/70386878/")
  164. try:
  165. driver.find_element_by_xpath('//*[@id="onesignal-slidedown-cancel-button"]').click()
  166. except:
  167. print()
  168.  
  169. driver.find_element_by_xpath('//*[@id="app"]/div[2]/header/div[1]/div[2]/a').click()
  170. driver.find_element_by_xpath('//*[@id="app"]/div[2]/div[3]/div/div/div[2]/div/form/div[3]/button').click()
  171. a.Clear()
  172. # a.Regestration()
  173. a.CreateMail()
  174. # driver.find_element_by_xpath('//*[@id="register_login"]').send_keys(a.mail['email'])
  175. driver.find_element_by_xpath('//*[@id="register_login"]').send_keys(email)
  176. driver.find_element_by_xpath('//*[@id="register_password"]').send_keys(GenPassword())
  177. driver.find_element_by_xpath('//*[@id="app"]/div[2]/div[4]/div/div/div[2]/div/form/button').click()
  178. print(f"Мыло: {email}")
  179. while True:
  180. time.sleep(1)
  181.  
  182. message = a.getEmailMessage(token)
  183. if message is not None:
  184. break
  185.  
  186. # respmails = a.GetEmailList()
  187. # if type(respmails) == list:
  188. # if respmails[0]["subject"] == "Регистрация на сайтах Сети городских порталов и Fontanka.ru":
  189. # break
  190. # else:
  191. # print("Ошибка письма!!!")
  192. # return 0
  193. print("Ожидаю письмо")
  194. driver.get(ExtractPwd(message))
  195. driver.get("https://63.ru/text/education/2022/01/25/70386878/")
  196. driver.find_element_by_xpath(
  197. '//*[@id="app"]/div[2]/div[1]/div/div/div[3]/div[2]/div[1]/div[1]/div[1]/div/div[2]/div[21]/div[2]/div[7]/div[2]/div[2]/div/button').click()
  198. driver.close()
  199. itter += 1
  200. print(f"Успешно!!!Итерация:{itter}")
  201. except Exception as e:
  202. print("shhiiet: " + str(e))
  203. if driver is not None:
  204. try:
  205. driver.close()
  206. except:
  207. print("sssssshhhhhhhhieeet")
  208. finally:
  209. time.sleep(5)
  210.  
  211. if __name__ == '__main__':
  212.  
  213. main()
Add Comment
Please, Sign In to add comment