Skip to content

Commit

Permalink
Merge branch 'pr3y:main' into cleanup-2
Browse files Browse the repository at this point in the history
  • Loading branch information
rouing authored Dec 29, 2024
2 parents 0fc39bb + 2c0f612 commit 0c5dffe
Show file tree
Hide file tree
Showing 6 changed files with 78 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# These are supported funding model platforms

github: bmorcelli
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
patreon: BruceFirmware
open_collective: brucefirmware
ko_fi: brucefw
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
Expand Down
3 changes: 2 additions & 1 deletion pcbs/M5Stick_Intermidiate_kr4k3n/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Bruce PCB
# Bruce M5stick extender v0.1

This PCB was designed by TH3_KR4K3N

![KR4K3N Bruce PCB front](https://raw.githubusercontent.com/pr3y/Bruce/refs/heads/main/media/pcbs/TH3_KR4K3N/pcb_back.jpg)
5 changes: 4 additions & 1 deletion pcbs/M5Stick_Intermidiate_ultramarines/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Bruce PCB
# Bruce M5 Stick Extender

This PCB was designed by ultramarines

![ultramarines Bruce PCB side](https://raw.githubusercontent.com/pr3y/Bruce/refs/heads/main/media/pcbs/ultramarines/ultramarines_full_side.jpg)
![ultramarines Bruce PCB front](https://raw.githubusercontent.com/pr3y/Bruce/refs/heads/main/media/pcbs/ultramarines/ultramarines_pcb_front.png)
![ultramarines Bruce PCB back](https://raw.githubusercontent.com/pr3y/Bruce/refs/heads/main/media/pcbs/ultramarines/ultramarines_pcb_back.jpg)
2 changes: 2 additions & 0 deletions src/core/menu_items/WifiMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

// 32bit: https://github.com/9dl/Bruce-C2/releases/download/v1.0/BruceC2_windows_386.exe
// 64bit: https://github.com/9dl/Bruce-C2/releases/download/v1.0/BruceC2_windows_amd64.exe
#include "modules/wifi/listenTCP.h"

void WifiMenu::optionsMenu() {
if(!wifiConnected) {
Expand All @@ -40,6 +41,7 @@ void WifiMenu::optionsMenu() {
options.push_back({"Wifi Atks", [=]() { wifi_atk_menu(); }});
options.push_back({"Evil Portal", [=]() { EvilPortal(); }});
options.push_back({"ReverseShell", [=]() { ReverseShell(); }});
options.push_back({"Listen TCP", [=]() { listenTcpPort(); }});
#ifndef LITE_VERSION
options.push_back({"TelNET", [=]() { telnet_setup(); }});
options.push_back({"SSH", [=]() { ssh_setup(); }});
Expand Down
65 changes: 65 additions & 0 deletions src/modules/wifi/listenTCP.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#include "modules/wifi/listenTCP.h"
#include "core/wifi_common.h"

void listenTcpPort() {
if (!wifiConnected) wifiConnectMenu();

WiFiClient tcpClient;
tft.fillScreen(TFT_BLACK);
tft.setTextSize(1);
tft.setTextColor(TFT_WHITE, TFT_BLACK);

String portNumber = keyboard("", 5, "TCP port to listen");
int portNumberInt = atoi(portNumber.c_str());

WiFiServer tcpServer(portNumberInt);
tcpServer.begin();

tft.println("Listening...");
tft.print(WiFi.localIP().toString().c_str());
tft.println(":" + portNumber);

bool inputMode;

for (;;) {
WiFiClient client = tcpServer.available(); // Wait for a client to connect

if (client) {
Serial.println("Client connected");
tft.println("Client connected");

while (client.connected()) {
if (inputMode) {
String keyString = keyboard("", 16, "send input data");
delay(300);
inputMode = false;
tft.fillScreen(TFT_BLACK);
tft.setCursor(0,0);
if (keyString.length() > 0) {
client.print(keyString); // Send the entire string to the client
Serial.print(keyString);
}
} else {
if (client.available()) {
char incomingChar = client.read(); // Read one byte at time from the client
tft.print(incomingChar);
Serial.print(incomingChar);
}
if (checkSelPress()) {
delay(300);
inputMode = true;
}
}
}
client.stop();
Serial.println("Client disconnected");
displayError("Client disconnected");

}
if (checkEscPress()) {
displayError("Exiting Listener");
tcpServer.stop();
break;
}
}
}
3 changes: 3 additions & 0 deletions src/modules/wifi/listenTCP.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#include "core/mykeyboard.h"

void listenTcpPort();

0 comments on commit 0c5dffe

Please sign in to comment.