Sfoglia il codice sorgente

Wps fix 2 (#7)

* wps 1.9

Fixes issues with interfering with management AP interface.
Now uses the same interface for iwlist and airodump-ng.
Interface selection now starts at wlan1 (or highest wlan) instead of wlan0.

* wps 1.9

Fixes issues with interfering with management AP interface.
Now uses the same interface for iwlist and airodump-ng.
Interface selection now starts at wlan1 (or highest wlan) instead of wlan0.
Fixes line endings to use UNIX format.

* change version number

change version number

* change wps version number

change wps version number
m5kro 2 anni fa
parent
commit
9c8bf07836
3 ha cambiato i file con 16 aggiunte e 8 eliminazioni
  1. BIN
      modules/build/wps.tar.gz
  2. 15 7
      modules/src/wps/api/module.php
  3. 1 1
      modules/src/wps/module.info

BIN
modules/build/wps.tar.gz


+ 15 - 7
modules/src/wps/api/module.php

@@ -216,7 +216,7 @@ class wps extends Module
     {
         exec("iwconfig 2> /dev/null | grep \"wlan*\" | grep -v \"mon*\" | awk '{print $1}'", $interfaceArray);
 
-        $this->response = array("interfaces" => $interfaceArray);
+        $this->response = array("interfaces" => array_reverse($interfaceArray));
     }
 
     private function getMonitors()
@@ -239,16 +239,24 @@ class wps extends Module
     private function scanForNetworks()
     {
         if ($this->request->duration && $this->request->monitor != "") {
-            exec("killall -9 airodump-ng && rm -rf /tmp/wps-*");
+            exec("killall airodump-ng && rm -rf /tmp/wps-*");
             $this->execBackground("airodump-ng -a --wps --output-format cap -w /tmp/wps ".$this->request->monitor." &> /dev/null");
             sleep($this->request->duration);
-            exec("killall -9 airodump-ng");
-
+            exec("killall airodump-ng");
             exec("wash -f /tmp/wps-01.cap > /tmp/wps-01.wash");
         }
-
-        $p = $this->iwlistparse->parseScanDev($this->request->interface);
-        $apArray = $p[$this->request->interface];
+        
+        $apArray;
+        if($this->request->monitor != null){
+            $tempStation = substr($this->request->monitor, 0, -3);
+            exec("airmon-ng stop ".$this->request->monitor);
+            $p = $this->iwlistparse->parseScanDev($tempStation);
+            $apArray = $p[$tempStation];
+            exec("airmon-ng start ".$tempStation);
+        } else {
+            $p = $this->iwlistparse->parseScanDev($this->request->interface);
+            $apArray = $p[$this->request->interface];
+        }
 
         $returnArray = array();
         foreach ($apArray as $apData) {

+ 1 - 1
modules/src/wps/module.info

@@ -6,5 +6,5 @@
         "tetra"
     ],
     "title": "wps",
-    "version": "1.8"
+    "version": "1.9"
 }