|
|
@@ -2,19 +2,16 @@ registerController('PMKIDAttack_Dependencies', ['$api', '$scope', '$rootScope',
|
|
|
$scope.install = "Loading...";
|
|
|
$scope.installLabel = "";
|
|
|
$scope.processing = false;
|
|
|
- $rootScope.installedDependencies = false;
|
|
|
- $rootScope.handshakeInfo = false;
|
|
|
- $rootScope.running = false;
|
|
|
- $rootScope.captureRunning = false;
|
|
|
+ $rootScope.pmkid_installedDependencies = false;
|
|
|
|
|
|
$scope.refreshStatus = function () {
|
|
|
- $rootScope.installedDependencies = false;
|
|
|
+ $rootScope.pmkid_installedDependencies = false;
|
|
|
|
|
|
$api.request({
|
|
|
module: "PMKIDAttack",
|
|
|
action: "getDependenciesStatus"
|
|
|
}, function (response) {
|
|
|
- $rootScope.installedDependencies = response.installed;
|
|
|
+ $rootScope.pmkid_installedDependencies = response.installed;
|
|
|
$scope.processing = response.processing;
|
|
|
$scope.install = response.install;
|
|
|
$scope.installLabel = response.installLabel;
|
|
|
@@ -41,7 +38,7 @@ registerController('PMKIDAttack_Dependencies', ['$api', '$scope', '$rootScope',
|
|
|
};
|
|
|
|
|
|
$scope.managerDependencies = function () {
|
|
|
- $scope.install = $rootScope.installedDependencies ? "Removing..." : "Installing...";
|
|
|
+ $scope.install = $rootScope.pmkid_installedDependencies ? "Removing..." : "Installing...";
|
|
|
$api.request({
|
|
|
module: 'PMKIDAttack',
|
|
|
action: 'managerDependencies'
|
|
|
@@ -57,470 +54,264 @@ registerController('PMKIDAttack_Dependencies', ['$api', '$scope', '$rootScope',
|
|
|
$scope.refreshStatus();
|
|
|
}]);
|
|
|
|
|
|
-registerController('PMKIDAttack_ScanSettings', ['$api', '$scope', '$rootScope', '$interval', '$timeout', '$cookies', function ($api, $scope, $rootScope, $interval, $timeout, $cookies) {
|
|
|
- $rootScope.accessPoints = [];
|
|
|
- $rootScope.unassociatedClients = [];
|
|
|
- $rootScope.outOfRangeClients = [];
|
|
|
+
|
|
|
+registerController('PMKIDAttack_ScanLoad', ['$api', '$scope', '$rootScope', '$timeout', function ($api, $scope, $rootScope, $timeout) {
|
|
|
$scope.scans = [];
|
|
|
+ $scope.scanLocation = "";
|
|
|
$scope.selectedScan = "";
|
|
|
$scope.loadedScan = null;
|
|
|
- $scope.scanType = '0';
|
|
|
- $scope.paused = false;
|
|
|
- $scope.percent = 0;
|
|
|
+ $scope.loadingScan = false;
|
|
|
$scope.error = false;
|
|
|
- $scope.pineAPDRunning = true;
|
|
|
- $scope.pineAPDStarting = false;
|
|
|
- $scope.percentageInterval = 300;
|
|
|
- $scope.wsAuthToken = "";
|
|
|
- $scope.scanSettings = {
|
|
|
- scanDuration: $cookies.get('scanDuration') !== undefined ? $cookies.get('scanDuration') : '0',
|
|
|
- live: $cookies.get('liveScan') !== undefined ? $cookies.get('liveScan') === 'true' : true
|
|
|
- };
|
|
|
+ $scope.scanID = null;
|
|
|
+ $scope.statusObtained = false;
|
|
|
|
|
|
- function checkScanStatus() {
|
|
|
- if ($scope.scanSettings.scanDuration < 1) {
|
|
|
- return;
|
|
|
- }
|
|
|
- if (!$scope.updatePercentageInterval) {
|
|
|
- $scope.updatePercentageInterval = $interval(function () {
|
|
|
- var percentage = $scope.percentageInterval / ($scope.scanSettings.scanDuration * 10);
|
|
|
- if (($scope.percent + percentage) >= 100 && $rootScope.running && !$scope.loading) {
|
|
|
- $scope.percent = 100;
|
|
|
- $scope.checkScan();
|
|
|
- } else if ($scope.percent + percentage < 100 && $rootScope.running) {
|
|
|
- $scope.percent += percentage;
|
|
|
- }
|
|
|
- }, $scope.percentageInterval);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- function parseScanResults(results) {
|
|
|
+ // helpers
|
|
|
+ $scope.parseScanResults = function (results) {
|
|
|
annotateMacs();
|
|
|
var data = results['results'];
|
|
|
- $rootScope.accessPoints = data['ap_list'];
|
|
|
- $rootScope.unassociatedClients = data['unassociated_clients'];
|
|
|
- $rootScope.outOfRangeClients = data['out_of_range_clients'];
|
|
|
+ $rootScope.pmkid_accessPoints = data['ap_list'];
|
|
|
+ $rootScope.pmkid_unassociatedClients = data['unassociated_clients'];
|
|
|
+ $rootScope.pmkid_outOfRangeClients = data['out_of_range_clients'];
|
|
|
}
|
|
|
|
|
|
- $scope.updateScanSettings = function () {
|
|
|
- $cookies.put('scanDuration', $scope.scanSettings.scanDuration);
|
|
|
- if ($scope.scanSettings.scanDuration === "0") {
|
|
|
- $scope.scanSettings.live = true;
|
|
|
- }
|
|
|
- $cookies.put('liveScan', $scope.scanSettings.live);
|
|
|
- ($cookies.getAll());
|
|
|
- };
|
|
|
-
|
|
|
- $scope.startScan = function () {
|
|
|
- $scope.percent = 0;
|
|
|
- if ($rootScope.running) {
|
|
|
- return;
|
|
|
- }
|
|
|
- if ($scope.scanSettings.scanDuration === "0") {
|
|
|
- $scope.scanSettings.live = true;
|
|
|
- }
|
|
|
- if ($scope.scanSettings.live === true) {
|
|
|
- $scope.startLiveScan();
|
|
|
- } else {
|
|
|
- $scope.startNormalScan();
|
|
|
- }
|
|
|
- $rootScope.accessPoints = [];
|
|
|
- $rootScope.unassociatedClients = [];
|
|
|
- $rootScope.outOfRangeClients = [];
|
|
|
- checkScanStatus();
|
|
|
+ $scope.convertDateToBrowserTime = function(scanDate) {
|
|
|
+ var m = [
|
|
|
+ "01", "02", "03",
|
|
|
+ "04", "05", "06",
|
|
|
+ "07", "08", "09",
|
|
|
+ "10", "11", "12"
|
|
|
+ ];
|
|
|
+
|
|
|
+ var ts = scanDate.replace(' ', 'T');
|
|
|
+ ts += 'Z';
|
|
|
+
|
|
|
+ var d = new Date(ts);
|
|
|
+ var day = `${d.getDate()}`.padStart(2, '0');
|
|
|
+ var year = d.getFullYear();
|
|
|
+ var month = d.getMonth();
|
|
|
+ var hour = `${d.getHours()}`.padStart(2, '0');
|
|
|
+ var mins = `${d.getMinutes()}`.padStart(2, '0');
|
|
|
+ var secs = `${d.getSeconds()}`.padStart(2, '0');
|
|
|
+
|
|
|
+ return year + '-' + m[month] + '-' + day + ' ' + hour + ':' + mins + ':' + secs;
|
|
|
};
|
|
|
|
|
|
- $scope.startLiveScan = function () {
|
|
|
- $scope.loading = true;
|
|
|
-
|
|
|
+ // requests
|
|
|
+ $scope.getScans = function() {
|
|
|
$api.request({
|
|
|
module: 'Recon',
|
|
|
- action: 'startLiveScan',
|
|
|
- scanType: $scope.scanType,
|
|
|
- scanDuration: $scope.scanSettings.scanDuration
|
|
|
- }, function (response) {
|
|
|
- if (response.success) {
|
|
|
- $scope.loading = false;
|
|
|
- $rootScope.running = true;
|
|
|
- $scope.scanID = response.scanID;
|
|
|
- if ($scope.wsStarted !== true) {
|
|
|
- $scope.startWS();
|
|
|
- }
|
|
|
+ action: 'getScans'
|
|
|
+ }, function(response) {
|
|
|
+ if(response.error === undefined) {
|
|
|
+ $scope.scans = response.scans;
|
|
|
+ $scope.scans.forEach((scan) => {
|
|
|
+ scan.date = $scope.convertDateToBrowserTime(scan.date);
|
|
|
+ });
|
|
|
+ $scope.selectedScan = response.scans[0];
|
|
|
+ $scope.statusObtained = true;
|
|
|
} else {
|
|
|
- if (response.error === "The PineAP Daemon must be running.") {
|
|
|
- $scope.pineAPDRunning = false;
|
|
|
- }
|
|
|
$scope.error = response.error;
|
|
|
}
|
|
|
});
|
|
|
};
|
|
|
|
|
|
- $scope.startWS = (function () {
|
|
|
- $scope.wsStarted = true;
|
|
|
+ $scope.setScanLocation = function() {
|
|
|
$api.request({
|
|
|
module: 'Recon',
|
|
|
- action: 'getWSAuthToken'
|
|
|
- }, function (response) {
|
|
|
- if (response.success === true) {
|
|
|
- $scope.wsAuthToken = response.wsAuthToken;
|
|
|
- $scope.doWS();
|
|
|
- } else {
|
|
|
- $scope.wsTimeout = $timeout($scope.startWS, 1500);
|
|
|
- }
|
|
|
- });
|
|
|
- });
|
|
|
-
|
|
|
- $scope.doWS = (function () {
|
|
|
- if ($scope.ws !== undefined && $scope.ws.readyState !== WebSocket.CLOSED) {
|
|
|
- return;
|
|
|
- }
|
|
|
- $scope.ws = new WebSocket("ws://" + window.location.hostname + ":1337/?authtoken=" + $scope.wsAuthToken);
|
|
|
- $scope.ws.onerror = (function () {
|
|
|
- $scope.wsTimeout = $timeout($scope.startWS, 1000);
|
|
|
- });
|
|
|
- $scope.ws.onopen = (function () {
|
|
|
- $scope.ws.onerror = (function () {
|
|
|
- });
|
|
|
- $rootScope.running = true;
|
|
|
-
|
|
|
- });
|
|
|
- $scope.ws.onclose = (function () {
|
|
|
- $scope.listening = false;
|
|
|
- $scope.closeWS();
|
|
|
- });
|
|
|
-
|
|
|
- $scope.ws.onmessage = (function (message) {
|
|
|
- $scope.listening = true;
|
|
|
- if ($scope.paused) {
|
|
|
- return;
|
|
|
- }
|
|
|
- var data = JSON.parse(message.data);
|
|
|
- if (data.scan_complete === true) {
|
|
|
- $scope.checkScan();
|
|
|
- return;
|
|
|
- }
|
|
|
- $rootScope.accessPoints = data.ap_list;
|
|
|
- $rootScope.unassociatedClients = data.unassociated_clients;
|
|
|
- $rootScope.outOfRangeClients = data.out_of_range_clients;
|
|
|
- annotateMacs();
|
|
|
- });
|
|
|
- });
|
|
|
-
|
|
|
- $scope.startNormalScan = function () {
|
|
|
- if ($rootScope.running) {
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- $scope.loading = true;
|
|
|
-
|
|
|
- $api.request({
|
|
|
- module: 'Recon',
|
|
|
- action: 'startNormalScan',
|
|
|
- scanType: $scope.scanType,
|
|
|
- scanDuration: $scope.scanSettings.scanDuration
|
|
|
- }, function (response) {
|
|
|
+ action: 'setScanLocation',
|
|
|
+ scanLocation: $scope.scanLocation
|
|
|
+ }, function(response) {
|
|
|
if (response.success) {
|
|
|
- $scope.loading = false;
|
|
|
- $rootScope.running = true;
|
|
|
- $scope.scanID = response.scanID;
|
|
|
+ $scope.getScanLocation();
|
|
|
+ $scope.setLocationSuccess = true;
|
|
|
+ $timeout(function () {
|
|
|
+ $scope.setLocationSuccess = false;
|
|
|
+ }, 2000);
|
|
|
} else {
|
|
|
- if (response.error === "The PineAP Daemon must be running.") {
|
|
|
- $scope.pineAPDRunning = false;
|
|
|
- }
|
|
|
- $scope.error = response.error;
|
|
|
- }
|
|
|
- });
|
|
|
- };
|
|
|
-
|
|
|
- $scope.pauseLiveScan = function () {
|
|
|
- $scope.paused = true;
|
|
|
- };
|
|
|
-
|
|
|
- $scope.resumeLiveScan = function () {
|
|
|
- $scope.paused = false;
|
|
|
- };
|
|
|
-
|
|
|
- $scope.stopScan = function () {
|
|
|
- $scope.percent = 0;
|
|
|
- $scope.paused = false;
|
|
|
- $rootScope.running = false;
|
|
|
-
|
|
|
- $api.request({
|
|
|
- module: 'Recon',
|
|
|
- action: 'stopScan'
|
|
|
- }, function (response) {
|
|
|
- if (response.success === true) {
|
|
|
- $rootScope.running = false;
|
|
|
- $scope.closeWS();
|
|
|
- }
|
|
|
- });
|
|
|
- };
|
|
|
-
|
|
|
- $scope.checkScan = function () {
|
|
|
- $api.request({
|
|
|
- module: 'Recon',
|
|
|
- action: 'checkScanStatus',
|
|
|
- scanID: $scope.scanID
|
|
|
- }, function (response) {
|
|
|
- $scope.percent = response.scanPercent;
|
|
|
- if (response.error) {
|
|
|
$scope.error = response.error;
|
|
|
- } else if (response.completed === true) {
|
|
|
- if (!$rootScope.running && !$scope.loading) {
|
|
|
- $scope.percent = 100;
|
|
|
- }
|
|
|
- if ($rootScope.running) {
|
|
|
- $scope.stopScan();
|
|
|
- $scope.scans = $scope.scans || [];
|
|
|
-
|
|
|
- // fix missing logic
|
|
|
- //$scope.selectedScan = $scope.scans[$scope.scans.length - 1];
|
|
|
- $scope.selectedScan = {};
|
|
|
- $scope.selectedScan['scan_id'] = $scope.scanID;
|
|
|
-
|
|
|
- $scope.displayScan();
|
|
|
- }
|
|
|
- } else if (response.completed === false) {
|
|
|
- if (response.scanID !== null && response.scanID !== undefined) {
|
|
|
- $scope.scanID = response.scanID;
|
|
|
- }
|
|
|
}
|
|
|
});
|
|
|
};
|
|
|
|
|
|
- $scope.displayScan = function () {
|
|
|
- if ($scope.selectedScan === undefined) {
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- $scope.loadingScan = true;
|
|
|
+ $scope.getScanLocation = function() {
|
|
|
$api.request({
|
|
|
module: 'Recon',
|
|
|
- action: 'getScans'
|
|
|
- }, function (response) {
|
|
|
+ action: 'getScanLocation'
|
|
|
+ }, function(response) {
|
|
|
if (response.error === undefined) {
|
|
|
- $scope.scans = response.scans;
|
|
|
- $api.request({
|
|
|
- module: 'Recon',
|
|
|
- action: 'loadResults',
|
|
|
- scanID: $scope.selectedScan['scan_id']
|
|
|
- }, function (response) {
|
|
|
- parseScanResults(response);
|
|
|
- $scope.loadingScan = false;
|
|
|
- $scope.loadedScan = $scope.selectedScan;
|
|
|
- $scope.scanID = $scope.selectedScan['scan_id'];
|
|
|
- });
|
|
|
+ $scope.scanLocation = response.scanLocation;
|
|
|
+ $scope.getScans();
|
|
|
} else {
|
|
|
$scope.error = response.error;
|
|
|
}
|
|
|
});
|
|
|
};
|
|
|
|
|
|
- $scope.cancelIntervals = function () {
|
|
|
- if ($scope.checkScanInterval) {
|
|
|
- $interval.cancel($scope.checkScanInterval);
|
|
|
- }
|
|
|
- if ($scope.updatePercentageInterval) {
|
|
|
- $interval.cancel($scope.updatePercentageInterval);
|
|
|
- }
|
|
|
-
|
|
|
- if ($scope.wsTimeout) {
|
|
|
- $timeout.cancel($scope.wsTimeout);
|
|
|
- }
|
|
|
- $scope.checkScanInterval = null;
|
|
|
- $scope.updatePercentageInterval = null;
|
|
|
- $scope.wsTimeout = null;
|
|
|
- };
|
|
|
-
|
|
|
- $scope.closeWS = (function () {
|
|
|
- if ($scope.ws !== undefined) {
|
|
|
- $scope.ws.close();
|
|
|
- $scope.wsStarted = false;
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- $scope.displayCurrentScan = function () {
|
|
|
+ $scope.displayScan = function() {
|
|
|
+ $scope.loadingScan = true;
|
|
|
$api.request({
|
|
|
module: 'Recon',
|
|
|
- action: 'checkScanStatus'
|
|
|
- }, function (response) {
|
|
|
- if (!response.completed && response.scanID !== null) {
|
|
|
- $scope.scanID = response.scanID;
|
|
|
- $scope.loading = true;
|
|
|
- if (response.continuous) {
|
|
|
- $scope.scanSettings.scanDuration = "0";
|
|
|
- $scope.scanSettings.live = true;
|
|
|
- $scope.percent = response.scanPercent;
|
|
|
- }
|
|
|
- $api.request({
|
|
|
- module: 'Recon',
|
|
|
- action: 'startReconPP'
|
|
|
- }, function () {
|
|
|
- if ($scope.wsStarted !== true) {
|
|
|
- $scope.startWS();
|
|
|
- }
|
|
|
- $rootScope.running = true;
|
|
|
- checkScanStatus();
|
|
|
- $scope.loading = false;
|
|
|
- });
|
|
|
- }
|
|
|
+ action: 'loadResults',
|
|
|
+ scanID: $scope.selectedScan['scan_id']
|
|
|
+ }, function(response) {
|
|
|
+ $scope.parseScanResults(response);
|
|
|
+ $scope.loadingScan = false;
|
|
|
+ $scope.loadedScan = $scope.selectedScan;
|
|
|
+ $scope.scanID = $scope.selectedScan['scan_id'];
|
|
|
});
|
|
|
};
|
|
|
|
|
|
- $scope.startPineAP = function () {
|
|
|
- $scope.pineAPDStarting = true;
|
|
|
+ $scope.removeScan = function() {
|
|
|
$api.request({
|
|
|
module: 'Recon',
|
|
|
- action: 'startPineAPDaemon'
|
|
|
- }, function (response) {
|
|
|
- $scope.pineAPDStarting = false;
|
|
|
- if (response.error === undefined) {
|
|
|
- $scope.pineAPDRunning = true;
|
|
|
- $scope.startScan();
|
|
|
- $scope.error = null;
|
|
|
+ action: 'removeScan',
|
|
|
+ scanID: $scope.selectedScan['scan_id']
|
|
|
+ }, function(response) {
|
|
|
+ if(response.error === undefined) {
|
|
|
+ $scope.removedScan = true;
|
|
|
+ $scope.loadedScan = null;
|
|
|
+ $rootScope.pmkid_accessPoints = [];
|
|
|
+ $rootScope.pmkid_unassociatedClients = [];
|
|
|
+ $rootScope.pmkid_outOfRangeClients = [];
|
|
|
+ $timeout(function() {
|
|
|
+ $scope.removedScan = false;
|
|
|
+ }, 2000);
|
|
|
+ $scope.getScans();
|
|
|
} else {
|
|
|
$scope.error = response.error;
|
|
|
}
|
|
|
});
|
|
|
};
|
|
|
|
|
|
- $scope.checkScan();
|
|
|
-
|
|
|
- $scope.$on('$destroy', function () {
|
|
|
- $scope.cancelIntervals();
|
|
|
- $scope.closeWS();
|
|
|
- });
|
|
|
-
|
|
|
- $api.onDeviceIdentified(function (device) {
|
|
|
- $scope.updateScanSettings();
|
|
|
- $scope.device = device;
|
|
|
- $scope.displayCurrentScan();
|
|
|
- }, $scope);
|
|
|
+ $scope.getScanLocation();
|
|
|
}]);
|
|
|
|
|
|
|
|
|
-registerController('PMKIDAttack_ScanResults', ['$api', '$scope', '$interval', '$rootScope', function ($api, $scope, $interval, $rootScope) {
|
|
|
- $rootScope.ssid = '';
|
|
|
- $rootScope.bssid = '';
|
|
|
- $rootScope.pmkidLog = '';
|
|
|
- $rootScope.pmkids = [];
|
|
|
- $rootScope.pmkidsLoading = false;
|
|
|
- $scope.reverseSort = false;
|
|
|
- $scope.orderByName = 'ssid';
|
|
|
+registerController('PMKIDAttack_AttackResults', ['$api', '$scope', '$rootScope', '$interval', function ($api, $scope, $rootScope, $interval) {
|
|
|
+ $scope.ssid = '';
|
|
|
+ $scope.pmkids = [];
|
|
|
+ $scope.pmkidsLoading = false;
|
|
|
+ $rootScope.pmkid_bssid = '';
|
|
|
+ $rootScope.pmkid_pmkidLog = '';
|
|
|
+ $rootScope.pmkid_captureRunning = false;
|
|
|
+ $rootScope.pmkid_intervalCheckHash = null;
|
|
|
|
|
|
$scope.getStatusAttack = function () {
|
|
|
$api.request({
|
|
|
action: "getStatusAttack",
|
|
|
module: "PMKIDAttack"
|
|
|
}, function (response) {
|
|
|
- if (response.success) {
|
|
|
- $rootScope.ssid = response.ssid;
|
|
|
- $rootScope.bssid = response.bssid;
|
|
|
+ if (response.process && response.attack) {
|
|
|
+ $scope.ssid = response.ssid;
|
|
|
+ $rootScope.pmkid_bssid = response.bssid;
|
|
|
$scope.checkPMKID();
|
|
|
+ } else if (!response.process && response.attack) {
|
|
|
+ $rootScope.pmkid_startAttack(response.ssid, response.bssid, "true");
|
|
|
}
|
|
|
});
|
|
|
};
|
|
|
|
|
|
$scope.checkPMKID = function() {
|
|
|
- $rootScope.captureRunning = true;
|
|
|
- if (!$rootScope.intervalCheckHash) {
|
|
|
- $rootScope.intervalCheckHash = $interval(function () {
|
|
|
- if ($rootScope.captureRunning) {
|
|
|
- $rootScope.catchPMKID();
|
|
|
+ $rootScope.pmkid_captureRunning = true;
|
|
|
+ if (!$rootScope.pmkid_intervalCheckHash) {
|
|
|
+ $rootScope.pmkid_intervalCheckHash = $interval(function () {
|
|
|
+ if ($rootScope.pmkid_captureRunning) {
|
|
|
+ $scope.catchPMKID();
|
|
|
} else {
|
|
|
- $rootScope.stopAttack();
|
|
|
+ $rootScope.pmkid_stopAttack();
|
|
|
}
|
|
|
- }, 5000);
|
|
|
+ }, 30000);
|
|
|
}
|
|
|
};
|
|
|
|
|
|
- $scope.startAttack = function (ssid, bssid) {
|
|
|
- $rootScope.pmkidLog = '';
|
|
|
- $rootScope.ssid = ssid;
|
|
|
- $rootScope.bssid = bssid;
|
|
|
-
|
|
|
+ $scope.catchPMKID = function () {
|
|
|
$api.request({
|
|
|
- action: 'startAttack',
|
|
|
- module: 'PMKIDAttack',
|
|
|
- ssid: ssid,
|
|
|
- bssid: bssid
|
|
|
+ action: 'catchPMKID',
|
|
|
+ module: 'PMKIDAttack'
|
|
|
}, function (response) {
|
|
|
+ $rootScope.pmkid_pmkidLog = response.pmkidLog;
|
|
|
if (response.success) {
|
|
|
- $scope.checkPMKID();
|
|
|
+ $rootScope.pmkid_captureRunning = false;
|
|
|
}
|
|
|
});
|
|
|
};
|
|
|
|
|
|
- $rootScope.stopAttack = function () {
|
|
|
+ $scope.getPMKIDFiles = function () {
|
|
|
+ $scope.pmkids = [];
|
|
|
+ $scope.pmkidsLoading = true;
|
|
|
+
|
|
|
$api.request({
|
|
|
- action: 'stopAttack',
|
|
|
+ action: 'getPMKIDFiles',
|
|
|
module: 'PMKIDAttack',
|
|
|
- bssid: $rootScope.bssid
|
|
|
}, function (response) {
|
|
|
- $interval.cancel($rootScope.intervalCheckHash);
|
|
|
- delete $rootScope.intervalCheckHash;
|
|
|
- $rootScope.captureRunning = false;
|
|
|
- $rootScope.getPMKIDFiles();
|
|
|
+ $scope.pmkids = response.pmkids;
|
|
|
+ $scope.pmkidsLoading = false;
|
|
|
});
|
|
|
};
|
|
|
|
|
|
- $rootScope.viewAttackLog = function (file = '') {
|
|
|
- $rootScope.pmkidLog = '';
|
|
|
+ $scope.downloadPMKID = function (file) {
|
|
|
$api.request({
|
|
|
- action: 'viewAttackLog',
|
|
|
+ action: 'downloadPMKID',
|
|
|
module: 'PMKIDAttack',
|
|
|
file: file
|
|
|
}, function (response) {
|
|
|
- $rootScope.pmkidLog = response.pmkidLog;
|
|
|
+ window.location = '/api/?download=' + response.download;
|
|
|
});
|
|
|
};
|
|
|
|
|
|
- $rootScope.catchPMKID = function () {
|
|
|
+ $scope.deletePMKID = function (file) {
|
|
|
$api.request({
|
|
|
- action: 'catchPMKID',
|
|
|
- module: 'PMKIDAttack'
|
|
|
+ action: 'deletePMKID',
|
|
|
+ module: 'PMKIDAttack',
|
|
|
+ file: file
|
|
|
}, function (response) {
|
|
|
- $rootScope.pmkidLog = response.pmkidLog;
|
|
|
- if (response.success) {
|
|
|
- $rootScope.captureRunning = false;
|
|
|
- }
|
|
|
+ $scope.getPMKIDFiles();
|
|
|
});
|
|
|
};
|
|
|
|
|
|
- $rootScope.getPMKIDFiles = function () {
|
|
|
- $rootScope.pmkids = [];
|
|
|
- $rootScope.pmkidsLoading = true;
|
|
|
-
|
|
|
+ $scope.viewAttackLog = function (file) {
|
|
|
+ $rootScope.pmkid_pmkidLog = '';
|
|
|
$api.request({
|
|
|
- action: 'getPMKIDFiles',
|
|
|
+ action: 'viewAttackLog',
|
|
|
module: 'PMKIDAttack',
|
|
|
+ file: file
|
|
|
}, function (response) {
|
|
|
- $rootScope.pmkids = response.pmkids;
|
|
|
- $rootScope.pmkidsLoading = false;
|
|
|
+ $rootScope.pmkid_pmkidLog = response.pmkidLog;
|
|
|
});
|
|
|
};
|
|
|
|
|
|
- $rootScope.downloadPMKID = function (file) {
|
|
|
+ $rootScope.pmkid_startAttack = function (ssid, bssid, cleanStart) {
|
|
|
+ $scope.ssid = ssid;
|
|
|
+ $rootScope.pmkid_bssid = bssid;
|
|
|
+ $rootScope.pmkid_pmkidLog = '';
|
|
|
+
|
|
|
$api.request({
|
|
|
- action: 'downloadPMKID',
|
|
|
+ action: 'startAttack',
|
|
|
module: 'PMKIDAttack',
|
|
|
- file: file
|
|
|
+ ssid: ssid,
|
|
|
+ bssid: bssid,
|
|
|
+ cleanStart: cleanStart
|
|
|
}, function (response) {
|
|
|
- window.location = '/api/?download=' + response.download;
|
|
|
+ if (response.success) {
|
|
|
+ $scope.checkPMKID();
|
|
|
+ }
|
|
|
});
|
|
|
};
|
|
|
|
|
|
- $rootScope.deletePMKID = function (file) {
|
|
|
+ $rootScope.pmkid_stopAttack = function () {
|
|
|
$api.request({
|
|
|
- action: 'deletePMKID',
|
|
|
+ action: 'stopAttack',
|
|
|
module: 'PMKIDAttack',
|
|
|
- file: file
|
|
|
+ bssid: $rootScope.pmkid_bssid
|
|
|
}, function (response) {
|
|
|
- $rootScope.getPMKIDFiles();
|
|
|
+ $interval.cancel($rootScope.pmkid_intervalCheckHash);
|
|
|
+ delete $rootScope.pmkid_intervalCheckHash;
|
|
|
+ $rootScope.pmkid_captureRunning = false;
|
|
|
+ $scope.getPMKIDFiles();
|
|
|
});
|
|
|
};
|
|
|
|
|
|
- $rootScope.getPMKIDFiles();
|
|
|
+ $scope.getPMKIDFiles();
|
|
|
$scope.getStatusAttack();
|
|
|
|
|
|
$scope.$on('$destroy', function() {
|
|
|
@@ -528,7 +319,15 @@ registerController('PMKIDAttack_ScanResults', ['$api', '$scope', '$interval', '$
|
|
|
});
|
|
|
}]);
|
|
|
|
|
|
-registerController('PMKIDAttack_Log', ['$api', '$scope', '$rootScope', '$interval', function ($api, $scope, $rootScope, $interval) {
|
|
|
+
|
|
|
+registerController('PMKIDAttack_ScanResults', ['$api', '$scope', '$rootScope', function ($api, $scope, $rootScope) {
|
|
|
+ $rootScope.pmkid_accessPoints = [];
|
|
|
+ $rootScope.pmkid_unassociatedClients = [];
|
|
|
+ $rootScope.pmkid_outOfRangeClients = [];
|
|
|
+}]);
|
|
|
+
|
|
|
+
|
|
|
+registerController('PMKIDAttack_Log', ['$api', '$scope', function ($api, $scope) {
|
|
|
$scope.moduleLog = '';
|
|
|
$scope.moduleLogLading = false;
|
|
|
|