telot Posted March 25, 2012 Share Posted March 25, 2012 (edited) Thats right and heres how I did it: opkg update opkg install --dest usb ssmtp Modify /usb/etc/ssmtp/ssmtp.conf with these instructions (for gmail at least). I used the SSL port of 465 instead of 587 for TLS - I dunno, it didn't work with TLS for some reason... ln -s /usb/etc/ssmtp /etc Then echo -e "From: MYEMAIL@MYDOMAIN.COM\nSubject: SUBJECT\nReply-to: MYEMAIL@MYDOMAIN.COM\n\nBODYHERE" | ssmtp -vvv MYOTHEREMAIL@MYDOMAIN.COM And badda boom badda bing, email in my inbox. Why you should care: How about having a cron job to run a script that emails you reports at certain intervals? How about if you're tcpdumping all packets on the pineapple and are waiting for a user to go to their company website and login. Write a script that greps out that URL from urlsnarf.log and emails you so you know to check your capture file How about monitoring your pineapple inconspiciously in public (class, meetings, out to dinner with your wife and inlaws) because all you're doing is innocently checking your email? Thats the big one for me - its just so commonplace to quick take a glance at a new email on your phone. Much more socially acceptable than staring at a pineapple status page that looks well...hackerish with its black background, green and white text...it looks like something a hacker would enjoy...and I do! But with the emailed status you're just checking the latest TPS reports real quick ya know? Hope you all enjoy, I will surely share some scripts for emailing reports once created and hope you do the same EDIT: Command to send urlsnarf log: ssmtp -v user@domain.com < /www/pineapple/urlsnarf.log telot Edited March 29, 2012 by telot Quote Link to comment Share on other sites More sharing options...
DAV Posted March 25, 2012 Share Posted March 25, 2012 Thats right and heres how I did it: opkg update opkg install --dest usb ssmtp Modify /usb/etc/ssmtp/ssmtp.conf with these instructions (for gmail at least). I used the SSL port of 465 instead of 587 for TLS - I dunno, it didn't work with TLS for some reason... ln -s /usb/etc/ssmtp /etc Then echo -e "From: MYEMAIL@MYDOMAIN.COM\nSubject: SUBJECT\nReply-to: MYEMAIL@MYDOMAIN.COM\n\nBODYHERE" | ssmtp -vvv MYOTHEREMAIL@MYDOMAIN.COM And badda boom badda bing, email in my inbox. Why you should care: How about having a cron job to run a script that emails you reports at certain intervals? How about a you're tcpdumping all packets on the pineapple and are waiting for a user to go to their company website and login. Write a script that greps out that URL from urlsnarf.log and emails you so you know to check your capture file How about monitoring your pineapple inconspiciously in public (class, meetings, out to dinner with your wife and inlaws) because all you're doing is innocently checking your email? Thats the big one for me - its just so commonplace to quick take a glance at a new email on your phone. Much more socially acceptable than staring at a pineapple status page that looks well...hackerish with its black background, green and white text...it looks like something a hacker would enjoy...and I do! But with the emailed status you're just checking the latest TPS reports real quick ya know? Hope you all enjoy, I will surely share some scripts for emailing reports once created and hope you do the same telot awesome!! :) good work man! Quote Link to comment Share on other sites More sharing options...
SgtPineapple Posted March 25, 2012 Share Posted March 25, 2012 Very cool indeed!!! Quote Link to comment Share on other sites More sharing options...
Light Posted March 25, 2012 Share Posted March 25, 2012 Nice work! Quote Link to comment Share on other sites More sharing options...
Sebkinne Posted March 25, 2012 Share Posted March 25, 2012 Emailing logs is something we have had in mind for a while now, I think Darren mentioned it a while back. Once we are ready for it there will be a UI implementation for logs being emailed. Good find though! Seb Quote Link to comment Share on other sites More sharing options...
telot Posted March 25, 2012 Author Share Posted March 25, 2012 (edited) Thanks guys! I was hoping this one would be a hit The emailing is working great but I'm having trouble getting bigger log files to go throgh...it seems ssmtp has some size limitations to whatever you're bringing into it. Heres my script that unfortunately fails: #!/bin/bash rm /usb/emaillog.log touch /usb/emaillog.log logread > /usb/emaillog.log ssmtp -v user@domain.com < /usb/emaillog.log The emails come through each time, but for some reason the body of email (where all the logs should be) is blank. If I cat /usb/emaillog.log its got all the latest log data. I try and send any other file it works fine. Such as ssmtp -v user@domain.com < /www/pineapple/associations.log and the list of victims comes through just fine. Any thoughts on this? Unfortunately theres very little documentation on ssmtp, so if anyone has any experience with it, I'd love to hear about it Thanks telot Edited March 25, 2012 by telot Quote Link to comment Share on other sites More sharing options...
blu3nowh3r3 Posted March 28, 2012 Share Posted March 28, 2012 telot your my hero. right up there with darren snubs seb and everyone else here. this is a cool community. Quote Link to comment Share on other sites More sharing options...
telot Posted March 28, 2012 Author Share Posted March 28, 2012 telot your my hero. right up there with darren snubs seb and everyone else here. this is a cool community. If we all give, we all get my friend :) This community is something special no doubt about it telot Quote Link to comment Share on other sites More sharing options...
RebelCork Posted March 28, 2012 Share Posted March 28, 2012 (edited) How big ar the logs? Edited March 28, 2012 by RebelCork Quote Link to comment Share on other sites More sharing options...
PineDominator Posted March 28, 2012 Share Posted March 28, 2012 How big ar the logs? sorry LOL Quote Link to comment Share on other sites More sharing options...
RebelCork Posted March 28, 2012 Share Posted March 28, 2012 sorry LOL I am asking a genuine question. I was thinking something similar, using a cron job to rotate the logs and email them at regular intervals, ie, have 13 rotating logfiles, each rotating at 5 min intervals, and the sendmail sending out every hour. My other option would have been a netcat type I wanted to do that instead of leaving it on the usb card I havent used linux since i was in university! Give a 'newbie' some credit, I'm only thinking out loud ! :) Quote Link to comment Share on other sites More sharing options...
PineDominator Posted March 28, 2012 Share Posted March 28, 2012 I am asking a genuine question. I was thinking something similar, using a cron job to rotate the logs and email them at regular intervals, ie, have 13 rotating logfiles, each rotating at 5 min intervals, and the sendmail sending out every hour. My other option would have been a netcat type I wanted to do that instead of leaving it on the usb card I havent used linux since i was in university! Give a 'newbie' some credit, I'm only thinking out loud ! :) do you mean sending the logs then clearing them so to free up memory and making the pineapple potentially last for days or weeks? I think having them also saved to usb would be a good idea I like your idea of netcat because I don't use 3G and would like a way to get the logs through a ssh session or maybe an app? Quote Link to comment Share on other sites More sharing options...
RebelCork Posted March 28, 2012 Share Posted March 28, 2012 do you mean sending the logs then clearing them so to free up memory and making the pineapple potentially last for days or weeks? I think having them also saved to usb would be a good idea I like your idea of netcat because I don't use 3G and would like a way to get the logs through a ssh session or maybe an app? Send them to free up space. I was thinking of sending them into tcpdump/snort to see packets and initiate logs. I love the idea of being able to get an hourly report for example, and see what kind of data has gone through. It'll be my Easter project to get some sort of automated sniffer going, and hell maybe fit that into a module (even a basic one) Quote Link to comment Share on other sites More sharing options...
ptrac3 Posted March 29, 2012 Share Posted March 29, 2012 Thx for sharing Telot, it's awesome! : ) Quote Link to comment Share on other sites More sharing options...
telot Posted March 29, 2012 Author Share Posted March 29, 2012 Thx for sharing Telot, it's awesome! : ) You're quite welcome Send them to free up space.I was thinking of sending them into tcpdump/snort to see packets and initiate logs. I love the idea of being able to get an hourly report for example, and see what kind of data has gone through. It'll be my Easter project to get some sort of automated sniffer going, and hell maybe fit that into a module (even a basic one) This would be a great implementation! Thats exactly how I want to run it as well - hourly reports would be just about right. I've been swamped at work so I haven't been able to write it all out, but if you want to do it over easter, please share! telot Quote Link to comment Share on other sites More sharing options...
vtecone Posted September 28, 2013 Share Posted September 28, 2013 (edited) Hi ssmtp cannot send attachments try the line below echo -e "to: email@domain.com\nsubject: subject\n"| (cat - /usb/emaillog.log) | ssmtp email@domain.com #!/bin/bash rm /usb/emaillog.log touch /usb/emaillog.log logread > /usb/emaillog.log echo -e "to: email@domain.com\nsubject: subject\n"| (cat - /usb/emaillog.log) | ssmtp email@domain.comm Edited September 28, 2013 by vtecone Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.