Selecting and editing payloads
Last updated
Last updated
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!
Payloads can be edited live in the Packet Squirrel web UI, copied via scp
, or edited on the Packet Squirrel in a ssh terminal.
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!
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.
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:
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).
To save your changes and exit, press ^X
(Control-X).
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.
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:
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.
To copy the payload back TO the Packet Squirrel, we reverse the process:
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.