-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathemailspoofer.py
48 lines (44 loc) · 2.09 KB
/
emailspoofer.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
from __future__ import print_function
import time
import os
from dotenv import load_dotenv, dotenv_values
load_dotenv()
import sib_api_v3_sdk
from sib_api_v3_sdk.rest import ApiException
from pprint import pprint
import random
# add the argparser to fully fuction the program...
import argparse
parser = argparse.ArgumentParser(description='Mail spoofer and bomber')
parser.add_argument("-f","--file",help='Enter the file path if you want')
parser.add_argument('-n',"--number",help="Enter the amout how may time you want to send the mail",default=1 )
args = parser.parse_args()
# note you need to import to the sib_api_v3_sdk to install this exeute the cmd pip install sib_api_v3_sdk or pip3 install sib_api_v3_sdk
configuration = sib_api_v3_sdk.Configuration()
configuration.api_key['api-key'] = os.getenv("YOUR_KEY")
api_instance = sib_api_v3_sdk.TransactionalEmailsApi(sib_api_v3_sdk.ApiClient(configuration))
s_mail =input("\033[33;1m Enter the subject: ")
subject = s_mail
# now ask for the actual msg
# check if file name is empty
if args.file:
print("file name present")
msg_mail = input("\033[31;1m Enter msg to send: ")
html_content = msg_mail
sender_name = input("\033[32;1m Enter the sender name: ")
sender_email = input("\033[32;1m Enter the sender email: ")
sender = {"name":sender_name,"email":sender_email}
target_name = input("\033[32;1m Enter the target name: ")
target_email = input("\033[31;1m Entet the target email: ")
to = [{"email":target_email,"name":target_name}]
cc = [{"email":"noreplay@pay.com","name":"pay"}]
bcc = [{"name":"sala","email":"example@example.com"}]
reply_to = {"email":"donotreply@domain.com","name":"do_not_reply"}
headers = {"termux-yodha":"unique-id-1234"}
params = {"parameter":"My param value","subject":subject}
send_smtp_email = sib_api_v3_sdk.SendSmtpEmail(to=to, bcc=bcc, cc=cc, reply_to=reply_to, headers=headers, html_content=html_content, sender=sender, subject=subject)
try:
api_response = api_instance.send_transac_email(send_smtp_email)
pprint(api_response)
except ApiException as e:
print("Exception when calling SMTPApi->send_transac_email: %s\n" % e)