function cleanTAP()
{
    global $tap1_iface;
    global $tap2_iface;
    global $bin_ifconfig;
    global $tap2_set;
    // CLEAN
    $exec = "/etc/init.d/dhcpcd stop";
    exec_fruitywifi($exec);
    killRegex("dhcpcd.+{$tap2_iface}");
    $exec = "{$bin_ifconfig} {$tap1_iface} down";
    exec_fruitywifi($exec);
    $exec = "{$bin_ifconfig} {$tap1_iface} 0.0.0.0";
    exec_fruitywifi($exec);
    if ($tap2_set != "3") {
        // TAP2 SET: CURRENT
        $exec = "{$bin_ifconfig} {$tap2_iface} down";
        exec_fruitywifi($exec);
        $exec = "{$bin_ifconfig} {$tap2_iface} 0.0.0.0";
        exec_fruitywifi($exec);
    }
}
            exec_fruitywifi($exec);
            $exec = "$bin_sed -i '/\[keyfile\]/d' /etc/NetworkManager/NetworkManager.conf";
            exec_fruitywifi($exec);
            */
            // REMOVE lines from NetworkManager
            cleanNetworkManager();
            $exec = "{$bin_killall} hostapd";
            exec_fruitywifi($exec);
            killRegex("hostapd");
            $exec = "{$bin_rm} /var/run/hostapd-phy0/{$io_in_iface}";
            exec_fruitywifi($exec);
            $exec = "chattr -i /etc/resolv.conf";
            exec_fruitywifi($exec);
            $exec = "{$bin_killall} dnsmasq";
            exec_fruitywifi($exec);
            killRegex("dnsmasq");
            $exec = "ip addr flush dev {$io_in_iface}";
            exec_fruitywifi($exec);
            $exec = "{$bin_ifconfig} {$io_in_iface} down";
            exec_fruitywifi($exec);
            // IPTABLES	FLUSH
            flushIptables();
        }
    }
}
// HOSTAPD KARMA
if ($service == "wireless" and $ap_mode == "4") {
    if ($action == "start") {
        /*
        //unmanaged-devices=mac:<realmac>;interface-name:wlan2
        //macchanger --show wlan0 |grep "Permanent"
Beispiel #3
0
        if ($action == "stop") {
            // REMOVE lines from NetworkManager
            cleanNetworkManager();
            $exec = "{$bin_killall} hostapd";
            exec_fruitywifi($exec);
            killRegex("hostapd");
            $exec = "{$bin_rm} /var/run/hostapd/{$io_in_iface}";
            exec_fruitywifi($exec);
            /*
            $exec = "chattr -i /etc/resolv.conf";
            exec_fruitywifi($exec);
            */
            $exec = "{$bin_killall} dnsmasq";
            exec_fruitywifi($exec);
            killRegex("dnsmasq");
            killRegex("dnschef.py");
            // IN IFACE DOWN
            setInIfaceDown();
            // IPTABLES	FLUSH
            if ($mod_nethunter == "1") {
                flushIptablesNetHunter();
                setIptablesRestore();
            } else {
                flushIptables();
            }
            // LOGS COPY
            copyLogsHistory();
        }
    }
}
if ($install == "install_{$mod_name}") {
    exec_fruitywifi($exec);
    if ($mod_pkt_type != "") {
        $options_type = "-t {$mod_pkt_type}";
    }
    if ($mod_pkt_subtype != "") {
        $options_subtype = "-s {$mod_pkt_subtype}";
    }
    if ($mod_pkt_channel != "") {
        $options_channel = "-c {$mod_pkt_channel}";
    }
    $exec = "python scan-recon.py -i mon0 {$options_type} {$options_subtype} {$options_channel} -l {$mod_logs} > /dev/null 2 &";
    exec_fruitywifi($exec);
} else {
    if ($action == "stop") {
        killRegex("scan-recon");
        killRegex("scan-recon");
        // LOGS COPY
        copyLogsHistory();
    }
}
if ($install == "install_{$mod_name}") {
    $exec = "chmod 755 install.sh";
    exec_fruitywifi($exec);
    $exec = "{$bin_sudo} ./install.sh > {$log_path}/install.txt &";
    exec_fruitywifi($exec);
    header("Location: ../../install.php?module={$mod_name}");
    exit;
}
if ($page == "status") {
    header("Location: ../../../action.php");
} else {
Beispiel #5
0
        exec_fruitywifi($exec);
        $exec = "{$bin_iptables} -t nat -A POSTROUTING -o {$io_out_iface} -j MASQUERADE";
        exec_fruitywifi($exec);
        // CLEAN DHCP log
        $exec = "{$bin_echo} '' > /usr/share/fruitywifi/logs/dhcp.leases";
        exec_fruitywifi($exec);
    } else {
        if ($action == "stop") {
            // REMOVE lines from NetworkManager
            cleanNetworkManager();
            $exec = "{$bin_killall} airbase-ng";
            exec_fruitywifi($exec);
            killRegex("airbase-ng");
            $exec = "chattr -i /etc/resolv.conf";
            exec_fruitywifi($exec);
            killRegex("dnsmasq.+{$mod_name}.+dnsmasq");
            $exec = "/usr/bin/sudo /usr/sbin/airmon-ng stop mon0";
            exec_fruitywifi($exec);
            $exec = "ip addr flush dev at0";
            exec_fruitywifi($exec);
            $exec = "{$bin_ifconfig} at0 down";
            exec_fruitywifi($exec);
            // IPTABLES	FLUSH
            flushIptables();
            // LOGS COPY
            copyLogsHistory();
        }
    }
}
if ($install == "install_{$mod_name}") {
    $exec = "chmod 755 install.sh";