Jump to content

Wardrive


Recommended Posts

root@Pineapple:~# opkg install gpsd

You might not need gpsd since kismet can talk to gps devices natively now, but I've got a script somewhere that can update the date and time from the gps so I always install it. I'm using a Microsoft usb gps that came with MS Streets and Trips 2006, which is a rebranded Pharos igps 500.

root@Pineapple:~# opkg install kismet-client kismet-server

Edit your /etc/kismet/kismet.conf

These are the changes to my settings.

# See the README for full information on the new source format                                   
# ncsource=interface:options                                                                     
# for example:                                                                                   
 ncsource=wlan1                                                                                  
# ncsource=wifi0:type=madwifi                                                                    
# ncsource=wlan0:name=intel,hop=false,channel=11  



# Do we have a GPS?                                                                              
gps=true                                                                                         
# Do we use a locally serial attached GPS, or use a gpsd server?                                 
# (Pick only one)                                                                                
#gpstype=gpsd                                                                                    
 gpstype=serial                                                                                  
# What serial device do we look for the GPS on?                                                  
gpsdevice=/dev/ttyUSB0                                                                           
# Host:port that GPSD is running on.  This can be localhost OR remote!                           
gpshost=localhost:2947                                                                           
# Do we lock the mode?  This overrides coordinates of lock "0", which will                       
# generate some bad information until you get a GPS lock, but it will                            
# fix problems with GPS units with broken NMEA that report lock 0                                
gpsmodelock=false                                                                                
# Do we try to reconnect if we lose our link to the GPS, or do we just                           
# let it die and be disabled?                                                                    
gpsreconnect=true       



# How often (in seconds) do we write all our data files (0 to disable)                           
writeinterval=120   



logtemplate=/sd/kismet_logs/%p%n-%D-%t-%i.%l 


Then just setup a switch configuration to start kismet_server. You can ssh in and start kismet_client just like you would on a laptop to make sure your settings are working.

Link to comment
Share on other sites

TheSwed,

I don't think that's going to do what you think... It appears to be a USB hub or a USB battery pack. But it isn't really clear that it can be the hub while plugged into the pineapple and power the devices that are plugged into it at the same time. I could be wrong though...

Link to comment
Share on other sites

Maybe someone smarter than me can help me out. I've got a bash script called startkismet.sh saved to /sd. In my boot modes config I have 11001 set to run /sd/startkismet.sh. The problem is it's not running the script. I've chmodded it 777, just to be sure, and I can ssh in and run the command manually.

Here's the really simple script,

#!/bin/sh
kismet_server

Any ideas?

Link to comment
Share on other sites

I can execute the script no problem, it's just not running at boot.

root@Pineapple:~# mount
rootfs on / type rootfs (rw)
/dev/root on /rom type squashfs (ro,relatime)
proc on /proc type proc (rw,noatime)
sysfs on /sys type sysfs (rw,noatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noatime,size=30904k)
tmpfs on /dev type tmpfs (rw,noatime,size=512k,mode=755)
devpts on /dev/pts type devpts (rw,noatime,mode=600)
/dev/mtdblock3 on /overlay type jffs2 (rw,noatime)
overlayfs:/overlay on / type overlayfs (rw,relatime,lowerdir=/,upperdir=/overlay)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
/dev/sdcard/sd1 on /sd type ext4 (rw,relatime,user_xattr,barrier=1,data=ordered)
none on /proc/bus/usb type usbfs (rw,relatime)

Edited by barry99705
Link to comment
Share on other sites

I think I know. Is your script perhaps invoking a DIFFERENT shell that doesn't have kismet_server on the path?

Try changing #!/bin/sh to #!/bin/bash

Link to comment
Share on other sites

I think I know. Is your script perhaps invoking a DIFFERENT shell that doesn't have kismet_server on the path?

Try changing #!/bin/sh to #!/bin/bash

Nope, didn't help. Like I said, I can do a ./startkismet.sh and it works. I've also tried just putting kismet_server as a boot mode. Wonder if it needs the path?

Nope, that doesn't work either.

Edited by barry99705
Link to comment
Share on other sites

Of course it needs the path. You're invoking 'kismet_server'. It'll go through the path to find that program and fail if it can't find it.

To test, replace the 'kismet_server' invocation with this:

PATH_TO_PROG=`which kismet_server`
if [ "x${PATH_TO_PROG}" == "x" ]
then
    echo "No kismet_server found." >> /var/log/script.log
else
    echo "Starting ${PATH_TO_PROG}" >> /var/log/script.log
    ${PATH_TO_PROG}
