jamz33 Posted September 24, 2014 Share Posted September 24, 2014 So I needed, wanted to start all PineAP modules through CLI but could not find how, so then I found a post stating that this is not supported at this time. But I needed it, so I figure if I disable authentication requirement for the site and then make wget –s calls to the correct URLS. Someone smarter than me ,maybe can figure out how to modify auth.php not to require authentications for request originating from localhost otherwise to keep your box locked you will have to comment in and out "require_once('/pineapple/includes/api/auth.php');” statement in your /pineapple/includes/header.php file. Log story short, your “turn on PineAp script could look as crude as this – hey it works… hope Hak5 does not mind me butchering their code too muchJ cp /pineapple/includes/authOff.php /pineapple/includes/header.php sleep 1 wget -s http://localhost:1471/components/system/pineap/functions.php?action=start_karma sleep 1 wget -s http://localhost:1471/components/system/pineap/functions.php?action=start_pineap sleep 1 wget -s http://localhost:1471/components/system/pineap/functions.php?action=start_beaconer sleep 1 wget -s http://localhost:1471/components/system/pineap/functions.php?action=start_responder sleep 1 wget -s http://localhost:1471/components/system/pineap/functions.php?action=start_harvester sleep 1 cp /pineapple/includes/authOn.php /pineapple/includes/header.php echo "done" Quote Link to comment Share on other sites More sharing options...
Sebkinne Posted September 24, 2014 Share Posted September 24, 2014 Hi Jamz33, Indeed, I haven't gotten around to incorporating PineAP into the CLI yet. To make up for it, here is a small python program to do what you want: start.py: import socket import os import time def communicate(command): sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) try: sock.connect("/var/run/pinejector.sock") sock.send(command) except socket.error, msg: print("Connection error") def execute(command): os.system(command) print("Starting karma, bringing up monitor interface, and starting pineAP") execute("pineapple karma start &>/dev/null") execute("airmon-ng start wlan1 &>/dev/null; mac=$(ifconfig wlan0 | grep HWaddr | awk '{print $5}'); chan=$(iw dev wlan0 info | grep channel | awk '{print $2}'); iface=$(ifconfig -a | grep $(echo $(ifconfig wlan1 | grep HWaddr | awk '{print $5}' | sed 's/:/-/g')) | head -n1 | awk '{print $1}'); echo \"pinejector $iface $chan $mac\" | at now &>/dev/null") print("Done. Sleeping two seconds") time.sleep(2) print("Turning beaconer, responder, and harvester on.") communicate("beaconer:on") communicate("responder:on") communicate("harvest:on") I'll make sure that all of these features are included in the CLI in the next firmware version. Best Regards, Sebkinne 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.