Jump to content

Archived

This topic is now archived and is closed to further replies.

harmless

Can only run kismet_server via SSH. Why not boot mode or execute command window?

Recommended Posts

OK, so this is something of a continuation of this thread:

https://forums.hak5.org/index.php?/topic/32535-wardrive/page-2?hl=kismet

Since the topic changed a bit, and it's a little stale, I thought I'd start a new thread. Here goes:

So, just as @barry99705 said, kismet_server will not run from one of the boot mode command lines or from the 'execute command' window under settings > advanced in the pinapple web interface, but if I SSH into the pineapple and issue the command, it works as expected.

Here is my boot mode command:

logger "Boot Mode 100 executing now..."; logger "Starting kismet_server..."; kismet_server

And here is the relevant log output (with a couple of extra lines for context):

Jan  1 00:00:08 Pineapple daemon.info dnsmasq-dhcp[1833]: DHCPACK(br-lan) [removed]
Jan  1 00:00:08 Pineapple daemon.info dnsmasq-dhcp[1833]: DHCPREQUEST(br-lan) [removed]
Jan  1 00:00:02 Pineapple user.info sysinit: /bin/sh: kismet_server: not found
Jan  1 00:00:02 Pineapple user.notice root: Starting kismet_server...
Jan  1 00:00:02 Pineapple user.notice root: Boot Mode 100 executing now...
Jan  1 00:00:00 Pineapple user.info sysinit: Wed Jan  1 00:00:00 GMT 2014

Also, for grins, I tried the full path to the command in case PATH variables weren't quite loaded yet (I'm running kismet from my sd card.):

logger "Boot Mode 100 executing now..."; logger "Starting kismet_server..."; /sd/usr/bin/kismet_server

Resulting in a slightly more curoius error loading libcap.so.2:

Jan  1 00:00:03 Pineapple daemon.info dnsmasq-dhcp[1833]: DHCPACK(br-lan) [removed]
Jan  1 00:00:03 Pineapple daemon.info dnsmasq-dhcp[1833]: DHCPREQUEST(br-lan) [removed]
Jan  1 00:00:02 Pineapple user.info sysinit: /sd/usr/bin/kismet_server: can't load library 'libcap.so.2'
Jan  1 00:00:02 Pineapple user.notice root: Starting kismet_server...
Jan  1 00:00:02 Pineapple user.notice root: Boot Mode 100 executing now...
Jan  1 00:00:00 Pineapple user.info sysinit: Wed Jan  1 00:00:00 GMT 2014

The only other thing I could think of to do, again in case environment variables needed time to load, was delay the command execution via sleep ala:

sleep 30 && /sd/usr/bin/kismet_server

with the same results in the logs only delayed a bit.

Any other ideas on how to get kismet to autorun at boot? This is my first attempt at doing anything interesting with the pineapple, and I don't want to give up until it works.

Thanks!

Share this post


Link to post
Share on other sites

Hey harmless,

You need to background whatever commands you run. If you need a sleep (which you likely do for this), you should wrap all that and background the entire command.

Best regards,

Sebkinne

Share this post


Link to post
Share on other sites

Thanks for the suggestion Seb. I'm sure my oversight there would have prolonged my misery even more than it has lasted, but that wasn't the only problem. In case someone else runs into this issue, here's what I ultimately did to get kismet-server to run from a boot mode script:

Since the list of commands I wanted to try was getting long, I decided to switch to using a shell script instead of dropping a list of commands in the web interface, not strictly necessary to the solution, but definitely easier on the eyes. The boot mode dialogue now says:

logger "Boot Mode 110 executing now..."; /sd/scripts/boot110.sh &

After installing coreutils-printenv, I was able to see that the collections of environment variables available to the various command environments (boot modes, 'execute command', and SSH) were hugely different. Further guesswork led me to believe I needed to set the PATH and LD_LIBRARY_PATH vars in my script so that kismet_server would be able to find everything it needed. Holy shit, it worked! Here is what that script looks like:

#!/bin/sh
#/sd/usr/bin/printenv >> /sd/var/log/boot110.log

#Setting some environment variables so that kismet can run
#These were copied verbatim from the SSH printenv output:
export LD_LIBRARY_PATH='/lib:/usr/lib:/sd/lib:/sd/usr/lib'
export PATH='/bin:/sbin:/usr/bin:/usr/sbin:/sd/usr/bin:/sd/usr/sbin'

#Run kismet (daemonized to suppress unnecessary output):
kismet_server --daemonize
pineapple notify 'kismet now running'

There were a couple of other tweeks necessary to get this to run off of the SD card, but this was the tough part. Thanks for all the help folks! I'm looking forward to some fun times with my pineapple.

harmless

Share this post


Link to post
Share on other sites

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...