include "../config/config.php"; include "../functions.php"; // Checking POST & GET variables... if ($regex == 1) { regex_standard($_GET["service"], "../msg.php", $regex_extra); regex_standard($_GET["file"], "../msg.php", $regex_extra); regex_standard($_GET["action"], "../msg.php", $regex_extra); regex_standard($iface_wifi_extra, "../msg.php", $regex_extra); } $service = $_GET['service']; $action = $_GET['action']; $page = $_GET['page']; if ($service == "kismet") { if ($action == "start") { // START MONITOR MODE (mon0) start_monitor_mode($iface_wifi_extra); //$exec = "/usr/bin/kismet_server -p ../logs/kismet/ -s --daemonize -c $iface_wifi_extra > /dev/null &"; $exec = "/usr/bin/kismet_server -p ../logs/kismet/ -s --daemonize -c mon0 > /dev/null &"; exec("/usr/share/FruityWifi/bin/danger \"" . $exec . "\""); } else { if ($action == "stop") { $exec = "/usr/bin/killall kismet_server"; exec("/usr/share/FruityWifi/bin/danger \"" . $exec . "\""); } } //header('Location: page_status.php'); //echo "<script>window.location = './action.php'</script>"; } if ($service == "gpsd") { if ($action == "start") { $exec = "/usr/sbin/gpsd /dev/ttyUSB0 &";
if (isset($_POST["iface"]) and $_POST["iface"] == "internet") { echo "internet:" . $_POST["io_out_iface"]; } if (isset($_POST["iface"]) and $_POST["iface"] == "wifi") { echo "wifi:" . $_POST["io_in_iface"]; } if (isset($_POST["iface"]) and $_POST["iface"] == "wifi_extra") { echo "wifi extra:" . $_POST["io_in_iface_extra"]; } if (isset($_POST["iface"]) and $_POST["iface"] == "wifi_supplicant") { echo "wifi supplicant:" . $_POST["iface_supplicant"]; } if ($_GET["service"] == "mon0") { if ($_GET["action"] == "start") { // START MONITOR MODE (mon0) start_monitor_mode($io_in_iface_extra); } else { // STOP MONITOR MODE (mon0) stop_monitor_mode($io_in_iface_extra); } } // -------------- WIRELESS ------------------ if (isset($_POST[newSSID])) { $hostapd_ssid = $_POST[newSSID]; $exec = "sed -i 's/hostapd_ssid=.*/hostapd_ssid=\\\"" . $_POST[newSSID] . "\\\";/g' ./config/config.php"; exec_fruitywifi($exec); $exec = "/usr/sbin/karma-hostapd_cli -p /var/run/hostapd-phy0 karma_change_ssid {$_POST['newSSID']}"; exec_fruitywifi($exec); // replace interface in hostapd.conf and hostapd-secure.conf $exec = "/bin/sed -i 's/^ssid=.*/ssid=" . $_POST["newSSID"] . "/g' /usr/share/fruitywifi/conf/hostapd.conf"; exec_fruitywifi($exec);
public function setMonitorMode($iface, $action) { //include "../../../functions.php"; if ($action == "start") { start_monitor_mode($iface); } if ($action == "stop") { stop_monitor_mode($iface); } echo json_encode(true); }