Jump to content

Starting PineAP via CLI


Recommended Posts

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
sleep 1
sleep 1
sleep 1
sleep 1
sleep 1
cp /pineapple/includes/authOn.php /pineapple/includes/header.php
echo "done"
Link to comment
Share on other sites

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:


import socket
import os
import time

def communicate(command):
    sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
    except socket.error, msg:
        print("Connection error")

def execute(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")
print("Turning beaconer, responder, and harvester on.")


I'll make sure that all of these features are included in the CLI in the next firmware version.

Best Regards,


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.

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