Skip to content

Commit

Permalink
* Fixed bug that causes fern to capture IVS infinitely without cracking
Browse files Browse the repository at this point in the history
* Fixed similar bugs with WPA
  • Loading branch information
savio-code committed Sep 20, 2016
1 parent d51c885 commit 6415b67
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 13 deletions.
24 changes: 15 additions & 9 deletions Fern-Wifi-Cracker/core/fern.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

from gui.main_window import *

__version__= 2.3
__version__= 2.4

#
# Main Window Class
Expand Down Expand Up @@ -462,7 +462,7 @@ def killConflictProcesses(self):
process = commands.getstatusoutput("airmon-ng check")
status = process[0]
output = process[1]

if(status == 0):
for line in output.splitlines():
splitedLines = line.split()
Expand All @@ -471,21 +471,24 @@ def killConflictProcesses(self):
if(prefix.isdigit()):
pid = int(prefix)
killProcess(pid)



def set_monitor_thread(self,monitor_card,mac_setting_exists,last_settings):
self.killConflictProcesses()

commands.getstatusoutput('ifconfig %s down'%(self.monitor_interface)) # Avoid this: "ioctl(SIOCSIWMODE) failed: Device or resource busy"

status = str(commands.getoutput("airmon-ng start %s"%(monitor_card)))
messages = ("monitor mode enabled","monitor mode vif enabled","monitor mode already")

monitor_created = False;

for x in messages:
if(x in status):
monitor_created = True



if (monitor_created):
monitor_interface_process = str(commands.getoutput("airmon-ng"))

Expand Down Expand Up @@ -513,7 +516,10 @@ def set_monitor_thread(self,monitor_card,mac_setting_exists,last_settings):
variables.exec_command('macchanger -m %s %s'%(last_settings,self.monitor_interface))
else:
variables.exec_command('macchanger -A %s'%(self.monitor_interface))
mon_up = commands.getstatusoutput('ifconfig %s up'%(self.monitor_interface))
#mon_up = commands.getstatusoutput('ifconfig %s up'%(self.monitor_interface)) # Lets leave interface down to avoid channel looping during channel specific attack

commands.getstatusoutput('ifconfig %s down'%(self.monitor_interface))

for iterate in os.listdir('/sys/class/net'):
if str(iterate) == str(self.monitor_interface):
os.chmod('/sys/class/net/' + self.monitor_interface + '/address',0777)
Expand All @@ -538,7 +544,7 @@ def tip_display(self):

def display_error_monitor(self):
self.display_monitor_error("red","problem occured while setting up the monitor mode of selected")


def monitor_mode_enabled(self):
self.mon_label.setText("<font color=green>Monitor Mode Enabled on %s</font>"%(self.monitor_interface))
Expand Down
2 changes: 1 addition & 1 deletion Fern-Wifi-Cracker/core/wep.py
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@ def P0841_thread(self):
def crack_wep(self):
directory = '/tmp/fern-log/WEP-DUMP/'
variables.exec_command('killall aircrack-ng')
process = subprocess.Popen('aircrack-ng '+ directory + '*.cap -l '+ directory + 'wep_key.txt',shell = True,stdout = subprocess.PIPE,stderr = subprocess.PIPE,stdin = subprocess.PIPE)
process = subprocess.Popen('aircrack-ng '+ directory + 'wep_dump-01.cap -l '+ directory + 'wep_key.txt',shell = True,stdout = subprocess.PIPE,stderr = subprocess.PIPE,stdin = subprocess.PIPE)
status = process.stdout
while 'wep_key.txt' not in os.listdir('/tmp/fern-log/WEP-DUMP/'):
if 'Failed. Next try with' in status.readline():
Expand Down
3 changes: 1 addition & 2 deletions Fern-Wifi-Cracker/core/wpa.py
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ def launch_brutefore(self):
keys_speed_regex = re.compile("(\d+.?\d+) k/s",re.IGNORECASE)
keys_tested_regex = re.compile("(\d+) keys tested",re.IGNORECASE)

crack_process = subprocess.Popen("cd /tmp/fern-log/WPA-DUMP/ \naircrack-ng -a 2 -w '%s' *.cap -l wpa_key.txt" % (self.wordlist),
crack_process = subprocess.Popen("cd /tmp/fern-log/WPA-DUMP/ \naircrack-ng -a 2 -w '%s' wpa_dump-01.cap -l wpa_key.txt" % (self.wordlist),
shell=True,stdout=subprocess.PIPE,stderr=subprocess.PIPE,stdin=subprocess.PIPE)

stdout = crack_process.stdout
Expand Down Expand Up @@ -829,4 +829,3 @@ def display_Cracked_Key(self):

def closeEvent(self,event):
self.wps_update_timer.stop()

Binary file modified Fern-Wifi-Cracker/resources/splash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion Fern-Wifi-Cracker/version
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
version = 2.3
version = 2.4
total_files = 81

0 comments on commit 6415b67

Please sign in to comment.