Hack Forums
[Python] [HELP]Python smtplib. - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [Python] [HELP]Python smtplib. (/showthread.php?tid=5471796)



[HELP]Python smtplib. - Malicious Intent - Nov 22, 2016

Hey Folks.

I'm trying to write a simple mail spoof tool but I'm stuck in one place.
The code works and can send mail but due to some sort of filter every time i try to pass anything that contains "@" as a 'from' google and yahoo are changing the header to the original email or nothing.

Below is the snippet from my code.

Code
spoof= '[email protected]'
msg = 'From:'+spoof + '\nSubject: ' + subject + '\n' + body
     server.sendmail(user,to,msg)

This is the format of the email. Variable spoof is the spoofed email. If i use a name or anything else that doesn't include @ it works. Also if i pass something like [[email protected]] it will work but then email will show up in this form in the mailbox.
Can anyone point me in the right direction? How to escape these characters or how to trick email provider into displaying it correctly. Maybe some encoding? Any and all help appreciated.

Edit: I'v tried yagmail module already. It is very simple to implement but suffers from the same issue.


* - Goodies - Nov 22, 2016

Immediately, I can recognize that is not how SMTP is supposed to be formatted.

Take 2 seconds to check the RFC:
https://tools.ietf.org/html/rfc5321#section-2.3.8


* - Malicious Intent - Nov 22, 2016

(Nov 22, 2016 03:17 PM)Goodies Wrote:  Immediately, I can recognize that is not how SMTP is supposed to be formatted.

Take 2 seconds to check the RFC:
https://tools.ietf.org/html/rfc5321#section-2.3.8

Thanks Goodies!! I would marry you if you were a woman! lol Thanks to your advice i figured it out.


* - Goodies - Nov 22, 2016

(Nov 22, 2016 03:48 PM)michypc Wrote:  Thanks Goodies!! I would marry you if you were a woman! lol Thanks to your advice i figured it out.

Glad I could help 🤝