Jon Nelson on 7 Jul 2010 08:51:35 -0700

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

[PLUG] Simple Python Help WAS:Filtering Packets in Monitor Mode

On Tue, Jul 6, 2010 at 10:28 PM, Paul L. Snyder <> wrote:
On Tue, 06 Jul 2010, Jon Nelson wrote:

> back|track4 has r1645, so no joy.  Also, the majority of the keys seem to
> effect the AP listing.  I hope that is not the case...

You may be stuck with to trying to script something.  Check the airodump
output formats to see if you can get something that's easily parsable and
has the signal strength info you're looking for.  You can then filter
the entries based on MAC and output just the info for the one you're
looking for.

Perhaps you could try creating a FIFO and having airodump write to it;
your script can then pull data from the FIFO as it becomes available.

I am by no means a Python or ncurses programmer, but I would think I would be able to figure this out.  I guess not :(  Here is what I have so far:

#!/usr/bin/env phthon

import curses
# create curses screen using whole display
stdscr = curses.initscr()
# I realize this is an infinite loop
while True:
  # parse the CSV file
  for line in open('foo-01.csv'):
    # look for the line with the right MAC
    if line.find(':5A:84') != -1
      # send the line to the screen
      stdscr.addstr(0, 0, line)
      # redraw the screen
# I realize I am not properly cleaning up, but will get to that later

When I run this I get a blinking cursor.  If I create a variable in the code and send that to the screen it works.  If I just print the line variable using print() it prints out the line.  What am I missing.
Philadelphia Linux Users Group         --
Announcements -
General Discussion  --