Compare commits

..

No commits in common. "2f09d2398bb351a8d92f179de3a4d9dca62a4c01" and "3314c98fb3cfb10467c9e0cc4cca8d42d65e4c94" have entirely different histories.

2 changed files with 8 additions and 8 deletions

View File

@ -1,10 +1,10 @@
#! /usr/bin/python
import reporter, sniffer
import packet_processer, reporter, sniffer
def main():
print(sniffer.run_cmd("echo 1"))
snfr = sniffer.Sniffer("walfa0")
print(snfr.sniff(5))
snfr = Sniffer("walfa0")
print(snfr.sniff(1))
if __name__ == "__main__":
main()

View File

@ -5,11 +5,7 @@ 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)
try:
proc.wait(timeout=timeout)
except subprocess.TimeoutExpired:
return ("","",-1)
proc.wait(timeout=timeout)
return (proc.stdout.read().decode(), proc.stderr.read().decode(), proc.returncode)
@ -48,6 +44,10 @@ 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)