-
Notifications
You must be signed in to change notification settings - Fork 174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add USB-DriveBy #39
Open
90N45-d3v
wants to merge
2
commits into
hak5:master
Choose a base branch
from
90N45-d3v:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add USB-DriveBy #39
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# USB-DriveBy | ||
* Category: General | ||
* Author: 90N45 | ||
* Version: 1.0 | ||
|
||
### Description | ||
Use an USB storage device to deploy payloads on-demand while the Packet Squirrel is already set up and running. | ||
|
||
### Setup | ||
1. Start your Packet Squirrel with the USB-DriveBy payload. | ||
2. Whenever you want to start any payload on-demand, place the payload file with the name `payload.txt` on any compatible USB storage device. | ||
3. When the LED lights up solid green, you can insert the USB storage into the Squirrel’s USB-A port whenever a new payload is needed. | ||
4. You can unplug your USB storage device at the moment your payload starts | ||
|
||
### Tip: Add an LED indicator to your payloads to indicate that your payloads have finished. | ||
When your payload is finished, the USB-DriveBy payload will wait 10 seconds until it executes the script on your USB storage device again (if it is still present). This means that you should know when your payloads have finished and your USB storage device should be unplugged at the latest. | ||
|
||
### Status | ||
| LED | State | | ||
| --- | --- | | ||
| Magenta solid (SETUP) | Default network mode will be established | | ||
| Green 1000ms VERYFAST blink followed by SOLID (FINISH) | Listening for USB storage device. Ready to run scripts. | | ||
| Red slow symmetric blinking (FAIL) | No payload file found on USB storage device | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/bash | ||
|
||
# Title: USB-DriveBy | ||
# Description: Use an USB storage device to deploy payloads on-demand | ||
# Author: 90N45 | ||
# Version: 1.0 | ||
# Category: General | ||
|
||
# Choose your preferred default network mode | ||
NETWORK_MODE="TRANSPARENT" | ||
|
||
LED SETUP | ||
|
||
NETMODE ${NETWORK_MODE} | ||
|
||
LED FINISH | ||
|
||
while true; do | ||
# Check for available USB storage | ||
USB_STORAGE && { | ||
# Check for available payload | ||
if [ -f "/usb/payload.txt" ]; then | ||
# Run payload from USB storage | ||
bash /usb/payload.txt | ||
# Sleep to prevent triggering the payload twice unintended | ||
sleep 10 | ||
else | ||
# LED FAIL if file is not on USB storage | ||
LED FAIL | ||
fi | ||
} || { | ||
# Make sure to restore LED color if USB storage is detached after LED FAIL | ||
LED G | ||
} | ||
done |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using this loop, the payload a appears to be repeatedly triggered. I would add a flag to make sure it only runs once.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's intentional... since no flag is used, you can run multiple “drive-by” payloads from the USB without having to restart the main payload on the squirrel after every single use.
The delay in line 26 provides the user enough time to unplug the USB when the “drive-by” payload finished, so that it is not unintentionally triggered again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add LED indication that the payload is running so the user knows when to unplug the USB. In its current state it would be difficult to know when the payload has been transferred and is running. I would also recommend using a variable for the payload name to make user configuration easier, just in case someone wants to use something other than
payload.txt
.