Skip to content

Instantly share code, notes, and snippets.

@alxrogan
Created October 4, 2011 15:07
Show Gist options
  • Save alxrogan/1261891 to your computer and use it in GitHub Desktop.
Save alxrogan/1261891 to your computer and use it in GitHub Desktop.
simple nc script to spoof smtp
#!/bin/bash
#pass the SMTP server as the only argument, modify the port below if needed
( echo HELO foo.bar
sleep 2
echo MAIL FROM: \<[email protected]\>
sleep 2
echo RCPT TO: \<[email protected]\>
sleep 2
echo RCPT TO: \<[email protected]\>
sleep 2
echo DATA
sleep 2
echo Message-ID: \<[email protected]\>
sleep 2
echo From: \<[email protected]\> "The Almighty Foo"
sleep 2
echo To: \<[email protected]\> "the underlings"
sleep 2
echo Subject: You cannot stop us
sleep 2
echo Date: Thu, 2 Dec 2004 00:00:00 -0400
sleep 2
echo Whatever you want this to say
echo End your statement with a single period by itself as below
echo .
echo QUIT ) | nc -v -v -v $1 25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment