Skip to content

Commit

Permalink
Added USB enable-disable mode (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
dbisu authored Oct 3, 2021
1 parent 83eba10 commit 003cede
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,20 @@ The easiest way to so is by using a jumper wire between those pins as seen bello

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

### USB enable/disable mode

If you need the pico-ducky to not show up as a USB mass storage device for stealth, follow these instructions.
Enter setup mode.
Copy boot.py to the root of the pico-ducky.
Copy your payload script to the pico-ducky.
Disconnect the pico from your host PC.
Connect a jumper wire between pin 18 and pin 20.
This will prevent the pico-ducky from showing up as a USB drive when plugged into the target computer.
Remove the jumper and reconnect to your PC to reprogram.
The default mode is USB mass storage enabled.

![USB enable/disable mode](images/usb-boot-mode.png)

## Useful links and resources

### Docs
Expand Down
16 changes: 16 additions & 0 deletions boot.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from board import *
import digitalio
import storage

noStorageStatus = False
noStoragePin = digitalio.DigitalInOut(GP15)
noStoragePin.switch_to_input(pull=digitalio.Pull.UP)
noStorageStatus = not noStoragePin.value

if(noStorageStatus == True):
# don't show USB drive to host PC
storage.disable_usb_drive()
print("Disabling USB drive")
else:
# normal boot
print("USB drive enabled")
Binary file added images/usb-boot-mode.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

2 comments on commit 003cede

@Nikzad88
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's less difficult if we do it without jumper wire.
We just need to make some change in boot.py.
if(noStorageStatus == True):--> if(noStorageStatus == False):

@ethan1512010
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there any way to make it show as an hid without wires

Please # to comment.