Poll output from airodump-ng in Python

I am trying to create a python program that can periodically poll the output from airodump-ng, wifi sniffing tool. I do this on an RPI running on Raspbian and Python 3.4. I searched for how to do this on several sites, but whenever I try to do this, I get a kind of dead end and software kiosks.

I am using this code:

import subprocess
airodump = subprocess.Popen(['sudo','airodump-ng','mon0'])
out,err = airodump.communicate(timeout=10)

So, it’s strange that when I type these commands one after another in IDLE running in the RPI, everything works, but after 10 seconds I get a timeout error. If you do not use the timeout argument, the program simply stops. Using the optional argument 'stdout = subprocess.PIPE' also does not work. But when I go to the terminal and start python using the command "python3" and then typing the first and second lines, the whole screen is filled with the output of airodump-ng, and I can not print anything else!

So how can I solve this? I just want to get the latest result from airodump-ng, and the output of airodum-ng can simply be updated in the background, in another thread. I just need the latest conclusion.

+4
1

. doc, ,

, TimeoutExpired. .

, , .

wifite , airodump!

+1

Source: https://habr.com/ru/post/1617482/


All Articles