| 7 | #include <WiFiClient.h> |
| 8 | |
| 9 | void ReverseShell() { |
| 10 | WebServer webServer(80); // HTTP server |
| 11 | DNSServer dnsServer; |
| 12 | IPAddress apGateway(192, 168, 4, 1); |
| 13 | WiFiServer tcpServer(23); // Reverse shell server |
| 14 | WiFiClient tcpClient; |
| 15 | String lastCommand; |
| 16 | bool shellConnected = false; |
| 17 | |
| 18 | options.clear(); |
| 19 | |
| 20 | // Display initialization messages |
| 21 | tft.fillScreen(bruceConfig.bgColor); |
| 22 | tft.setTextSize(FM); |
| 23 | tft.setTextColor(TFT_RED, bruceConfig.bgColor); |
| 24 | tft.drawCentreString("Reverse Shell", tftWidth / 2, 10, 1); |
| 25 | tft.setTextColor(TFT_WHITE, bruceConfig.bgColor); |
| 26 | tft.setTextSize(FP); |
| 27 | tft.setCursor(15, 33); |
| 28 | tft.println("Developed by Fourier (github.com/9dl)"); |
| 29 | tft.println("Starting reverse shell server..."); |
| 30 | |
| 31 | WiFi.mode(WIFI_AP); |
| 32 | if (!WiFi.softAPConfig(apGateway, apGateway, IPAddress(255, 255, 255, 0))) { |
| 33 | tft.println("Failed to configure AP"); |
| 34 | return; |
| 35 | } |
| 36 | |
| 37 | if (!WiFi.softAP("BruceShell", "", 1)) { |
| 38 | tft.println("Failed to start AP"); |
| 39 | return; |
| 40 | } |
| 41 | |
| 42 | tft.println("Wi-Fi AP Started: BruceShell"); |
| 43 | |
| 44 | delay(3000); |
| 45 | |
| 46 | tcpServer.begin(); |
| 47 | tft.println("TCP server started on port 23."); |
| 48 | |
| 49 | webServer.on("/", [&webServer]() { |
| 50 | String html = R"rawliteral( |
| 51 | <!DOCTYPE html> |
| 52 | <html> |
| 53 | <head> |
| 54 | <title>BruceShell Web Interface</title> |
| 55 | <style> |
| 56 | body { display: flex; justify-content: center; align-items: center; height: 100vh; margin: 0; background-color: #282c34; color: #61dafb; font-family: Arial, sans-serif; } |
| 57 | .container { text-align: center; } |
| 58 | input[type="text"] { width: 300px; padding: 10px; margin: 10px; border: none; border-radius: 5px; } |
| 59 | button { padding: 10px 20px; background-color: #61dafb; color: #282c34; border: none; border-radius: 5px; cursor: pointer; } |
| 60 | button:hover { background-color: #21a1f1; } |
| 61 | </style> |
| 62 | </head> |
| 63 | <body> |
| 64 | <div class="container"> |
| 65 | <h1>BruceShell Executor</h1> |
| 66 | <form action="/execute" method="GET"> |
nothing calls this directly
no test coverage detected