Skip to content

Commit 003cede

Browse files
authored
Added USB enable-disable mode (#25)
1 parent 83eba10 commit 003cede

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed

README.md

+14
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,20 @@ The easiest way to so is by using a jumper wire between those pins as seen bello
4343

4444
![Setup mode with a jumper](images/setup-mode.png)
4545

46+
### USB enable/disable mode
47+
48+
If you need the pico-ducky to not show up as a USB mass storage device for stealth, follow these instructions.
49+
Enter setup mode.
50+
Copy boot.py to the root of the pico-ducky.
51+
Copy your payload script to the pico-ducky.
52+
Disconnect the pico from your host PC.
53+
Connect a jumper wire between pin 18 and pin 20.
54+
This will prevent the pico-ducky from showing up as a USB drive when plugged into the target computer.
55+
Remove the jumper and reconnect to your PC to reprogram.
56+
The default mode is USB mass storage enabled.
57+
58+
![USB enable/disable mode](images/usb-boot-mode.png)
59+
4660
## Useful links and resources
4761

4862
### Docs

boot.py

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
from board import *
2+
import digitalio
3+
import storage
4+
5+
noStorageStatus = False
6+
noStoragePin = digitalio.DigitalInOut(GP15)
7+
noStoragePin.switch_to_input(pull=digitalio.Pull.UP)
8+
noStorageStatus = not noStoragePin.value
9+
10+
if(noStorageStatus == True):
11+
# don't show USB drive to host PC
12+
storage.disable_usb_drive()
13+
print("Disabling USB drive")
14+
else:
15+
# normal boot
16+
print("USB drive enabled")

images/usb-boot-mode.png

2.08 MB
Loading

0 commit comments

Comments
 (0)