From a5c2b273a5952ca34232f4306fd94d746d1f2eb2 Mon Sep 17 00:00:00 2001 From: xtr4nge Date: Sun, 24 Jan 2016 13:17:44 +0000 Subject: [PATCH] monitor mode (mon0) has been fixed --- FruityWifi/www/functions.php | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/FruityWifi/www/functions.php b/FruityWifi/www/functions.php index c078697..60e77e0 100644 --- a/FruityWifi/www/functions.php +++ b/FruityWifi/www/functions.php @@ -126,21 +126,35 @@ function module_deb($mod_name) { function start_monitor_mode($iface) { // START MONITOR MODE (mon0) - $iface_mon0 = exec("/sbin/ifconfig |grep mon0"); - if ($iface_mon0 == "") { + //$iface_mon0 = exec("/sbin/ifconfig |grep mon0"); + + stop_monitor_mode($iface); + + //if ($iface_mon0 == "") { //$exec = "/usr/sbin/airmon-ng start $iface"; $exec = "rfkill unblock wifi; sudo rfkill unblock all"; exec_fruitywifi($exec); + $exec = "ifconfig $iface down"; + exec_fruitywifi($exec); + $phy = getPHY($iface); $exec = "iw phy $phy interface add mon0 type monitor"; exec_fruitywifi($exec); + sleep(1); + + $exec = "ifconfig mon0 down"; + exec_fruitywifi($exec); + + $exec = "iwconfig mon0 mode monitor"; + exec_fruitywifi($exec); + $exec = "ifconfig mon0 up"; exec_fruitywifi($exec); - } + //} } function stop_monitor_mode($iface) {