Selecting and editing payloads

Choosing a payload

The payload is selected by the switch position at boot.

To pick a payload, simply set the desired switch position and power on (or reboot) your Packet Squirrel!

Modifying payloads

Payloads can be edited live in the Packet Squirrel web UI, copied via scp, or edited on the Packet Squirrel in a ssh terminal.

Editing payloads in the web UI

The web UI features an in-browser option for editing payloads, with basic syntax highlighting and other code-editing features; simply edit your payload and hit save!

Uploading and downloading payloads in the web UI

Each payload in the web UI has an Upload and Download button in the bottom left.

These can be used to easily transfer payloads to and from the Packet Squirrel.

Editing payloads via SSH

Payloads can be edited directly on the Packet Squirrel via ssh.

SSH (or Secure SHell) is a standard tool for connecting to remote systems. Most operating systems include a ssh client by default; alternately, third-party SSH clients such as PuTTY are available.

Connect to your Packet Squirrel as root, using the same password you set during the initial setup:

$ ssh root@172.16.32.1

Payloads can be found in /root/payloads/switchN/payload where N is the switch position (so /root/payloads/switch1/payload, /root/payloads/switch2/payload, and so on.

To edit a payload on the Packet Squirrel, use the command nano (or vi if you prefer, both editors are included).

$ nano /root/payloads/switch1/payload

To save your changes and exit, press ^X (Control-X).

Copying payloads via SCP

SCP (or Secure CoPy), is a standard tool for copying files to or from remote systems. Most operating systems include a scp command line client by default; third-party SCP clients with a UI such as WinSCP are available as well.

Payloads can be found in /root/payloads/switchN/payload where X is the switch position (so /root/payloads/switch1/payload, /root/payloads/switch2/payload, and so on.

Copying FROM the Packet Squirrel

To copy a payload FROM the Packet Squirrel, open a terminal and use the command line scp tool, or navigate to /root/payloads/switchN/ in a graphical SCP tool.

scp expects the source and destination. To copy a file from the Packet Squirrel, the source is the root user, the IP of the Packet Squirrel, and the path to the file. The destination is the local file name.

To copy the payload from slot one on the Packet Squirrel to the file payload on our computer, renaming it as a text file, we run:

$ scp root@172.16.32.1:/root/payloads/switch1/payload payload.txt

The payload is now in whatever location we ran scp from (typically your users home directory).

Payload files are generally text files containing the payload script!

In this example we rename the file to payload.txt to make it simple to edit.

You can also usually right-click the payload file and choose "Open with..." to edit it in the text editor of your choice!

If you are using a smart text editor, you can rename your payload based on the contents: Most payloads are written in Bash script, and could be renamed payload.sh if your editor does not automatically identify what language the payload is in.

Copying TO the Packet Squirrel

To copy the payload back TO the Packet Squirrel, we reverse the process:

$ scp payload.txt root@172.16.32.1:/root/payloads/switch1/payload

Remember to always name your payload file payload! Above, we do this while copying the file with the command-line scp tool (notice the destination name is simply payload), or you can rename the file using your GUI secure copy tool after it is transferred.

Remember - you need to rename your payload file to just payload! You can name it whatever you wish on your computer, but rename it when you copy it!

Payloads uploaded via the Upload button in the web UI are automatically renamed.

Last updated