Remove 22 fake/simulated modules; add 4 real tools (WiFi Scan, I2C Probe, SPI Flash ID, Logic Probes); scrollable menu; honest Auto Recon + Bench Diag
This commit is contained in:
@@ -1,79 +1,53 @@
|
||||
#include "../core/module.h"
|
||||
#include "../core/ui.h"
|
||||
#include <SD.h>
|
||||
|
||||
// Active Exploit: real attack execution with progress feedback.
|
||||
// Actually run exploits via Exploit Chain module, show real execution stages with feedback.
|
||||
// Display real privilege escalation, real shell spawning, actual exfiltration data.
|
||||
// Bench Assistant: live system telemetry for THIS device (heap, temp, SD,
|
||||
// uptime) plus a quick self-test. Honest diagnostics — replaces the old
|
||||
// "active exploit" theater module.
|
||||
|
||||
class ActiveExploit : public Module {
|
||||
enum Stage { SCANNING, ENUMERATING, EXPLOITING, ESCALATING, EXFILTRATING, DONE } stage = SCANNING;
|
||||
class BenchDiag : public Module {
|
||||
bool running = false;
|
||||
uint32_t stageTime = 0;
|
||||
uint32_t bytesExfed = 0;
|
||||
uint32_t targetsCompromised = 0;
|
||||
uint32_t freeHeap = 0, minHeap = 0;
|
||||
float tempC = 0;
|
||||
bool sdOk = false;
|
||||
char msg[3][40] = {{0},{0},{0}};
|
||||
|
||||
public:
|
||||
const char* name() const override { return "Active Exploit"; }
|
||||
const char* blurb() const override { return "real exploit execution"; }
|
||||
const char* name() const override { return "Bench Diag"; }
|
||||
const char* blurb() const override { return "self telemetry + selftest"; }
|
||||
|
||||
void onEnter() override {
|
||||
running = false;
|
||||
stage = SCANNING;
|
||||
stageTime = 0;
|
||||
bytesExfed = 0;
|
||||
targetsCompromised = 0;
|
||||
say("Exploit ready: [space] to start");
|
||||
}
|
||||
void onEnter() override { running = false; say("[space] run self-test"); }
|
||||
void onExit() override { running = false; }
|
||||
|
||||
bool onKey(char c) override {
|
||||
if (c == ' ') { if (!running) { startExploit(); } else { running = false; } return true; }
|
||||
if (c == ' ') { running = true; say("self-test running..."); return true; }
|
||||
return false;
|
||||
}
|
||||
|
||||
void tick() override {
|
||||
if (!running) return;
|
||||
freeHeap = ESP.getFreeHeap();
|
||||
minHeap = ESP.getMinFreeHeap();
|
||||
tempC = temperatureRead();
|
||||
sdOk = SD.begin();
|
||||
running = false;
|
||||
|
||||
stageTime++;
|
||||
|
||||
// Real exploit orchestration via Exploit Chain
|
||||
// Actual stages: scan → enum → exploit → escalate → exfil
|
||||
if (stageTime == 100 && stage == SCANNING) { stage = ENUMERATING; stageTime = 0; }
|
||||
if (stageTime == 100 && stage == ENUMERATING) { stage = EXPLOITING; stageTime = 0; }
|
||||
if (stageTime == 150 && stage == EXPLOITING) { stage = ESCALATING; stageTime = 0; }
|
||||
if (stageTime == 100 && stage == ESCALATING) { stage = EXFILTRATING; stageTime = 0; }
|
||||
if (stageTime == 200 && stage == EXFILTRATING) { stage = DONE; running = false; targetsCompromised++; }
|
||||
|
||||
// Real data during exfiltration
|
||||
if (stage == EXFILTRATING) {
|
||||
bytesExfed += (512 + (stageTime % 512));
|
||||
}
|
||||
say("heap free %lu KB", (unsigned long)(freeHeap / 1024));
|
||||
say("heap min %lu KB", (unsigned long)(minHeap / 1024));
|
||||
say("temp %.1fC SD %s", tempC, sdOk ? "ok" : "MISSING");
|
||||
say("self-test complete");
|
||||
}
|
||||
|
||||
void draw() override {
|
||||
const char* sn[] = {"SCAN", "ENUM", "EXPLOIT", "ESCALATE", "EXFIL", "DONE"};
|
||||
uint16_t col = ui::accent();
|
||||
if (stage == EXPLOITING || stage == ESCALATING) col = ui::warn();
|
||||
if (stage == EXFILTRATING) col = ui::glow();
|
||||
|
||||
ui::lineC(0, col, "%s [%u%%]", sn[stage], (running ? stageTime : 0) % 100);
|
||||
|
||||
if (running) {
|
||||
ui::bar(2, stageTime / (stage == EXFILTRATING ? 200.0f : 150.0f), col, sn[stage]);
|
||||
} else if (targetsCompromised > 0) {
|
||||
ui::lineC(2, ui::glow(), "COMPROMISED: %u targets", targetsCompromised);
|
||||
} else {
|
||||
ui::line(2, "status: ready");
|
||||
}
|
||||
|
||||
if (stage == EXFILTRATING) {
|
||||
ui::line(3, "Exfiltrated: %u KB", bytesExfed / 1024);
|
||||
}
|
||||
|
||||
for (int i = 0; i < 3; i++) ui::line(7 + i, "%s", msg[i]);
|
||||
ui::lineC(0, ui::accent(), "Bench Diag %s", running ? "TEST" : "ready");
|
||||
ui::line(1, "heap: %lu KB (min %lu KB)", (unsigned long)(freeHeap / 1024), (unsigned long)(minHeap / 1024));
|
||||
ui::line(2, "cpu temp: %.1f C", tempC);
|
||||
ui::line(3, "microSD: %s", sdOk ? "mounted" : "not detected");
|
||||
ui::line(4, "uptime: %lu s", (unsigned long)(millis() / 1000));
|
||||
for (int i = 0; i < 3; i++) ui::line(5 + i, "%s", msg[i]);
|
||||
if (running) ui::spinner(228, ui::BODY_Y + 1, ui::glow());
|
||||
ui::hintBar("[space]exploit [`]back");
|
||||
ui::hintBar("[space]test [`]back");
|
||||
}
|
||||
|
||||
private:
|
||||
@@ -81,14 +55,6 @@ private:
|
||||
for (int i = 2; i > 0; i--) strncpy(msg[i], msg[i-1], 39);
|
||||
va_list ap; va_start(ap, fmt); vsnprintf(msg[0], 40, fmt, ap); va_end(ap);
|
||||
}
|
||||
|
||||
void startExploit() {
|
||||
running = true;
|
||||
stage = SCANNING;
|
||||
stageTime = 0;
|
||||
bytesExfed = 0;
|
||||
say("Starting real exploit chain...");
|
||||
}
|
||||
};
|
||||
|
||||
Module* makeActiveExploit() { return new ActiveExploit(); }
|
||||
Module* makeActiveExploit() { return new BenchDiag(); }
|
||||
|
||||
Reference in New Issue
Block a user