Merge pull request #7 from xBelladonna/master

Dependency check for aircrack-ng
This commit is contained in:
evilsocket 2019-12-23 11:19:28 +01:00 committed by GitHub
commit aefbe5279f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 2 deletions

View File

@ -22,6 +22,13 @@ class AircrackOnly(plugins.Plugin):
def on_loaded(self): def on_loaded(self):
logging.info("aircrackonly plugin loaded") logging.info("aircrackonly plugin loaded")
check = subprocess.run(
('/usr/bin/dpkg -l aircrack-ng | grep aircrack-ng | awk \'{print $2, $3}\''), shell=True, stdout=subprocess.PIPE)
check = check.stdout.decode('utf-8').strip()
if check != "aircrack-ng <none>":
logging.info("aircrackonly: Found " + check)
else:
logging.warning("aircrack-ng is not installed!")
def on_handshake(self, agent, filename, access_point, client_station): def on_handshake(self, agent, filename, access_point, client_station):
display = agent._view display = agent._view
@ -47,6 +54,7 @@ class AircrackOnly(plugins.Plugin):
if todelete == 1: if todelete == 1:
os.remove(filename) os.remove(filename)
self.text_to_set = "Removed an uncrackable pcap" self.text_to_set = "Removed an uncrackable pcap"
logging.warning("Removed uncrackable pcap " + filename)
display.update(force=True) display.update(force=True)
def on_ui_update(self, ui): def on_ui_update(self, ui):

View File

@ -8,7 +8,7 @@ import pwnagotchi.plugins as plugins
Aircrack-ng needed, to install: Aircrack-ng needed, to install:
> apt-get install aircrack-ng > apt-get install aircrack-ng
Upload wordlist files in .txt format to folder in config file (Default: /opt/wordlists/) Upload wordlist files in .txt format to folder in config file (Default: /opt/wordlists/)
Cracked handshakes stored in handshake folder as [essid].pcap.cracked Cracked handshakes stored in handshake folder as [essid].pcap.cracked
''' '''
@ -23,6 +23,13 @@ class QuickDic(plugins.Plugin):
def on_loaded(self): def on_loaded(self):
logging.info("Quick dictionary check plugin loaded") logging.info("Quick dictionary check plugin loaded")
check = subprocess.run(
('/usr/bin/dpkg -l aircrack-ng | grep aircrack-ng | awk \'{print $2, $3}\''), shell=True, stdout=subprocess.PIPE)
check = check.stdout.decode('utf-8').strip()
if check != "aircrack-ng <none>":
logging.info("quickdic: Found " + check)
else:
logging.warning("aircrack-ng is not installed!")
def on_handshake(self, agent, filename, access_point, client_station): def on_handshake(self, agent, filename, access_point, client_station):
display = agent.view() display = agent.view()
@ -35,7 +42,7 @@ class QuickDic(plugins.Plugin):
logging.info("[quickdic] Handshake confirmed") logging.info("[quickdic] Handshake confirmed")
result2 = subprocess.run(('aircrack-ng -w `echo ' + self.options[ result2 = subprocess.run(('aircrack-ng -w `echo ' + self.options[
'wordlist_folder'] + '*.txt | sed \'s/\ /,/g\'` -l ' + filename + '.cracked -q -b ' + result + ' ' + filename + ' | grep KEY'), 'wordlist_folder'] + '*.txt | sed \'s/\ /,/g\'` -l ' + filename + '.cracked -q -b ' + result + ' ' + filename + ' | grep KEY'),
shell=True, stdout=subprocess.PIPE) shell=True, stdout=subprocess.PIPE)
result2 = result2.stdout.decode('utf-8').strip() result2 = result2.stdout.decode('utf-8').strip()
logging.info("[quickdic] " + result2) logging.info("[quickdic] " + result2)
if result2 != "KEY NOT FOUND": if result2 != "KEY NOT FOUND":