summaryrefslogtreecommitdiffstats
path: root/.graveyard/noise/modules/sendmail
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2013-12-09 22:04:23 +0100
committermakefu <github@syntax-fehler.de>2013-12-09 22:04:23 +0100
commit6755676db22c82806763f19e7654c2f7c03279c2 (patch)
tree8317c4c9d67b776681e3005a91bd0548d0e7d8db /.graveyard/noise/modules/sendmail
parent1a49b2e844a733812be1de8fc76af1a4c2ec5f0e (diff)
parentf4f5b3b7aff2ac45ee035f54d6e8899ff963d133 (diff)
Merge branch 'master' of github.com:krebscode/painload
Diffstat (limited to '.graveyard/noise/modules/sendmail')
-rwxr-xr-x.graveyard/noise/modules/sendmail55
1 files changed, 55 insertions, 0 deletions
diff --git a/.graveyard/noise/modules/sendmail b/.graveyard/noise/modules/sendmail
new file mode 100755
index 00000000..182d96e3
--- /dev/null
+++ b/.graveyard/noise/modules/sendmail
@@ -0,0 +1,55 @@
+#!/usr/bin/python
+import os,sys,smtplib,string
+'''
+ Mail Plugin for the noise telnet suite
+ See: http://docs.python.org/library/smtplib.html
+ Author: Felix
+'''
+
+# help
+if len(sys.argv) == 2:
+ if sys.argv[1] == "--help":
+ print "send an e-mail ( \"TO(s)\" \"SUBJECT\" [string instead of EOF])"
+ sys.exit(0)
+
+# sanity
+if len(sys.argv) <= 2:
+ print "wrong number of parameters, see help"
+ sys.exit(1)
+
+# write variables
+# check of EOF
+if len(sys.argv) == 4 :
+ EOFstring="%s\n"% sys.argv[3]
+else:
+ EOFstring="EOF\n"
+
+fromaddr=u"Karl Koch<shockspasm@googlemail.com>"
+toaddrs=sys.argv[1]
+subject=sys.argv[2]
+
+
+#write header:
+msg = u"From: %s\r\nTo: %s\r\nSubject: %s\r\n\r\n" % (fromaddr, toaddrs,subject)
+print "Write your text now, finish with %s" % EOFstring
+sys.stdout.flush() # flushing is important to make sure the line is written
+
+while 1:
+ try:
+ line = sys.stdin.readline()
+ if line == EOFstring:
+ break
+ msg = msg + line
+ except EOFError:
+ break
+
+msg = msg + "[!] Written with NOISE telnet"
+
+print "Thank you for your message! Delivering it now..."
+sys.stdout.flush()
+server = smtplib.SMTP('localhost')
+#server.set_debuglevel(1)
+server.sendmail(fromaddr,toaddrs.split(','),msg)
+server.quit()
+print "mail send successfully"
+sys.exit(0)