SilverWingedSeraph Posted December 18, 2014 Share Posted December 18, 2014 I am trying to start a script (/root/start-pine-ap.sh) from my DIP switches. My switch config is: /root/pine-ap-start.sh #Start PineAP and SSLStrip and EvilPortal and the script is: #!/bin/ash sleep 5 echo "$0 Trying to start PineAP with Dogma and Autoharvester." pineapple infusion pineap start pineapple infusion pineap dogma start pineapple infusion pineap responder start pineapple infusion pineap harvester start echo "$0 Done starting PineAP." sslstrip -s -a >> /sd/sslstrip.log & echo "$0 Started sslstrip." pineapple notify "Started PineAP and SSLStrip automatically." When run from ssh, it works fine, but when run from the DIP switches it doesn't (PineAP doesn't start, no notifications). What's going on? Thanks very much! Quote Link to comment Share on other sites More sharing options...
sud0nick Posted December 18, 2014 Share Posted December 18, 2014 DIP switches are boot mode switches. This means they execute scripts upon startup and not in the middle of operations, AFAIK. Check out the wiki (http://wiki.wifipineapple.com/index.php/DIP_Switches) for more information. The wiki states only BASH commands are acceptable in command fields so shouldn't your command look like ./root/pine-ap-start.sh with the period at the beginning so it will execute? Quote Link to comment Share on other sites More sharing options...
SilverWingedSeraph Posted December 18, 2014 Author Share Posted December 18, 2014 DIP switches are boot mode switches. This means they execute scripts upon startup and not in the middle of operations, AFAIK. I should have clarified, but yes, I'm doing this on boot. The wiki states only BASH commands are acceptable in command fields so shouldn't your command look like ./root/pine-ap-start.sh with the period at the beginning so it will execute? /root/pine-ap-start.sh is the absolute path; I tried it with ./pine-ap-start.sh too and id tidn't work :( Quote Link to comment Share on other sites More sharing options...
sud0nick Posted December 18, 2014 Share Posted December 18, 2014 (edited) /root/pine-ap-start.sh is the absolute path; I tried it with ./pine-ap-start.sh too and id tidn't work :( What I meant was have you tried putting a period at the beginning of the absolute path? It needs to path the find the script and the period to know you want to execute it. Edited December 18, 2014 by sud0nick Quote Link to comment Share on other sites More sharing options...
SilverWingedSeraph Posted December 18, 2014 Author Share Posted December 18, 2014 What I meant was have you tried putting a period at the beginning of the absolute path? It needs to path to find the script and the period to know you want to execute it. Just tried that. Still nothing. Quote Link to comment Share on other sites More sharing options...
sud0nick Posted December 18, 2014 Share Posted December 18, 2014 (edited) So I found this other thread in the forums that makes a suggestion (https://forums.hak5.org/index.php?/topic/32753-trouble-running-stuff-in-background-dip-switches/?hl=%2Bshell+%2Bscript+%2Bdip+%2Bswitch#entry246037). The command fields may be weird and not accept a command that calls a script directly. In the thread I linked to there is a suggestion that one should try echoing the command like so: echo "./root/pine-ap-start.sh" or echo "./root/pine-ap-start.sh" | at now This seems ridiculous to me but it's worth a shot to try everything. I also should have mentioned this before but try changing your script to /bin/bash instead of /bin/ash. Just a thought... Edited December 18, 2014 by sud0nick Quote Link to comment Share on other sites More sharing options...
SilverWingedSeraph Posted December 18, 2014 Author Share Posted December 18, 2014 So I found this other thread in the forums that makes a suggestion (https://forums.hak5.org/index.php?/topic/32753-trouble-running-stuff-in-background-dip-switches/?hl=%2Bshell+%2Bscript+%2Bdip+%2Bswitch#entry246037). The command fields may be weird and not accept a command that calls a script directly. In the thread I linked to there is a suggestion that one should try echoing the command like so: echo "./root/pine-ap-start.sh" or echo "./root/pine-ap-start.sh" | at now This seems ridiculous to me but it's worth a shot to try everything. I also should have mentioned this before but try changing your script to /bin/bash instead of /bin/ash. Just a thought... Tried both, still nothing. Thanks for helping out, I guess scripts just won't work. :( I'll do it with the commands themselves instead. Quote Link to comment Share on other sites More sharing options...
SergeantFTC Posted December 18, 2014 Share Posted December 18, 2014 You don't use "." in front of an absolute path. That makes no sense. The period tells the shell to look for the file in your current directory, not that you want to execute it. Try this stuff without a period. So I found this other thread in the forums that makes a suggestion (https://forums.hak5.org/index.php?/topic/32753-trouble-running-stuff-in-background-dip-switches/?hl=%2Bshell+%2Bscript+%2Bdip+%2Bswitch#entry246037). The command fields may be weird and not accept a command that calls a script directly. In the thread I linked to there is a suggestion that one should try echoing the command like so: echo "./root/pine-ap-start.sh" or echo "./root/pine-ap-start.sh" | at now This seems ridiculous to me but it's worth a shot to try everything. I also should have mentioned this before but try changing your script to /bin/bash instead of /bin/ash. Just a thought... Quote Link to comment Share on other sites More sharing options...
sud0nick Posted December 18, 2014 Share Posted December 18, 2014 (edited) You don't use "." in front of an absolute path. That makes no sense. The period tells the shell to look for the file in your current directory, not that you want to execute it. Try this stuff without a period. You're right, but I could have sworn I've done it that way before. As you can tell I don't write many shell scripts. Edited December 18, 2014 by sud0nick Quote Link to comment Share on other sites More sharing options...
SilverWingedSeraph Posted December 19, 2014 Author Share Posted December 19, 2014 You don't use "." in front of an absolute path. That makes no sense. The period tells the shell to look for the file in your current directory, not that you want to execute it. Try this stuff without a period. That's what I thought. Trying again without a period. I'm having another issue, too; I can't get an Ethernet connection to the Pineapple to work on any version of Ubuntu. I've tried 14.04, 14.10, and whatever the latest Kali is, with and without the ICS script, and I never have a route to the Pineapple. Works fine in Win 7 though. Anyone know what's going on? Quote Link to comment Share on other sites More sharing options...
SilverWingedSeraph Posted December 19, 2014 Author Share Posted December 19, 2014 Nope, doesn't work without the period. Quote Link to comment Share on other sites More sharing options...
DataHead Posted December 19, 2014 Share Posted December 19, 2014 Or you can try cd /directoryofscript bash ./myscript.sh Quote Link to comment Share on other sites More sharing options...
SergeantFTC Posted December 23, 2014 Share Posted December 23, 2014 I haven't tried any of the other responses, but what works for me is bash /full/path/to/script Quote Link to comment Share on other sites More sharing options...
SilverWingedSeraph Posted January 1, 2015 Author Share Posted January 1, 2015 I haven't tried any of the other responses, but what works for me is bash /full/path/to/script Works great, thanks much. :) 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.