BryceThomas Posted July 28, 2012 Share Posted July 28, 2012 I am trying to launch tcpdump on boot by editing the rc.local script through the Pineapple web interface. I am doing this because I want to be able to simply plug the Pineapple in and have it start collecting packets. My rc.local script is as follows: wifi hostapd_cli -p /var/run/hostapd-phy0 karma_disable #Don't touch anything above this line CAPTURE_DIRECTORY="/usb/" CAPTURE_DIRECTORY_DISK_USAGE=$(du -s $CAPTURE_DIRECTORY | awk '{print $1}') TCPDUMP_FILE_PREFIX=${CAPTURE_DIRECTORY}${CAPTURE_DIRECTORY_DISK_USAGE}$(echo ".pcap") airmon-ng stop mon0.wlan0 airmon-ng start wlan0 tcpdump -i mon0 -n -C 10 -w $TCPDUMP_FILE_PREFIX #Add your commands above this exit 0 This is not working. In the logs I see this: 00:01:01 Pineapple user.info sysinit: /etc/rc.local: line 10: tcpdump: not found I take it this means tcpdump is not yet available at the time the boot script runs (I have run tcpdump from ssh OK). Can anyone suggest a way around this, or some other way I can achieve effectively the same outcome of capturing packets in monitor mode on boot? Quote Link to comment Share on other sites More sharing options...
telot Posted July 28, 2012 Share Posted July 28, 2012 I ran into this same problem with tcpdump...the way I got around it is to bind my tcpdump script to the wps button press. This may not be ideal for you, but works for my situation (where I am nearby my pineapple whenever I boot it - I don't have it stashed out of sight anywhere). Perhaps Seb can chime in with info on rc.local and any available alternatives? telot Quote Link to comment Share on other sites More sharing options...
Molotof Posted July 28, 2012 Share Posted July 28, 2012 Add your stuff in a .sh file and chmod +x it plus a sleep 20 and put the file somewhere not on the usb. So as you said earlier : #!/bin/sh sleep 20 # makes it work CAPTURE_DIRECTORY="/usb/" CAPTURE_DIRECTORY_DISK_USAGE=$(du -s $CAPTURE_DIRECTORY | awk '{print $1}') TCPDUMP_FILE_PREFIX=${CAPTURE_DIRECTORY}${CAPTURE_DIRECTORY_DISK_USAGE}$(echo ".pcap") airmon-ng stop mon0.wlan0 airmon-ng start wlan0 tcpdump -i mon0 -n -C 10 -w $TCPDUMP_FILE_PREFIX # save it to tcpdump.sh And then run it in rc.local as: /whatever/tcpdump.sh & Can you tell me why did you stop mon0.wlan0 at start-up ????? Quote Link to comment Share on other sites More sharing options...
telot Posted July 28, 2012 Share Posted July 28, 2012 Yeah..I don't get that either...that kills karma you know... telot 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.