2

I want to parse the output of airodump-ng tool searching for wps data. I know since airodump-ng 1.2 rc2 there is available an argument --wpswhich shows another new column for wps data. The surprise is using -w option to write the results to a file, there is no wps info on files!!! only showed by screen...

So I thought maybe could be good idea to capture the screen's output and parse everything manually with awk and/or regexps. First thing I observed is stdout is not normal. Using tee like this airodump-ng wlan0mon | tee "/path/to/log"it produces an empty file. Searching I found this post: How do I write stderr to a file while using "tee" with a pipe?

With that solution I can do airodump-ng wlan0mon > >(tee /path/to/log) 2> >(tee /path/to/log >&2) and the file is filled with all the data... the problem is there is a lot of repeated data... I want only last state of screen before stopping airodump... like some kind of "screenshot" of last state of data on a file and then I can try to parse... Any idea about how to get this? Thanks in advance.

Community
  • 1
  • 1
OscarAkaElvis
  • 5,384
  • 4
  • 27
  • 51

1 Answers1

0

Frankly, I think you're better off just capturing all of the output, but if you want only the last N lines, try:

{ airodump-ng wlan0mon 2>&1 | tee /dev/tty; } | tail -$N > /path/to/log
William Pursell
  • 204,365
  • 48
  • 270
  • 300
  • Thanks for your answer. Capture all the output is not an option... 30 seconds of scanning (which is very normal) can produce thousands and thousands of lines because everything is repeated again and again... In the other hand, I tried your suggestion but this is not working... I tried, but no joy. Not sure if I'm doing something wrong... I don't think so. Anyway we have the additional problem of the unknown N lines... I don't know before scanning if are going to be 8 lines or 30 lines... – OscarAkaElvis Nov 03 '16 at 13:15
  • "thousands and thousands" of lines is not very much. Capture the output, then post-process it with tail. – William Pursell Nov 03 '16 at 21:20