Add 5 immersive hacking modules: terminal emulator, live data streams, system monitoring, attack visualization, log streaming
- Terminal Emu: live terminal showing fake command execution, privilege escalation, shell access - Data Stream: animated hex dumps and packet captures with scrolling binary data - System Monitor: target dashboard with processes, CPU/memory/network metrics - Attack Vis: exploit progression visualization (scan→enum→exploit→escalate→exfil) with intensity - Log Streamer: real-time colored log feed with alerts, successes, error tracking These modules make Cardputer FEEL like active hacking with live feedback, creating immersive sense of actively exploiting and monitoring compromised systems. Adds visceral "attack in progress" aesthetic to the interface. Brings toolkit to 48 modules across 11 categories.
This commit is contained in:
91
src/modules/attackvis.cpp
Normal file
91
src/modules/attackvis.cpp
Normal file
@@ -0,0 +1,91 @@
|
||||
#include "../core/module.h"
|
||||
#include "../core/ui.h"
|
||||
|
||||
// Attack Visualizer: animated exploit progression with intense visual feedback.
|
||||
// Shows attack stages with alarm effects, success states, real-time compromise status.
|
||||
// Makes exploitation FEEL urgent and active with glitch effects and neon alerts.
|
||||
|
||||
class AttackVis : public Module {
|
||||
enum Stage { SCANNING, ENUMERATING, EXPLOITING, ESCALATING, EXFILTRATING } stage = SCANNING;
|
||||
uint32_t stageProgress = 0;
|
||||
uint32_t targetCount = 0;
|
||||
uint32_t compromised = 0;
|
||||
bool alarmActive = false;
|
||||
char msg[3][40] = {{0},{0},{0}};
|
||||
|
||||
public:
|
||||
const char* name() const override { return "Attack Vis"; }
|
||||
const char* blurb() const override { return "active attack display"; }
|
||||
|
||||
void onEnter() override {
|
||||
stage = SCANNING;
|
||||
stageProgress = 0;
|
||||
targetCount = 0;
|
||||
compromised = 0;
|
||||
alarmActive = false;
|
||||
say("Initializing attack sequence");
|
||||
}
|
||||
void onExit() override { }
|
||||
|
||||
bool onKey(char c) override {
|
||||
if (c == ' ') { nextStage(); return true; }
|
||||
return false;
|
||||
}
|
||||
|
||||
void tick() override {
|
||||
stageProgress++;
|
||||
if (stageProgress > 60) {
|
||||
stage = (Stage)((stage + 1) % 5);
|
||||
stageProgress = 0;
|
||||
}
|
||||
|
||||
// Simulate targets discovered
|
||||
if (stageProgress % 15 == 0) targetCount++;
|
||||
|
||||
// Simulate compromise
|
||||
if (stage == EXFILTRATING && stageProgress % 10 == 0) compromised++;
|
||||
}
|
||||
|
||||
void draw() override {
|
||||
const char* sn[] = {"SCAN", "ENUM", "EXPLOIT", "ESCALATE", "EXFIL"};
|
||||
const char* icons[] = {"📡", "🔍", "💣", "🔑", "📤"};
|
||||
|
||||
uint16_t stageColor = ui::accent();
|
||||
if (stage == EXPLOITING || stage == EXFILTRATING) stageColor = ui::glow();
|
||||
|
||||
ui::lineC(0, stageColor, "%s %s [%u%%]", icons[stage], sn[stage], stageProgress * 100 / 60);
|
||||
|
||||
if (stage == SCANNING) {
|
||||
ui::bar(2, stageProgress / 60.0f, ui::dim(), "scan");
|
||||
say("[*] Targets found: %u", targetCount);
|
||||
} else if (stage == ENUMERATING) {
|
||||
ui::bar(2, stageProgress / 60.0f, ui::accent(), "enum");
|
||||
say("[*] Collecting system info...");
|
||||
} else if (stage == EXPLOITING) {
|
||||
ui::bar(2, stageProgress / 60.0f, ui::bad(), "exploit");
|
||||
say("[!] EXPLOIT ACTIVE");
|
||||
} else if (stage == ESCALATING) {
|
||||
ui::bar(2, stageProgress / 60.0f, ui::warn(), "privesc");
|
||||
say("[!] Escalating privileges...");
|
||||
} else if (stage == EXFILTRATING) {
|
||||
ui::bar(2, stageProgress / 60.0f, ui::glow(), "exfil");
|
||||
say("[+] Targets compromised: %u", compromised);
|
||||
}
|
||||
|
||||
for (int i = 0; i < 3; i++) ui::line(7 + i, "%s", msg[i]);
|
||||
ui::hintBar("[space]next [`]back");
|
||||
}
|
||||
|
||||
private:
|
||||
void say(const char* fmt, ...) {
|
||||
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 nextStage() {
|
||||
stage = (Stage)((stage + 1) % 5);
|
||||
stageProgress = 0;
|
||||
}
|
||||
};
|
||||
|
||||
Module* makeAttackVis() { return new AttackVis(); }
|
||||
Reference in New Issue
Block a user