Jump to content

Autostart Karma On Mark3


telot

Recommended Posts

Quick version: How to I autorun karma on the pineapple at bootup, or after a certain amount of time after power on?

Long version:

My dream for the pineapple is to have a tiny computer that has 2 usb ports and an ethernet port (read: raspberrypi.org). I'll have a pineapple connected via ethernet, a alfa realtek usb wifi adapter connected to one usb and another brandX wifi dongle connected to the other usb. Upon bootup of backtrack, brandX wifi will begin iwlist scanning for nearby open wifi hotspots and autoconnect. At that time LED1 connected to the GPIO headers on the r-pi will steady burn green. After that is accomplished, the r-pi will run my 1scripttorulethemall.sh (see telot.org) and autoconfigure ICS to the pineapple. At that point LED2 will light up green. Continuing on, the script then will turn on monitor mode on the alfa, airodump nearby wifi hotspots and do a targeted aireplay -0 30 -a -c to all clients associated to the hotspot the pineapple is connected to, then run a airdrop for all other AP's, minus the pineapples.

Heres my scenario: I walk in to a coffee shop and reach into my bag and flick the power switch on my "Raspberry Pineapple". It autoconnects to "coffee_wifi" on the r-pi's wlan0, changes the karma'd ESSID to "coffee-wifi", starts karma, kicks off all clients of "coffee_wifi" except the raspberry pineapple, kicks off all clients on any other AP's, continues to hammer "coffee_wifi" with deauths, and tcpdumps all the "victim" traffic on eth0 to the SDcard on the r-pi. I don't have to open up a laptop, look suspicious running backtrack in a coffee shop, or really do anything at all. Just sit there and sip coffee. Nasty huh?

So I'm researching how to do a script that iwlist scan's nearby AP's and autoconnects then takes that ESSID and puts it into the karma config with a slight modification. This is just so if people don't have an open AP saved in their computers, they're still duped into connecting to my raspberry pineapple. But to do any of this, I need to know how to autostart karma after a period of time, without clicking anything, so that my r-pi has enough time to scan and connect and modify the karma configuration to the appropriate name.

tl;dr - how do I autorun /www/pineapple/startkarma.sh after X seconds?

Thanks!

telot

Link to comment
Share on other sites

Short Answer: crontab

Long Answer: You could add a crontab to have it start automatically but it may not reflect that on the web-gui for the pineapple if started that way. I'm not sure how it is identifying that it is enabled or not with feedback or just guessing because you clicked "Enable" and it just says it's active without feedback.

crontab
crontab [-c DIR] [-u USER] [-ler]|[FILE]

        -c      Crontab directory
        -u      User
        -l      List crontab
        -e      Edit crontab
        -r      Delete crontab
        FILE    Replace crontab by FILE ('-': stdin)

http://busybox.net/downloads/BusyBox.html

Link to comment
Share on other sites

Short Answer: crontab

Long Answer: You could add a crontab to have it start automatically but it may not reflect that on the web-gui for the pineapple if started that way. I'm not sure how it is identifying that it is enabled or not with feedback or just guessing because you clicked "Enable" and it just says it's active without feedback.

crontab
crontab [-c DIR] [-u USER] [-ler]|[FILE]

        -c      Crontab directory
        -u      User
        -l      List crontab
        -e      Edit crontab
        -r      Delete crontab
        FILE    Replace crontab by FILE ('-': stdin)

http://busybox.net/downloads/BusyBox.html

The gui is of little to no concern for me, but I will let you know how it reacts once I do my trial and error with crontab -e

Thanks again Mr. Protocol

telot

Link to comment
Share on other sites

The gui is of little to no concern for me, but I will let you know how it reacts once I do my trial and error with crontab -e

Thanks again Mr. Protocol

telot

I was inspired,

here is a script you can set up in Mr. Protocol's suggested crontab

i put my script in /www/pineapple/<yourscriptnamehere>

just replace <yourscriptnamehere> with something that you like, i used startkarma.bin

#!/bin/sh

NANO=`ps auxww | grep karma.conf | grep -v -e grep | awk '{print $1}'`

if [ $NANO &gt; 0 ]; then
echo "hello"
exit 0
else
hostapd-karma -dd /etc/hostapd/karma.conf &gt;&gt; /tmp/karma.log | at now &amp;
sleep 10
/www/pineapple/update-associations.sh | at now &amp;
echo "pineapples are"
fi
echo "yummy"

then

chmod +x &lt;yourscriptnamehere&gt;

then to add to the crontab, this is from Darren's post here

echo "* * * * * /www/pineapple/&lt;yourscriptnamehere&gt;" &gt;&gt; /etc/crontabs/root

as far as the **** things, ref this site http://www.pantz.org or just use @reboot instead of them to only run once at start up

the echo's were for error stuff you can take them out if you'd like.

Thank you for the idea!

Edited by pewpew
Link to comment
Share on other sites

Auto starting Karma will actually be a check-box option in the advanced config in MK3 2.0.

Also, recent changes will break your script. Further explanation once 2.0 is out.

Best,

Sebkinne

Thanks for the heads up Sebkinne!!

Link to comment
Share on other sites

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.

  • Recently Browsing   0 members

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