A Hardware Hacking Tool with Web-Based CLI That Speaks Every Protocol
C arduinobluetoothcan-busdebuggingeepromesp32flipperzerogpiohardware-hackingi2cjtagopenocdprotocolspwmradiorfidspisubghzuartwifi
adapt wifi and ethernet controller to use http handlers
Geoeacffc34a3b8
diff --git a/src/Controllers/BluetoothController.cpp b/src/Controllers/BluetoothController.cppindex 3fc31f51..7d64782e 100644--- a/src/Controllers/BluetoothController.cpp+++ b/src/Controllers/BluetoothController.cpp@@ -168,7 +168,7 @@ void BluetoothController::handleKeyboard(const TerminalCommand& cmd) {return;}- // if spaces in text, use cmd.getArgs()+ // if spaces in text, cmd.getArgs() is not emptyauto full = cmd.getArgs().empty() ?cmd.getSubcommand() :cmd.getSubcommand() + " " + cmd.getArgs();diff --git a/src/Controllers/EthernetController.cpp b/src/Controllers/EthernetController.cppindex b7d3ea91..de095665 100644--- a/src/Controllers/EthernetController.cpp+++ b/src/Controllers/EthernetController.cpp@@ -14,6 +14,7 @@ void EthernetController::handleCommand(const TerminalCommand& cmd) {else if (root == "ping") handlePing(cmd);else if (root == "ssh") handleSsh(cmd);else if (root == "status") handleStatus();+ else if (root == "http") handleHttp(cmd);else if (root == "reset") handleReset();else handleHelp();}@@ -180,6 +181,7 @@ void EthernetController::handleHelp() {terminalView.println(" ssh <host> <user> <password> [port]");terminalView.println(" nc <host> <port>");terminalView.println(" nmap <host> [port]");+ terminalView.println(" http get <url>");terminalView.println(" reset");terminalView.println(" config");}diff --git a/src/Controllers/WifiController.cpp b/src/Controllers/WifiController.cppindex 52995d69..bb4fb7c9 100644--- a/src/Controllers/WifiController.cpp+++ b/src/Controllers/WifiController.cpp@@ -21,6 +21,7 @@ void WifiController::handleCommand(const TerminalCommand &cmd)else if (root == "ssh") handleSsh(cmd);else if (root == "nc") handleNetcat(cmd);else if (root == "nmap") handleNmap(cmd);+ else if (root == "http") handleHttp(cmd);else if (root == "discovery") handleDiscovery(cmd);else if (root == "reset") handleReset();else if (root == "deauth") handleDeauth(cmd);@@ -485,6 +486,7 @@ void WifiController::handleHelp()terminalView.println(" ssh <host> <username> <password> [port]");terminalView.println(" nc <host> <port>");terminalView.println(" nmap <host> [port]");+ terminalView.println(" http <get|post|put|delete> <url>");terminalView.println(" webui");terminalView.println(" reset");terminalView.println(" deauth <ssid>");diff --git a/src/Providers/DependencyProvider.cpp b/src/Providers/DependencyProvider.cppindex 19196bc1..d6f2dda0 100644--- a/src/Providers/DependencyProvider.cpp+++ b/src/Providers/DependencyProvider.cpp@@ -31,6 +31,7 @@ DependencyProvider::DependencyProvider(ITerminalView &terminalView, IDeviceViewcanService(),systemService(),ethernetService(),+ httpService(),// TransformerscommandTransformer(),@@ -76,9 +77,9 @@ DependencyProvider::DependencyProvider(ITerminalView &terminalView, IDeviceViewledController(terminalView, terminalInput, ledService, argTransformer, userInputManager),bluetoothController(terminalView, terminalInput, deviceInput, bluetoothService, argTransformer, userInputManager),i2sController(terminalView, terminalInput, i2sService, argTransformer, userInputManager),- wifiController(terminalView, terminalInput, deviceInput, wifiService, wifiScannerService, ethernetService, sshService, netcatService, nmapService, icmpService, nvsService, argTransformer, userInputManager),+ wifiController(terminalView, terminalInput, deviceInput, wifiService, wifiScannerService, ethernetService, sshService, netcatService, nmapService, icmpService, nvsService, httpService, argTransformer, userInputManager),canController(terminalView, terminalInput, userInputManager, canService, argTransformer),- ethernetController(terminalView, terminalInput, deviceInput, wifiService, wifiScannerService, ethernetService, sshService, netcatService, nmapService, icmpService, nvsService, argTransformer, userInputManager)+ ethernetController(terminalView, terminalInput, deviceInput, wifiService, wifiScannerService, ethernetService, sshService, netcatService, nmapService, icmpService, nvsService, httpService, argTransformer, userInputManager){}diff --git a/src/Providers/DependencyProvider.h b/src/Providers/DependencyProvider.hindex 4aa29eee..c7a38eea 100644--- a/src/Providers/DependencyProvider.h+++ b/src/Providers/DependencyProvider.h@@ -32,6 +32,7 @@ and injecting shared instances of core components#include "Services/SystemService.h"#include "Services/ThreeWireService.h"#include "Services/EthernetService.h"+#include "Services/HttpService.h"#include "Controllers/UartController.h"#include "Controllers/I2cController.h"#include "Controllers/OneWireController.h"@@ -110,7 +111,8 @@ public:CanService &getCanService();SystemService &getSystemService();EthernetService &getEthernetService();-+ HttpService &getHttpService();+// ControllersUartController &getUartController();I2cController &getI2cController();@@ -197,6 +199,7 @@ private:CanService canService;SystemService systemService;EthernetService ethernetService;+ HttpService httpService;// ControllersUartController uartController;