Compare commits
2 Commits
3314c98fb3
...
2f09d2398b
Author | SHA1 | Date | |
---|---|---|---|
2f09d2398b | |||
dd649aa439 |
@ -1,10 +1,10 @@
|
||||
#! /usr/bin/python
|
||||
import packet_processer, reporter, sniffer
|
||||
import reporter, sniffer
|
||||
|
||||
def main():
|
||||
print(sniffer.run_cmd("echo 1"))
|
||||
snfr = Sniffer("walfa0")
|
||||
print(snfr.sniff(1))
|
||||
snfr = sniffer.Sniffer("walfa0")
|
||||
print(snfr.sniff(5))
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
@ -5,7 +5,11 @@ def run_cmd(cmd, out=subprocess.PIPE, timeout=None):
|
||||
# Just runs a command, supports changing the pipe n stuff
|
||||
|
||||
proc = subprocess.Popen(cmd, stdout = out, stderr = subprocess.PIPE, shell=True)
|
||||
proc.wait(timeout=timeout)
|
||||
|
||||
try:
|
||||
proc.wait(timeout=timeout)
|
||||
except subprocess.TimeoutExpired:
|
||||
return ("","",-1)
|
||||
|
||||
return (proc.stdout.read().decode(), proc.stderr.read().decode(), proc.returncode)
|
||||
|
||||
@ -44,10 +48,6 @@ class Sniffer:
|
||||
if code != 0:
|
||||
return code
|
||||
|
||||
#time.sleep(timeout+.1) # Give a bit of time for airodump to write
|
||||
|
||||
#stdout, code = run_cmd(f"killall -i airodump-ng")
|
||||
|
||||
full_filepath = f"{dump_file}-01.csv"
|
||||
|
||||
return self.parse_sniff(full_filepath)
|
||||
|
Loading…
Reference in New Issue
Block a user