fi
Edited by Cooper
Link to comment
Share on other sites

Of course it needs the path. You're invoking 'kismet_server'. It'll go through the path to find that program and fail if it can't find it.

To test, replace the 'kismet_server' invocation with this:

PATH_TO_PROG=`which kismet_server`
if [ "x${PATH_TO_PROG}" == "x" ]
then
    echo "No kismet_server found." >> /var/log/script.log
else
    echo "Starting ${PATH_TO_PROG}" >> /var/log/script.log
    ${PATH_TO_PROG}
fi

Added the path before, /usr/bin/kismet_server.

Link to comment
Share on other sites

I think at boot your path only contains, like /bin and /sbin and not much else. It might just be that kismet_server will invoke other stuff which it can't find because their location isn't on the path. That's what I thought you meant with "wonder if it needs the path" as in the PATH environment variable set properly.

Replace what I suggested and start out with

echo $PATH >> /var/log/script.log

to really demonstrate the problem.

Link to comment
Share on other sites

Do you have an LD_LIBRARY_PATH set typically?

Can you get that kismet_server program to output debug data?

Is it a binary executable or a script?

I'm picking up my own pineapple later today which should help in debugging...

Link to comment
Share on other sites

It's a binary. It's executable. I can get a linksys wrt54gl to run it as an init.d object no problem. The pineapple just won't run it. I'm going to try removing the karma init.d objects and see if that works.

Well that didn't help either. Freaking weird. I even tried making an init script to automagically start it at boot. Nada. I can now call /etc/init.d/kismet_server start and it starts just fine. I can just do a kismet_server and it starts just fine. For some reason it won't start during boot though. Not sure why.

Edited by barry99705
Link to comment
Share on other sites

Okay, I've given up on autostarting kismet, so now I'm trying to make an infusion. I know dick about writing php, so I'm copying the crap out of other infusions that have the commands I need. Basically I've copied Darren's ads-b tracker settings for the small_tile.php, handler.php, functions.php and the includes directory. I've modified everything(I think) to work with kismet instead of dump1090. I've removed settings that don't pertain, or just don't need to be there. After tracking down an extra bracket, I've gotten the small tile to actually show the start, stop buttons, and current status of kismet. Now the problem is I can't get the start button to actually start kismet server..... It will stop it, and even show it's running if I ssh in and start it manually. I think I'm almost there, but not sure what's wrong. Here's the configs if anyone wants to chime in.

small_tile.php

<?php include_once('/pineapple/includes/api/tile_functions.php'); ?>
<?php include_once("{$directory}/functions.php"); ?>

<div style='text-align: right'><a href='#' class="refresh" onclick='refresh_network()'> </a></div>




<?php
$kismet_server_running = exec("pidof kismet_server");
if($kismet_server_running == "") {
  echo "kismet_server <font color='red'>disabled</font>";
} else {
  echo "kismet_server <font color='lime'>enabled</font>";
}
?>
<br/><br/>
<form method="POST" action="/components/infusions/kismet/functions.php?action=startkismet_server" id="startkismet_server" onSubmit="$(this).AJAXifyForm(notify); return false;">
  <input type='submit' name='submit' value='Start kismet_server'>
</form>

<form method="POST" action="/components/infusions/kismet/functions.php?action=stopkismet_server" id="stopkismet_server" onSubmit="$(this).AJAXifyForm(notify); return false;">
  <input type='submit' name='submit' value='Stop kismet_server'>
</form>



functions.php

<?php

if(isset($_GET['action'])){
  if($_GET['action'] == "startkismet_server"){
    echo start_kismet_server();
  }
  if($_GET['action'] == "stopkismet_server"){
    echo stop_kismet_server();
  }
}

function start_kismet_server(){
  //print_r($_POST);

  $startcommand = "kismet_server --daemonize";

  exec("echo ".$startcommand." | at now");
  return "<font color='lime'>kismet_server Started</font>";
}

function stop_kismet_server(){
  exec("killall kismet_server");
  return "<font color='lime'>kismet_server Stopped.</font>";
}

?>

Edited by barry99705
Link to comment
Share on other sites

Well I found a small type in the code above and fixed that. Now when I click the Start kismet_server button it says "kismet_server Started" like it's supposed to, but kismet_server really isn't started... What's really irritating is I can put in "echo $PATH >> /var/log/script.log" that Cooper suggested to see the path, and it runs that just fine. I'm starting to wonder if this version can't be called from a script? You also can't run it from the Execute Commands window in the configuration tile.

Edited by barry99705
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...