Skip to content

Commit a15f1cd

Browse files
author
Atul Kushwaha
committed
using app passowrd
1 parent 822d164 commit a15f1cd

File tree

1 file changed

+41
-73
lines changed

1 file changed

+41
-73
lines changed

email_bomber_python_coderatul.py

Lines changed: 41 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,46 @@
1-
print(' _________________________________ ')
2-
print('< Email-Bomber Author : coderatul >')
3-
print(' --------------------------------- ')
4-
print(' \ ^__^ ')
5-
print(' \ (oo)\_______ ')
6-
print(' (__)\ )\/\ ')
7-
print(' ||----w | ')
8-
print(' || || ')
9-
# we could used multiline strip but it was not preserving cowsay
10-
print()
11-
print(''' source code available at : linktr.ee/programmeratul ''')
12-
print( ''' email bomber v1.0 ''')
13-
print(''' !!!!ALERT !!!!
14-
Before using this script enable less secure app acess
15-
from senders gmail account
16-
you can go here : myaccount.google.com/lesssecureapps
17-
!!! ONLY FOR EDUCATIONAL PURPOSE !!!
18-
''')
19-
print('Author : coderatul')
20-
print('Author is not responsible for any kind of unethical act performed using this script')
21-
print('Visit smtplib documentation to know more about this project : https://docs.python.org/3/library/smtplib.html')
22-
print('Initialising program ..........')
23-
num_count = 0
24-
#importing simple Mail Transfer Protocol(smtp) module
1+
print(
2+
"""
3+
███████╗███╗ ███╗ █████╗ ██╗██╗ ██████╗ ██████╗ ███╗ ███╗██████╗ ███████╗██████╗
4+
██╔════╝████╗ ████║██╔══██╗██║██║ ██╔══██╗██╔═══██╗████╗ ████║██╔══██╗██╔════╝██╔══██╗
5+
█████╗ ██╔████╔██║███████║██║██║ ██████╔╝██║ ██║██╔████╔██║██████╔╝█████╗ ██████╔╝
6+
██╔══╝ ██║╚██╔╝██║██╔══██║██║██║ ██╔══██╗██║ ██║██║╚██╔╝██║██╔══██╗██╔══╝ ██╔══██╗
7+
███████╗██║ ╚═╝ ██║██║ ██║██║███████╗██████╔╝╚██████╔╝██║ ╚═╝ ██║██████╔╝███████╗██║ ██║
8+
╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝╚══════╝╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚═════╝ ╚══════╝╚═╝ ╚═╝
9+
version 1.1 : uses app passowrd now, before it used less secure apps
10+
Author : linktr.ee/coderatul
11+
Before using please read "prerequisite section"
12+
"""
13+
)
14+
from cgitb import text
15+
from email import message
16+
from typing import Text
17+
from getpass4 import getpass
18+
sender = input("Enetr Sender's Gmail Id -> ")
19+
app_password = getpass("Enter App password -> ")
20+
receiver = input("Enter Receiver's Gmail Id -> ")
21+
message = input("Enter Your Message ->")
22+
count = int(input("Enter number of mail's to be sent -> "))
2523
import smtplib
26-
#getting number of mail's to be sent
24+
server = smtplib.SMTP("smtp.gmail.com",587)
25+
server.starttls()
2726
try:
28-
nos = int(input("Enter the number of Mails to be sent : "))
27+
server.login(user= sender,password= app_password)
2928
except:
30-
print("Please enter a valid character(only number!)")
31-
#printing number of mails to be sent
32-
print("Number of mail's to be sent is",nos)
33-
#getting sender's gmail ID from end user
34-
sender_email = input("Enter you gmail/sender's ID : ")
35-
#printing sender's gmail ID
36-
print("Sender's gmail ID is : ",sender_email)
37-
#inputing password for login into smtp server
38-
password = input("Please enter your password : ")
39-
#printing password entered by the end user
40-
print("Sender's gmail ID password is : ",password)
41-
#inputing receivers gamil ID
42-
rec_email = input("Enter receiver's gmail id :")
43-
#printing receiver's gmail ID
44-
print("Receiver's gmail Id is : ",rec_email)
45-
#inputing message from the end user
46-
message = input("Enter your message:")
47-
#printing message to be sent
48-
print('Message to be sent is :',message)
49-
#using for loop for sending desired nos of mails
50-
#using try to check whether info given is correct or not and if not the printing solution
51-
print('Login successfuly !!!')
52-
print('encrytping traffic.....')
53-
try:
54-
for i in range(nos):
55-
#defining email service and port (search smtp port for gmail on google)
56-
server = smtplib.SMTP('smtp.gmail.com', 587)
57-
# starting TLS (TLS protects the transmission of the content of email messages)
58-
server.starttls()
59-
#login
60-
server.login(sender_email, password)
61-
#sending mail finally !!!
62-
server.sendmail(sender_email, rec_email, message)
63-
num_count+= 1
64-
print(num_count,"mail sent")
65-
if nos == num_count:
66-
print(nos,'mails have been sent to',rec_email)
67-
print('!!!script ended !!!')
68-
print('This script is powerful use wisely!!!')
69-
except:
70-
print(''' {{{script Ended}}}
71-
1. The info you entered is incorrect
72-
solution : re - run script and enter info carefully
73-
2. If issue not resolved switch on this :
74-
myaccount.google.com/lesssecureapps
75-
disable 2FA if enabled''')
76-
29+
print("")
30+
print("""check for the following:
31+
1. Read prerequisite section
32+
2. Check app password
33+
3. try again and enter details carefully
34+
""")
35+
else:
36+
for i in range(count):
37+
server.sendmail(from_addr= sender,to_addrs= receiver,msg= message)
38+
if count < 2:
39+
print(count,"mail have been sent to :",receiver)
40+
else:
41+
print(count,"mails have been sent to :",receiver)
42+
server.close()
43+
44+
7745

7846

0 commit comments

Comments
 (0)