Maintenance for a few modules (#42)

This commit is contained in:
WM
2018-08-27 02:32:32 +02:00
committed by Sebastian Kinne
parent 13b3c40d76
commit a5d7d19cd5
161 changed files with 16954 additions and 10056 deletions

View File

@@ -1,18 +1,19 @@
<?php namespace pineapple;
putenv('LD_LIBRARY_PATH='.getenv('LD_LIBRARY_PATH').':/sd/lib:/sd/usr/lib');
putenv('PATH='.getenv('PATH').':/sd/usr/bin:/sd/usr/sbin');
class Deauth extends Module
{
public function route()
public function route()
{
switch ($this->request->action) {
case 'refreshInfo':
$this->refreshInfo();
break;
case 'refreshOutput':
$this->refreshOutput();
break;
case 'refreshOutput':
$this->refreshOutput();
break;
case 'refreshStatus':
$this->refreshStatus();
break;
@@ -25,285 +26,255 @@ class Deauth extends Module
case 'handleDependenciesStatus':
$this->handleDependenciesStatus();
break;
case 'getInterfaces':
case 'getInterfaces':
$this->getInterfaces();
break;
case 'scanForNetworks':
$this->scanForNetworks();
break;
case 'getSettings':
$this->getSettings();
break;
case 'setSettings':
$this->setSettings();
break;
case 'saveAutostartSettings':
$this->saveAutostartSettings();
break;
case 'togglemdk3OnBoot':
$this->togglemdk3OnBoot();
break;
case 'getListsData':
$this->getListsData();
break;
case 'saveListsData':
$this->saveListsData();
break;
case 'scanForNetworks':
$this->scanForNetworks();
break;
case 'getSettings':
$this->getSettings();
break;
case 'setSettings':
$this->setSettings();
break;
case 'saveAutostartSettings':
$this->saveAutostartSettings();
break;
case 'togglemdk3OnBoot':
$this->togglemdk3OnBoot();
break;
case 'getListsData':
$this->getListsData();
break;
case 'saveListsData':
$this->saveListsData();
break;
}
}
protected function checkDependency($dependencyName)
{
return ((exec("which {$dependencyName}") == '' ? false : true) && ($this->uciGet("deauth.module.installed")));
}
protected function checkDependency($dependencyName)
{
return ((exec("which {$dependencyName}") == '' ? false : true) && ($this->uciGet("deauth.module.installed")));
}
protected function getDevice()
{
return trim(exec("cat /proc/cpuinfo | grep machine | awk -F: '{print $2}'"));
}
protected function getDevice()
{
return trim(exec("cat /proc/cpuinfo | grep machine | awk -F: '{print $2}'"));
}
protected function refreshInfo()
{
$moduleInfo = @json_decode(file_get_contents("/pineapple/modules/Deauth/module.info"));
$this->response = array('title' => $moduleInfo->title, 'version' => $moduleInfo->version);
}
protected function refreshInfo()
{
$moduleInfo = @json_decode(file_get_contents("/pineapple/modules/Deauth/module.info"));
$this->response = array('title' => $moduleInfo->title, 'version' => $moduleInfo->version);
}
private function handleDependencies()
{
if(!$this->checkDependency("mdk3"))
{
$this->execBackground("/pineapple/modules/Deauth/scripts/dependencies.sh install ".$this->request->destination);
$this->response = array('success' => true);
}
else
{
$this->execBackground("/pineapple/modules/Deauth/scripts/dependencies.sh remove");
$this->response = array('success' => true);
}
}
if (!$this->checkDependency("mdk3")) {
$this->execBackground("/pineapple/modules/Deauth/scripts/dependencies.sh install ".$this->request->destination);
$this->response = array('success' => true);
} else {
$this->execBackground("/pineapple/modules/Deauth/scripts/dependencies.sh remove");
$this->response = array('success' => true);
}
}
private function togglemdk3OnBoot()
{
if(exec("cat /etc/rc.local | grep Deauth/scripts/autostart_deauth.sh") == "")
{
exec("sed -i '/exit 0/d' /etc/rc.local");
exec("echo /pineapple/modules/Deauth/scripts/autostart_deauth.sh >> /etc/rc.local");
exec("echo exit 0 >> /etc/rc.local");
}
else
{
exec("sed -i '/Deauth\/scripts\/autostart_deauth.sh/d' /etc/rc.local");
}
}
private function togglemdk3OnBoot()
{
if (exec("cat /etc/rc.local | grep Deauth/scripts/autostart_deauth.sh") == "") {
exec("sed -i '/exit 0/d' /etc/rc.local");
exec("echo /pineapple/modules/Deauth/scripts/autostart_deauth.sh >> /etc/rc.local");
exec("echo exit 0 >> /etc/rc.local");
} else {
exec("sed -i '/Deauth\/scripts\/autostart_deauth.sh/d' /etc/rc.local");
}
}
private function handleDependenciesStatus()
{
if (!file_exists('/tmp/Deauth.progress'))
{
$this->response = array('success' => true);
}
else
{
$this->response = array('success' => false);
if (!file_exists('/tmp/Deauth.progress')) {
$this->response = array('success' => true);
} else {
$this->response = array('success' => false);
}
}
private function togglemdk3()
{
if(!$this->checkRunning("mdk3"))
{
$this->uciSet("deauth.run.interface", $this->request->interface);
if (!$this->checkRunning("mdk3")) {
$this->uciSet("deauth.run.interface", $this->request->interface);
$this->execBackground("/pineapple/modules/Deauth/scripts/deauth.sh start");
}
else
{
$this->uciSet("deauth.run.interface", '');
$this->execBackground("/pineapple/modules/Deauth/scripts/deauth.sh start");
} else {
$this->uciSet("deauth.run.interface", '');
$this->execBackground("/pineapple/modules/Deauth/scripts/deauth.sh stop");
}
}
$this->execBackground("/pineapple/modules/Deauth/scripts/deauth.sh stop");
}
}
private function refreshStatus()
{
if (!file_exists('/tmp/Deauth.progress'))
{
if (!$this->checkDependency("mdk3"))
{
$installed = false;
$install = "Not installed";
$installLabel = "danger";
$processing = false;
if (!file_exists('/tmp/Deauth.progress')) {
if (!$this->checkDependency("mdk3")) {
$installed = false;
$install = "Not installed";
$installLabel = "danger";
$processing = false;
$status = "Start";
$statusLabel = "success";
$status = "Start";
$statusLabel = "success";
$bootLabelON = "default";
$bootLabelOFF = "danger";
}
else
{
$installed = true;
$install = "Installed";
$installLabel = "success";
$processing = false;
$bootLabelON = "default";
$bootLabelOFF = "danger";
} else {
$installed = true;
$install = "Installed";
$installLabel = "success";
$processing = false;
if ($this->checkRunning("mdk3"))
{
$status = "Stop";
$statusLabel = "danger";
}
else
{
$status = "Start";
$statusLabel = "success";
}
if ($this->checkRunning("mdk3")) {
$status = "Stop";
$statusLabel = "danger";
} else {
$status = "Start";
$statusLabel = "success";
}
if(exec("cat /etc/rc.local | grep Deauth/scripts/autostart_deauth.sh") == "")
{
$bootLabelON = "default";
$bootLabelOFF = "danger";
}
else
{
$bootLabelON = "success";
$bootLabelOFF = "default";
}
}
if (exec("cat /etc/rc.local | grep Deauth/scripts/autostart_deauth.sh") == "") {
$bootLabelON = "default";
$bootLabelOFF = "danger";
} else {
$bootLabelON = "success";
$bootLabelOFF = "default";
}
}
} else {
$installed = false;
$install = "Installing...";
$installLabel = "warning";
$processing = true;
$status = "Start";
$statusLabel = "success";
$bootLabelON = "default";
$bootLabelOFF = "danger";
}
else
{
$installed = false;
$install = "Installing...";
$installLabel = "warning";
$processing = true;
$status = "Start";
$statusLabel = "success";
$device = $this->getDevice();
$sdAvailable = $this->isSDAvailable();
$bootLabelON = "default";
$bootLabelOFF = "danger";
$this->response = array("device" => $device, "sdAvailable" => $sdAvailable, "status" => $status, "statusLabel" => $statusLabel, "installed" => $installed, "install" => $install, "installLabel" => $installLabel, "bootLabelON" => $bootLabelON, "bootLabelOFF" => $bootLabelOFF, "processing" => $processing);
}
$device = $this->getDevice();
$sdAvailable = $this->isSDAvailable();
private function refreshOutput()
{
if ($this->checkDependency("mdk3")) {
if ($this->checkRunning("mdk3")) {
exec("cat /tmp/deauth.log", $output);
if (!empty($output)) {
$this->response = implode("\n", array_reverse($output));
} else {
$this->response = "Empty log...";
}
} else {
$this->response = "Deauth is not running...";
}
} else {
$this->response = "mdk3 is not installed...";
}
}
$this->response = array("device" => $device, "sdAvailable" => $sdAvailable, "status" => $status, "statusLabel" => $statusLabel, "installed" => $installed, "install" => $install, "installLabel" => $installLabel, "bootLabelON" => $bootLabelON, "bootLabelOFF" => $bootLabelOFF, "processing" => $processing);
}
private function getInterfaces()
{
exec("iwconfig 2> /dev/null | grep \"wlan*\" | awk '{print $1}'", $interfaceArray);
private function refreshOutput()
{
if ($this->checkDependency("mdk3"))
{
if ($this->checkRunning("mdk3"))
{
exec ("cat /tmp/deauth.log", $output);
if(!empty($output))
$this->response = implode("\n", array_reverse($output));
else
$this->response = "Empty log...";
}
else
{
$this->response = "Deauth is not running...";
}
}
else
{
$this->response = "mdk3 is not installed...";
}
}
$this->response = array("interfaces" => $interfaceArray, "selected" => $this->uciGet("deauth.run.interface"));
}
private function getInterfaces()
{
exec("iwconfig 2> /dev/null | grep \"wlan*\" | awk '{print $1}'", $interfaceArray);
private function scanForNetworks()
{
$interface = escapeshellarg($this->request->interface);
if (substr($interface, -4, -1) === "mon") {
if ($interface == "'wlan1mon'") {
exec("killall pineap");
exec("killall pinejector");
}
exec("airmon-ng stop {$interface}");
$interface = substr($interface, 0, -4) . "'";
exec("iw dev {$interface} scan &> /dev/null");
}
exec("iwinfo {$interface} scan", $apScan);
$this->response = array("interfaces" => $interfaceArray, "selected" => $this->uciGet("deauth.run.interface"));
}
$apArray = preg_split("/^Cell/m", implode("\n", $apScan));
$returnArray = array();
foreach ($apArray as $apData) {
$apData = explode("\n", $apData);
$accessPoint = array();
$accessPoint['mac'] = substr($apData[0], -17);
$accessPoint['ssid'] = substr(trim($apData[1]), 8, -1);
if (mb_detect_encoding($accessPoint['ssid'], "auto") === false) {
continue;
}
private function scanForNetworks()
{
$interface = escapeshellarg($this->request->interface);
if (substr($interface, -4, -1) === "mon") {
if ($interface == "'wlan1mon'") {
exec("killall pineap");
exec("killall pinejector");
}
exec("airmon-ng stop {$interface}");
$interface = substr($interface, 0, -4) . "'";
exec("iw dev {$interface} scan &> /dev/null");
}
exec("iwinfo {$interface} scan", $apScan);
$accessPoint['channel'] = intval(substr(trim($apData[2]), -2));
$apArray = preg_split("/^Cell/m", implode("\n", $apScan));
$returnArray = array();
foreach ($apArray as $apData) {
$apData = explode("\n", $apData);
$accessPoint = array();
$accessPoint['mac'] = substr($apData[0], -17);
$accessPoint['ssid'] = substr(trim($apData[1]), 8, -1);
if (mb_detect_encoding($accessPoint['ssid'], "auto") === false) {
continue;
}
$signalString = explode(" ", trim($apData[3]));
$accessPoint['signal'] = substr($signalString[0], 8);
$accessPoint['quality'] = substr($signalString[1], 9);
$accessPoint['channel'] = intval(substr(trim($apData[2]), -2));
$security = substr(trim($apData[4]), 12);
if ($security === "none") {
$accessPoint['security'] = "Open";
} else {
$accessPoint['security'] = $security;
}
$signalString = explode(" ", trim($apData[3]));
$accessPoint['signal'] = substr($signalString[0], 8);
$accessPoint['quality'] = substr($signalString[1], 9);
if ($accessPoint['mac'] && trim($apData[1]) !== "ESSID: unknown") {
array_push($returnArray, $accessPoint);
}
}
$this->response = $returnArray;
}
$security = substr(trim($apData[4]), 12);
if ($security === "none") {
$accessPoint['security'] = "Open";
} else {
$accessPoint['security'] = $security;
}
private function getSettings()
{
$settings = array(
'speed' => $this->uciGet("deauth.settings.speed"),
'channels' => $this->uciGet("deauth.settings.channels"),
'mode' => $this->uciGet("deauth.settings.mode")
);
$this->response = array('settings' => $settings);
}
if ($accessPoint['mac'] && trim($apData[1]) !== "ESSID: unknown") {
array_push($returnArray, $accessPoint);
}
}
$this->response = $returnArray;
}
private function setSettings()
{
$settings = $this->request->settings;
$this->uciSet("deauth.settings.speed", $settings->speed);
$this->uciSet("deauth.settings.channels", $settings->channels);
$this->uciSet("deauth.settings.mode", $settings->mode);
}
private function getSettings()
{
$settings = array(
'speed' => $this->uciGet("deauth.settings.speed"),
'channels' => $this->uciGet("deauth.settings.channels"),
'mode' => $this->uciGet("deauth.settings.mode")
);
$this->response = array('settings' => $settings);
}
private function saveAutostartSettings()
{
$settings = $this->request->settings;
$this->uciSet("deauth.autostart.interface", $settings->interface);
}
private function setSettings()
{
$settings = $this->request->settings;
$this->uciSet("deauth.settings.speed", $settings->speed);
$this->uciSet("deauth.settings.channels", $settings->channels);
$this->uciSet("deauth.settings.mode", $settings->mode);
}
private function getListsData()
{
$blacklistData = file_get_contents('/pineapple/modules/Deauth/lists/blacklist.lst');
$whitelistData = file_get_contents('/pineapple/modules/Deauth/lists/whitelist.lst');
$this->response = array("blacklistData" => $blacklistData, "whitelistData" => $whitelistData );
}
private function saveAutostartSettings()
{
$settings = $this->request->settings;
$this->uciSet("deauth.autostart.interface", $settings->interface);
}
private function getListsData()
{
$blacklistData = file_get_contents('/pineapple/modules/Deauth/lists/blacklist.lst');
$whitelistData = file_get_contents('/pineapple/modules/Deauth/lists/whitelist.lst');
$this->response = array("blacklistData" => $blacklistData, "whitelistData" => $whitelistData );
}
private function saveListsData()
{
$filename = '/pineapple/modules/Deauth/lists/blacklist.lst';
file_put_contents($filename, $this->request->blacklistData);
$filename = '/pineapple/modules/Deauth/lists/whitelist.lst';
file_put_contents($filename, $this->request->whitelistData);
}
private function saveListsData()
{
$filename = '/pineapple/modules/Deauth/lists/blacklist.lst';
file_put_contents($filename, $this->request->blacklistData);
$filename = '/pineapple/modules/Deauth/lists/whitelist.lst';
file_put_contents($filename, $this->request->whitelistData);
}
}

View File

@@ -2,17 +2,17 @@ registerController('Deauth_Controller', ['$api', '$scope', '$rootScope', '$inter
$scope.title = "Loading...";
$scope.version = "Loading...";
$scope.refreshInfo = (function() {
$scope.refreshInfo = (function() {
$api.request({
module: 'Deauth',
action: "refreshInfo"
}, function(response) {
$scope.title = response.title;
$scope.version = "v"+response.version;
})
});
module: 'Deauth',
action: "refreshInfo"
}, function(response) {
$scope.title = response.title;
$scope.version = "v" + response.version;
})
});
$scope.refreshInfo();
$scope.refreshInfo();
}]);
@@ -37,32 +37,32 @@ registerController('Deauth_ControlsController', ['$api', '$scope', '$rootScope',
$scope.sdAvailable = false;
$rootScope.status = {
installed : false,
refreshOutput : false
installed: false,
refreshOutput: false
};
$scope.refreshStatus = (function() {
$scope.refreshStatus = (function() {
$api.request({
module: 'Deauth',
action: "refreshStatus"
}, function(response) {
$scope.status = response.status;
$scope.statusLabel = response.statusLabel;
module: 'Deauth',
action: "refreshStatus"
}, function(response) {
$scope.status = response.status;
$scope.statusLabel = response.statusLabel;
$rootScope.status.installed = response.installed;
$scope.device = response.device;
$scope.sdAvailable = response.sdAvailable;
if(response.processing) $scope.processing = true;
$scope.install = response.install;
$scope.installLabel = response.installLabel;
$rootScope.status.installed = response.installed;
$scope.device = response.device;
$scope.sdAvailable = response.sdAvailable;
if (response.processing) $scope.processing = true;
$scope.install = response.install;
$scope.installLabel = response.installLabel;
$scope.bootLabelON = response.bootLabelON;
$scope.bootLabelOFF = response.bootLabelOFF;
})
});
$scope.bootLabelON = response.bootLabelON;
$scope.bootLabelOFF = response.bootLabelOFF;
})
});
$scope.togglemdk3 = (function() {
if($scope.status != "Stop")
$scope.togglemdk3 = (function() {
if ($scope.status != "Stop")
$scope.status = "Starting...";
else
$scope.status = "Stopping...";
@@ -73,146 +73,142 @@ registerController('Deauth_ControlsController', ['$api', '$scope', '$rootScope',
$rootScope.status.refreshOutput = false;
$api.request({
module: 'Deauth',
action: 'togglemdk3',
interface: $scope.selectedInterface
}, function(response) {
$timeout(function(){
$rootScope.status.refreshOutput = true;
module: 'Deauth',
action: 'togglemdk3',
interface: $scope.selectedInterface
}, function(response) {
$timeout(function() {
$rootScope.status.refreshOutput = true;
$scope.starting = false;
$scope.refreshStatus();
$scope.getInterfaces();
$scope.starting = false;
$scope.refreshStatus();
$scope.getInterfaces();
}, 3000);
})
}, 3000);
})
});
$scope.saveAutostartSettings = (function() {
$api.request({
module: 'Deauth',
action: 'saveAutostartSettings',
settings: { interface : $scope.selectedInterface }
}, function(response) {
$scope.saveSettingsLabel = "success";
$timeout(function(){
$scope.saveSettingsLabel = "default";
}, 2000);
})
});
module: 'Deauth',
action: 'saveAutostartSettings',
settings: {
interface: $scope.selectedInterface
}
}, function(response) {
$scope.saveSettingsLabel = "success";
$timeout(function() {
$scope.saveSettingsLabel = "default";
}, 2000);
})
});
$scope.togglemdk3OnBoot = (function() {
if($scope.bootLabelON == "default")
{
$scope.togglemdk3OnBoot = (function() {
if ($scope.bootLabelON == "default") {
$scope.bootLabelON = "success";
$scope.bootLabelOFF = "default";
}
else
{
} else {
$scope.bootLabelON = "default";
$scope.bootLabelOFF = "danger";
}
$api.request({
module: 'Deauth',
action: 'togglemdk3OnBoot',
}, function(response) {
$scope.refreshStatus();
})
});
module: 'Deauth',
action: 'togglemdk3OnBoot',
}, function(response) {
$scope.refreshStatus();
})
});
$scope.handleDependencies = (function(param) {
if(!$rootScope.status.installed)
$scope.handleDependencies = (function(param) {
if (!$rootScope.status.installed)
$scope.install = "Installing...";
else
$scope.install = "Removing...";
$api.request({
module: 'Deauth',
action: 'handleDependencies',
destination: param
}, function(response){
if (response.success === true) {
module: 'Deauth',
action: 'handleDependencies',
destination: param
}, function(response) {
if (response.success === true) {
$scope.installLabel = "warning";
$scope.processing = true;
$scope.handleDependenciesInterval = $interval(function(){
$api.request({
module: 'Deauth',
action: 'handleDependenciesStatus'
}, function(response) {
if (response.success === true){
$scope.processing = false;
$interval.cancel($scope.handleDependenciesInterval);
$scope.refreshStatus();
}
});
}, 5000);
}
});
});
$scope.handleDependenciesInterval = $interval(function() {
$api.request({
module: 'Deauth',
action: 'handleDependenciesStatus'
}, function(response) {
if (response.success === true) {
$scope.processing = false;
$interval.cancel($scope.handleDependenciesInterval);
$scope.refreshStatus();
}
});
}, 5000);
}
});
});
$scope.getInterfaces = (function() {
$api.request({
module: 'Deauth',
action: 'getInterfaces'
}, function(response) {
$scope.interfaces = response.interfaces;
if(response.selected != "")
$scope.selectedInterface = response.selected;
else
$scope.selectedInterface = $scope.interfaces[0];
});
});
$scope.getInterfaces = (function() {
$api.request({
module: 'Deauth',
action: 'getInterfaces'
}, function(response) {
$scope.interfaces = response.interfaces;
if (response.selected != "")
$scope.selectedInterface = response.selected;
else
$scope.selectedInterface = $scope.interfaces[0];
});
});
$scope.refreshStatus();
$scope.getInterfaces();
$scope.refreshStatus();
$scope.getInterfaces();
}]);
registerController('Deauth_OutputController', ['$api', '$scope', '$rootScope', '$interval', function($api, $scope, $rootScope, $interval) {
$scope.output = 'Loading...';
$scope.output = 'Loading...';
$scope.filter = '';
$scope.refreshLabelON = "default";
$scope.refreshLabelOFF = "danger";
$scope.refreshOutput = (function() {
$scope.refreshOutput = (function() {
$api.request({
module: 'Deauth',
action: "refreshOutput"
}, function(response) {
$scope.output = response;
})
});
module: 'Deauth',
action: "refreshOutput"
}, function(response) {
$scope.output = response;
})
});
$scope.toggleAutoRefresh = (function() {
if($scope.autoRefreshInterval)
{
$scope.toggleAutoRefresh = (function() {
if ($scope.autoRefreshInterval) {
$interval.cancel($scope.autoRefreshInterval);
$scope.autoRefreshInterval = null;
$scope.refreshLabelON = "default";
$scope.refreshLabelOFF = "danger";
}
else
{
} else {
$scope.refreshLabelON = "success";
$scope.refreshLabelOFF = "default";
$scope.autoRefreshInterval = $interval(function(){
$scope.autoRefreshInterval = $interval(function() {
$scope.refreshOutput();
}, 5000);
}, 5000);
}
});
});
$scope.refreshOutput();
$scope.refreshOutput();
$rootScope.$watch('status.refreshOutput', function(param) {
if(param) {
$scope.refreshOutput();
}
});
$rootScope.$watch('status.refreshOutput', function(param) {
if (param) {
$scope.refreshOutput();
}
});
}]);
@@ -260,116 +256,116 @@ registerController('Deauth_EditorController', ['$api', '$scope', '$rootScope', '
blacklistData: $scope.blacklistData,
whitelistData: $scope.whitelistData
}, function(response) {
$scope.saveListsLabel = "success";
$scope.saveLists = "Saved";
$scope.saveListsLabel = "success";
$scope.saveLists = "Saved";
$timeout(function(){
$scope.saveListsLabel = "primary";
$scope.saveLists = "Save";
$scope.saving = false;
}, 2000);
$timeout(function() {
$scope.saveListsLabel = "primary";
$scope.saveLists = "Save";
$scope.saving = false;
}, 2000);
});
});
$scope.addWhitelist = (function() {
if($scope.whitelistData != "")
if ($scope.whitelistData != "")
$scope.whitelistData = $scope.whitelistData + '\n' + '# ' + $scope.selectedAP.ssid + '\n' + $scope.selectedAP.mac;
else
$scope.whitelistData = '# ' + $scope.selectedAP.ssid + '\n' + $scope.selectedAP.mac;
});
$scope.addBlacklist = (function() {
if($scope.blacklistData != "")
if ($scope.blacklistData != "")
$scope.blacklistData = $scope.blacklistData + '\n' + '# ' + $scope.selectedAP.ssid + '\n' + $scope.selectedAP.mac;
else
$scope.blacklistData = '# ' + $scope.selectedAP.ssid + '\n' + $scope.selectedAP.mac;
});
$scope.scanForNetworks = (function() {
$scope.scanLabel = "warning";
$scope.scan = "Scanning...";
$scope.scanning = true;
$scope.scanLabel = "warning";
$scope.scan = "Scanning...";
$scope.scanning = true;
$api.request({
module: 'Deauth',
action: 'scanForNetworks',
interface: $scope.selectedInterface
}, function(response) {
$scope.scanLabel = "success";
$scope.scan = "Done";
$api.request({
module: 'Deauth',
action: 'scanForNetworks',
interface: $scope.selectedInterface
}, function(response) {
$scope.scanLabel = "success";
$scope.scan = "Done";
$timeout(function(){
$scope.scanLabel = "default";
$scope.scan = "Scan";
$scope.scanning = false;
}, 2000);
$timeout(function() {
$scope.scanLabel = "default";
$scope.scan = "Scan";
$scope.scanning = false;
}, 2000);
$scope.accessPoints = response;
$scope.selectedAP = $scope.accessPoints[0];
});
$scope.accessPoints = response;
$scope.selectedAP = $scope.accessPoints[0];
});
});
$scope.getInterfaces = (function() {
$api.request({
module: 'Deauth',
action: 'getInterfaces'
}, function(response) {
$scope.interfaces = response.interfaces;
if(response.selected != "")
$scope.selectedInterface = response.selected;
else
$scope.selectedInterface = $scope.interfaces[0];
});
module: 'Deauth',
action: 'getInterfaces'
}, function(response) {
$scope.interfaces = response.interfaces;
if (response.selected != "")
$scope.selectedInterface = response.selected;
else
$scope.selectedInterface = $scope.interfaces[0];
});
});
$scope.getInterfaces();
$scope.getListsData();
$scope.getInterfaces();
$scope.getListsData();
}]);
registerController('Deauth_SettingsController', ['$api', '$scope', '$rootScope', '$timeout', function($api, $scope, $rootScope, $timeout) {
$scope.settings = {
speed : "",
channels : "",
mode : "whitelist"
};
$scope.settings = {
speed: "",
channels: "",
mode: "whitelist"
};
$scope.saveSettingsLabel = "primary";
$scope.saveSettings = "Save";
$scope.saving = false;
$scope.saveSettingsLabel = "primary";
$scope.saveSettings = "Save";
$scope.saving = false;
$scope.getSettings = function() {
$api.request({
module: 'Deauth',
action: 'getSettings'
}, function(response) {
$scope.settings = response.settings;
});
};
$scope.getSettings = function() {
$api.request({
module: 'Deauth',
action: 'getSettings'
}, function(response) {
$scope.settings = response.settings;
});
};
$scope.setSettings = function() {
$scope.saveSettingsLabel = "warning";
$scope.saveSettings = "Saving...";
$scope.saving = true;
$scope.setSettings = function() {
$scope.saveSettingsLabel = "warning";
$scope.saveSettings = "Saving...";
$scope.saving = true;
$api.request({
module: 'Deauth',
action: 'setSettings',
settings: $scope.settings
}, function(response) {
$scope.getSettings();
$api.request({
module: 'Deauth',
action: 'setSettings',
settings: $scope.settings
}, function(response) {
$scope.getSettings();
$scope.saveSettingsLabel = "success";
$scope.saveSettings = "Saved";
$scope.saveSettingsLabel = "success";
$scope.saveSettings = "Saved";
$timeout(function(){
$scope.saveSettingsLabel = "primary";
$scope.saveSettings = "Save";
$scope.saving = false;
}, 2000);
});
};
$timeout(function() {
$scope.saveSettingsLabel = "primary";
$scope.saveSettings = "Save";
$scope.saving = false;
}, 2000);
});
};
$scope.getSettings();
$scope.getSettings();
}]);

View File

@@ -6,5 +6,5 @@
"tetra"
],
"title": "Deauth",
"version": "1.5"
"version": "1.6"
}

View File

@@ -101,7 +101,7 @@ if [ "$1" = "start" ]; then
mdk3 ${MYMONITOR} d ${SPEED} ${CHANNEL} ${MODE} >> ${LOG} &
elif [ "$1" = "stop" ]; then
killall -9 mdk3
killall -9 mdk3
rm ${TMPBLACKLIST}
rm ${TMPWHITELIST}
rm ${LOG}

View File

@@ -12,8 +12,8 @@ touch /tmp/Deauth.progress
if [ "$1" = "install" ]; then
if [ "$2" = "internal" ]; then
opkg update
opkg install mdk3
opkg update
opkg install mdk3
elif [ "$2" = "sd" ]; then
opkg update
opkg install mdk3 --dest sd