Skip to content

A Hardware Hacking Tool with Web-Based CLI That Speaks Every Protocol

add wifi probe cmd to find net access from open networks

Geo9cdfedfb29d2
diff --git a/src/Controllers/UtilityController.cpp b/src/Controllers/UtilityController.cpp
index 117399b2..72bd66f0 100644
--- a/src/Controllers/UtilityController.cpp
+++ b/src/Controllers/UtilityController.cpp
@@ -421,6 +421,7 @@ void UtilityController::handleHelp() {
terminalView.println(" connect - Connect to a network");
terminalView.println(" ping <host> - Ping a remote host");
terminalView.println(" sniff - Monitor Wi-Fi packets");
+ terminalView.println(" probe - Search for net access");
terminalView.println(" spoof ap <mac> - Spoof AP MAC");
terminalView.println(" spoof sta <mac> - Spoof Station MAC");
terminalView.println(" status - Show Wi-Fi status");
diff --git a/src/Controllers/WifiController.cpp b/src/Controllers/WifiController.cpp
index b91661b1..119c09cf 100644
--- a/src/Controllers/WifiController.cpp
+++ b/src/Controllers/WifiController.cpp
@@ -8,6 +8,7 @@ WifiController::WifiController(
IInput &terminalInput,
IInput &deviceInput,
WifiService &wifiService,
+ WifiOpenScannerService &wifiScannerService,
SshService &sshService,
NetcatService &netcatService,
NmapService &nmapService,
@@ -19,6 +20,7 @@ WifiController::WifiController(
terminalInput(terminalInput),
deviceInput(deviceInput),
wifiService(wifiService),
+ wifiScannerService(wifiScannerService),
sshService(sshService),
netcatService(netcatService),
nmapService(nmapService),
@@ -40,6 +42,7 @@ void WifiController::handleCommand(const TerminalCommand &cmd)
else if (root == "ap") handleAp(cmd);
else if (root == "spoof") handleSpoof(cmd);
else if (root == "scan") handleScan(cmd);
+ else if (root == "probe") handleProbe();
else if (root == "ping") handlePing(cmd);
else if (root == "sniff") handleSniff(cmd);
else if (root == "webui") handleWebUi(cmd);
@@ -231,6 +234,60 @@ void WifiController::handleScan(const TerminalCommand &)
}
}
+/*
+Probe
+*/
+void WifiController::handleProbe()
+{
+ terminalView.println("WIFI: Starting probe for internet access on open networks...");
+ terminalView.println("\n[WARNING] This will try to connect to surrounding open networks.\n");
+
+ // Confirm before starting
+ auto confirmation = userInputManager.readYesNo("Start Wi-Fi probe to find internet access?", false);
+ if (!confirmation) {
+ terminalView.println("WIFI: Probe cancelled.\n");
+ return;
+ }
+
+ // Stop any existing probe
+ if (wifiScannerService.isOpenProbeRunning()) {
+ wifiScannerService.stopOpenProbe();
+ }
+ wifiScannerService.clearProbeLog();
+
+ // Start the open probe service
+ if (!wifiScannerService.startOpenProbe()) {
+ terminalView.println("WIFI: Failed to start probe.\n");
+ return;
+ }
+
+ terminalView.println("WIFI: Probe for internet access... Press [ENTER] to stop.\n");
+
+ // Start the open probe task
+ while (wifiScannerService.isOpenProbeRunning()) {
+ // Display logs
+ auto batch = wifiScannerService.fetchProbeLog();
+ for (auto& ln : batch) {
+ terminalView.println(ln.c_str());
+ }
+
+ // Enter Press to stop
+ int ch = terminalInput.readChar();
+ if (ch == '\n' || ch == '\r') {
+ wifiScannerService.stopOpenProbe();
+ break;
+ }
+
+ delay(10);
+ }
+
+ // Flush final logs
+ for (auto& ln : wifiScannerService.fetchProbeLog()) {
+ terminalView.println(ln.c_str());
+ }
+ terminalView.println("WIFI: Open-Wifi probe ended.\n");
+}
+
/*
Ping
*/
@@ -603,6 +660,7 @@ void WifiController::handleConfig()
terminalView.println("[WARNING] If you're connected via Web CLI,");
terminalView.println(" executing Wi-Fi commands may cause ");
terminalView.println(" the terminal session to disconnect.");
+ terminalView.println(" Don't use: sniff, probe, connect, scan, spoof...");
terminalView.println(" Use USB serial or restart if connection is lost.\n");
}
@@ -613,9 +671,10 @@ void WifiController::handleHelp()
{
terminalView.println("WiFi commands:");
terminalView.println(" scan");
+ terminalView.println(" connect");
terminalView.println(" ping <host>");
terminalView.println(" sniff");
- terminalView.println(" connect");
+ terminalView.println(" probe");
terminalView.println(" spoof sta <mac>");
terminalView.println(" spoof ap <mac>");
terminalView.println(" status");
@@ -642,7 +701,7 @@ void WifiController::ensureConfigured()
}
/*
-Deathenticate stations attack
+Deauthenticate stations attack
*/
void WifiController::handleDeauth(const TerminalCommand &cmd)
{
diff --git a/src/Controllers/WifiController.h b/src/Controllers/WifiController.h
index 62be7779..78529fb4 100644
--- a/src/Controllers/WifiController.h
+++ b/src/Controllers/WifiController.h
@@ -7,6 +7,7 @@
#include <Services/SshService.h>
#include <Services/NetcatService.h>
#include <Services/NmapService.h>
+#include <Services/WifiOpenScannerService.h>
#include <Transformers/ArgTransformer.h>
#include <Managers/UserInputManager.h>
#include <Models/TerminalCommand.h>
@@ -21,10 +22,11 @@ public:
IInput& terminalInput,
IInput& deviceInput,
WifiService& wifiService,
+ WifiOpenScannerService& wifiScannerService,
SshService& sshService,
NetcatService& netcatService,
NmapService& nmapService,
- NvsService& nvsService,
+ NvsService& nvsService,
ArgTransformer& argTransformer,
UserInputManager& userInputManager
);
@@ -40,6 +42,7 @@ private:
IInput& terminalInput;
IInput& deviceInput;
WifiService& wifiService;
+ WifiOpenScannerService& wifiScannerService;
NvsService& nvsService;
SshService& sshService;
NetcatService& netcatService;
@@ -68,6 +71,9 @@ private:
// Ping a target over Wi-Fi
void handlePing(const TerminalCommand& cmd);
+ // Start probing open networks for net access
+ void handleProbe();
+
// Start packet sniffing
void handleSniff(const TerminalCommand& cmd);