12 Commits

Author SHA1 Message Date
cecio
276edad7e3 bump to release 0.14.3 2024-01-01 16:05:11 +01:00
cecio
751465b3a2 bump to release 0.14.3 2024-01-01 16:03:49 +01:00
cecio
2c493681cc bump to release 0.14.2 2023-12-11 23:23:01 +01:00
cecio
b87b518552 Update README.md 2023-11-20 23:14:04 +01:00
cecio
385a67144a Update README.md 2023-11-20 23:13:29 +01:00
cecio
df739adf29 Update README.md
Typo fixed
2023-11-20 21:47:50 +01:00
cecio
5126ce40d7 new logo and enclosure 2023-11-20 21:44:58 +01:00
cecio
f7a1165cae firmware added 2023-11-15 21:32:04 +01:00
cecio
8b3f6d3223 bump to release 0.14.1 2023-11-15 21:28:13 +01:00
cecio
2d248742e3 Update README.md 2023-10-27 23:28:53 +02:00
cecio
9b92c0b97a bump to release 0.14.0 2023-10-17 23:18:25 +02:00
cecio
d92080cfca bump to release 0.13.1 2023-09-26 21:48:30 +02:00
7 changed files with 33 additions and 12 deletions

View File

@@ -1,4 +1,4 @@
<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>
<h1><img width="300" 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*
@@ -43,7 +43,7 @@ If you prefer videos, you can also have a look to my [Insomni'hack Presentation]
`pictures`: images and resources used in this doc
`STL`: STL files for enclosure
`STL`: STL files for enclosure. In `1.1` and `1.2` folders there are full enclosures (thanks to [WhistleMaster](https://github.com/WhistleMaster)). If you want something lighter to protect the LCD you can go with `USBvalve_sliding_cover.stl`.
## Build USBvalve
@@ -162,8 +162,8 @@ 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.1
- `Adafruit TinyUSB Library` version `2.2.2`, Board `Raspberry Pi RP2040 (3.4.1)` setting Tools=>CPU Speed at `120MHz` and Tools=>USB Stack to `Adafruit TinyUSB`
- Arduino IDE `2.2.1`
- `Adafruit TinyUSB Library` version `2.3.1`, `Pico-PIO-USB` version `0.5.2`, Board `Raspberry Pi RP2040 (3.6.2)` setting Tools=>CPU Speed at `120MHz` and Tools=>USB Stack to `Adafruit TinyUSB`
- `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.

Binary file not shown.

View File

@@ -20,7 +20,7 @@
#include "Adafruit_TinyUSB.h"
#include "SSD1306AsciiWire.h"
#include <XxHash_arduino.h>
#include <pico/stdlib.h>
#include <pico/stdlib.h>
//
// BADUSB detector section
@@ -44,7 +44,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;
@@ -75,11 +75,13 @@ bool activeState = false;
//
// USBvalve globals
//
#define VERSION "USBvalve - 0.13.0"
#define VERSION "USBvalve - 0.14.3"
boolean readme = false;
boolean autorun = false;
boolean written = false;
boolean deleted = false;
boolean written_reported = false;
boolean deleted_reported = false;
boolean hid_sent = false;
boolean hid_reported = false;
@@ -211,6 +213,12 @@ void loop() {
autorun = false;
}
if (deleted == true && deleted_reported == false) {
oled.print("\n[!] DELETING");
deleted = false;
deleted_reported = true;
}
if (written == true && written_reported == false) {
oled.print("\n[!] WRITING");
written = false;
@@ -275,14 +283,25 @@ int32_t msc_read_callback(uint32_t lba, void* buffer, uint32_t bufsize) {
// This happens only for the "real" size of disk
int32_t msc_write_callback(uint32_t lba, uint8_t* buffer, uint32_t bufsize) {
// Check for file deletion at Block 7
// The first char of filename is replaced with 0xE5, we are going
// to check for it
if (lba == 7) {
if (buffer[32] == 0xE5 || buffer[64] == 0xE5 || buffer[160] == 0xE5) {
deleted = true;
}
}
// This check for writing of space. The LBA > 10 is set to avoid some
// false positives, in particular on Windows Systems
if (lba > 10) {
written = true;
}
// We are declaring a bigger size than what is actually allocated, so
// this is protecting our memory integrity
if (lba < DISK_BLOCK_NUM - 1) {
// Writing buffer to "disk"
uint8_t* addr = msc_disk[lba];
memcpy(addr, buffer, bufsize);
}
@@ -358,10 +377,10 @@ void hexDump(unsigned char* data, size_t size) {
}
// Reset the Pico
void swreset()
{
watchdog_enable(1500, 1);
while(1);
void swreset() {
watchdog_enable(1500, 1);
while (1)
;
}
//
@@ -408,7 +427,7 @@ void tuh_hid_report_received_cb(uint8_t dev_addr, uint8_t instance, uint8_t cons
// 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

@@ -37,6 +37,8 @@
// README.TXT
// System Volume Information
//
// Files information are saved at Block 7
//
// Keep 11 chars
#define DISK_LABEL 'M', 'y', 'D', 'r', 'i', 'v', 'e', ' ', ' ', ' ', ' '

Binary file not shown.

Before

Width:  |  Height:  |  Size: 79 KiB

After

Width:  |  Height:  |  Size: 170 KiB