I wrote a program (I ran it in the terminal) that goes through a list of terminal commands (Kali Linux).
import subprocess as sub import time sub.call(['airmon-ng', 'start', 'wlan0']) p = sub.call(['airodump-ng','wlan0mon']) time.sleep(10) p.kill() The last commmand is airodump-ng wlan0mon. Everything works fine (everything is displayed in the terminal (beacons, essid, etc.).
After a specified time I wish to kill the process (airodump-ng wlan0mon).
I don't want to press Ctrl + C by hand! p.kill() does not work (maybe improper use).
How can I do this? What command should I send through the subprocess module?