10 Commits

Author SHA1 Message Date
cecio
d57360e566 Merge branch 'main' of https://github.com/cecio/USBvalve 2023-07-28 14:48:52 +02:00
cecio
b3e43ff63d Bump to release 0.12.1 2023-07-28 14:47:42 +02:00
WM
999985150f STL files for 1.2 PCB (#6)
STL files for 1.2 PCB and 32 display cover.
2023-07-26 09:37:48 +02:00
cecio
ced8536f8c - HID serial read optimization
- BOOTSLE act now as reset
- bump to releas 0.12.0
2023-07-19 21:48:08 +02:00
cecio
77f995533e - HID serial read optimized
- BOOTSEL now act as reset button
- bump to release 0.12.0
2023-07-19 21:45:42 +02:00
cecio
3b0f285567 logo mods 2023-07-08 15:00:50 +02:00
cecio
52af9dabb7 Update README.md 2023-07-08 00:28:54 +02:00
cecio
94a5d2e8c5 Update README.md 2023-07-07 21:36:57 +02:00
cecio
ef2ddde66f added logo pic 2023-07-07 21:27:57 +02:00
cecio
7953e269af Update README.md 2023-07-05 00:53:07 +02:00
10 changed files with 69 additions and 10 deletions

View File

@@ -1,5 +1,6 @@
# USBvalve
*Expose USB activity on the fly*
<h1><img width="200" alt="logo, landscape, dark text, transparent background" src="https://github.com/cecio/USBvalve/blob/main/pictures/USBvalve_logo_scaled.png"></a></h1>
### *Expose USB activity on the fly*
<img src="https://github.com/cecio/USBvalve/blob/main/pictures/versions.png" alt="The two models" width="30%" height="30%" />
@@ -161,17 +162,17 @@ I grouped most of the variables you may want to modify in this section ([see Doc
Obviously you can also build your own firmware. To build the *standard* one I used:
- Arduino IDE 2.1.0
- Arduino IDE 2.1.1
- ~~as board I used `Raspberry Pi Pico - Arduino MBED OS RP2040` version `4.0.2`~~
- ~~`Adafruit TinyUSB Library` version `1.14.4`. Newer versions are not working because the RPI SDK of the board is stick to an older version. May be migrate the entire project directly on Raspberry Pi Pico SDK is the solution here.~~
- `Adafruit TinyUSB Library` version `2.2.1` and Board `Raspberry Pi RP2040 (3.3.0)` setting clock at 240MHz (overclock)
- `Adafruit TinyUSB Library` version `2.2.2` and Board `Raspberry Pi RP2040 (3.3.0)` setting clock at 240MHz (overclock)
- `ssd1306` OLED library version `1.8.3`
If you want to re-create a new fake filesystem, you may want to have a look to the `utils` folder, where I placed some utilities to build a new one.
#### Dockerfile
If you want to build your own firmware, after you customized it, I provide a `Dockerfile` which builds a complete **Arduino** environment and compile the firmware, just do this in main `USBvalve` folder:
If you want to build your own firmware, after you customized it, I provide a `Dockerfile` which builds a complete **Arduino** environment and compile the firmware. Enter the following commands in the main `USBvalve` folder:
```
docker build -t usbvalve/arduino-cli .

Binary file not shown.

Binary file not shown.

View File

@@ -42,7 +42,7 @@ Adafruit_USBH_Host USBHost;
// Define vars for OLED screen
#define I2C_ADDRESS 0x3C // 0X3C+SA0 - 0x3C or 0x3D
#define RST_PIN -1 // Define proper RST_PIN if required.
#define OLED_HEIGHT 32 // 64 or 32 depending on the OLED
#define OLED_HEIGHT 64 // 64 or 32 depending on the OLED
#define OLED_LINES (OLED_HEIGHT / 8)
SSD1306AsciiWire oled;
@@ -74,11 +74,13 @@ bool activeState = false;
//
// USBvalve globals
//
#define VERSION "USBvalve - 0.11.0"
#define VERSION "USBvalve - 0.12.1"
boolean readme = false;
boolean autorun = false;
boolean written = false;
boolean written_reported = false;
boolean hid_sent = false;
boolean hid_reported = false;
// Anti-Detection settings.
//
@@ -221,6 +223,17 @@ void loop() {
written = false;
written_reported = true;
}
if (hid_sent == true && hid_reported == false) {
oled.print("\n[!!] HID Sending data");
hid_sent = false;
hid_reported = true;
}
if (BOOTSEL) {
oled.print("\n[+] RESETTING");
swreset();
}
}
// Main Core1 loop: managing USB Host
@@ -351,6 +364,13 @@ void hexDump(unsigned char* data, size_t size) {
SerialTinyUSB.println();
}
// Reset the Pico
void swreset()
{
watchdog_enable(1500, 1);
while(1);
}
//
// BADUSB detector section
//
@@ -381,6 +401,10 @@ void tuh_hid_mount_cb(uint8_t dev_addr, uint8_t instance, uint8_t const* desc_re
// Invoked when device with hid interface is un-mounted
void tuh_hid_umount_cb(uint8_t dev_addr, uint8_t instance) {
SerialTinyUSB.printf("HID device address = %d, instance = %d unmounted\r\n", dev_addr, instance);
// Reset HID sent flag
hid_sent = false;
hid_reported = false;
}
// Invoked when received report from device
@@ -389,8 +413,9 @@ void tuh_hid_report_received_cb(uint8_t dev_addr, uint8_t instance, uint8_t cons
static bool kbd_printed = false;
static bool mouse_printed = false;
oled.print("\n[!!] HID Sending data");
// Used in main loop to write output to OLED
hid_sent = true;
// Read the HID protocol
uint8_t const itf_protocol = tuh_hid_interface_protocol(dev_addr, instance);

View File

@@ -1,5 +1,7 @@
/*
USBvalve
RAMDISK file written by Cesare Pizzi
*/
/*
@@ -607,7 +609,38 @@ DISK_LABEL, 0x08, 0x00, 0x00, 0xaf, 0x60,
},
{
//------------- Block 85: -------------//
0x00
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x35, 0xc3, 0x28, 0x56, 0xaa, 0x10, 0x9b, 0xd7, 0xd2, 0x75, 0x6e, 0xcf, 0x1e, 0x1e, 0x21, 0xaf,
0xcc, 0x52, 0x04, 0xe4, 0xc3, 0x7d, 0x3e, 0xee, 0xf7, 0xf1, 0x7d, 0xe0, 0x09, 0x95, 0x11, 0x6c,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
},
{
//------------- Block 86: -------------//

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB