TempMailServer.py 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #!/usr/bin/python3
  2. print("==================================================================")
  3. print(" Welcome ! to ! Temp Mail ! Service ! ")
  4. print(" Don't misuse this script other then for pentesting purpose ")
  5. print(" This script written on Python 3 modules ")
  6. print(" Author:anonmech ")
  7. print("==================================================================")
  8. from urllib.request import urlopen
  9. from bs4 import BeautifulSoup
  10. import requests
  11. session = requests.Session()
  12. ht=session.get("https://temp-mail.org/en/option/change")
  13. bs=BeautifulSoup(ht.text,'html.parser')
  14. #print("Cookie is set to:")
  15. #print(ht.cookies.get_dict())
  16. for link in bs.findAll("input",{"name":"csrf"}):
  17. if 'name' in link.attrs:
  18. token=link.attrs['value']
  19. print("Csrf token is ",token)
  20. else:
  21. print("somethings went wrong")
  22. mail_id=input("Choose Your Mail ID:")
  23. print("@polyfaust.com\n@cartelera.org")
  24. domain_name=input("Choose Your Mail Domain:")
  25. params={"csrf":token,"mail":mail_id,"domain":domain_name}
  26. r=session.post("https://temp-mail.org/en/option/change",params)
  27. bs=BeautifulSoup(r.text,'html.parser')
  28. for link in bs.findAll("button",{"data-dismiss":"alert"}):
  29. if 'data-dismiss' in link.attrs:
  30. print("The mail address is successfully created!")
  31. print("your mail id is" +mail_id+domain_name)
  32. else:
  33. print("somethings went wrong")
  34. receive=input("if you read to recieve mail then press enter")
  35. ht=session.get("https://temp-mail.org/en/")
  36. bs=BeautifulSoup(ht.text,'html.parser')
  37. for link in bs.findAll("a",{"title":"Tenable Nessus Home Activation Code"}):
  38. if 'title' in link.attrs:
  39. url=link.attrs['href']
  40. print(url)
  41. else:
  42. print("somethings went wrong")
  43. url1=str(url)
  44. ht=session.get(url1)
  45. bs=BeautifulSoup(ht.text,'html.parser')
  46. message=bs.findAll("div",{"data-x-div-type":"body"})
  47. for msg in message:
  48. print(msg.get_text())