From c6fea1e70c71bbe9a04d8026d926f3fc119ef9fd Mon Sep 17 00:00:00 2001 From: mh4x0f Date: Wed, 24 Aug 2016 10:13:34 -0300 Subject: [PATCH] fixed error when launch airodump-ng scan the wireless networks #75 --- CHANGELOG | 1 + Core/config/commits/Lcommits.cfg | 1 + Core/utility/extract.py | 11 +++++------ Core/utility/threads.py | 15 +++++++++++++++ 4 files changed, 22 insertions(+), 6 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 35adeaa..6efae18 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -5,6 +5,7 @@ Version 0.8.1 - added new sessions for Rogue AP loggers - added new plugin BDFProxy-ng - added new theme Orange and set as default +- fixed error when launch airodump-ng scan the wireless networks #75 Version 0.7.8 ------------- diff --git a/Core/config/commits/Lcommits.cfg b/Core/config/commits/Lcommits.cfg index 595ba44..aa97773 100644 --- a/Core/config/commits/Lcommits.cfg +++ b/Core/config/commits/Lcommits.cfg @@ -7,6 +7,7 @@ master: { changelog : 'added new plugin BDFProxy-ng' }, { changelog : 'fixed error logger files hostapd, requests' }, { changelog : 'added new theme Orange and set as default' }, + { changelog : 'fixed error when launch airodump-ng scan the wireless networks #75' }, ] WiFiPumpkin078: diff --git a/Core/utility/extract.py b/Core/utility/extract.py index d9c814b..4f75928 100644 --- a/Core/utility/extract.py +++ b/Core/utility/extract.py @@ -1,7 +1,6 @@ from os import popen - from BeautifulSoup import BeautifulSoup -from Core.utility.threads import ProcessThread +from Core.utility.threads import ProcessThreadScanner """ Description: @@ -25,10 +24,10 @@ """ def airdump_start(interface): - process = ProcessThread(['xterm', - '-geometry', '85x15-1+250', '-T', - '"Scan AP Airodump-ng"', '-e', 'airodump-ng', interface, - '--write', 'Settings/Dump/networkdump']) + process = ProcessThreadScanner(['xterm', + '-geometry', '85x15-1+250', '-T', + 'scan AP Airodump-ng', '-e', 'airodump-ng', interface, + '--write', 'Settings/Dump/networkdump']) process.name = "Airodump-ng scan" process.start() process.join() diff --git a/Core/utility/threads.py b/Core/utility/threads.py index 70dff44..576d889 100644 --- a/Core/utility/threads.py +++ b/Core/utility/threads.py @@ -2,6 +2,7 @@ import logging import signal import threading +from re import search from sys import stdout from time import asctime from os import path,stat,getpgid,setsid,killpg,devnull @@ -12,6 +13,7 @@ from Core.Utils import setup_logger,Refactor from subprocess import (Popen,PIPE,STDOUT) from PyQt4.QtCore import QThread,pyqtSignal,SIGNAL,pyqtSlot,QProcess,QObject,SLOT +from PyQt4.QtGui import QMessageBox from Plugins.sergio_proxy.plugins import * from multiprocessing import Process,Manager try: @@ -19,6 +21,19 @@ except ImportError: pass +class ProcessThreadScanner(threading.Thread): + ''' thread for run airodump-ng backgroung and get data''' + def __init__(self, cmd): + threading.Thread.__init__(self) + self.cmd = cmd + def run(self): + self.process = Popen(self.cmd,stdout=PIPE,stderr=STDOUT) + for line in iter(self.process.stdout.readline, b''): + pass + def stop(self): + if self.process is not None: + self.process.terminate() + class ThreadPopen(QThread): def __init__(self,cmd): QThread.__init__(self)