Jump to content

DIP Switch Shell Script Issues


Recommended Posts

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!

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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 :(

Link to comment
Share on other sites

/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 by sud0nick
Link to comment
Share on other sites

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 by sud0nick
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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...

Link to comment
Share on other sites

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 by sud0nick
Link to comment
Share on other sites

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?

Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...