LogoLogo
DocumentationPayloadsCommunitySupport
  • Packet Squirrel Mark II by Hak5
  • Setup
    • Connecting the Packet Squirrel
    • Setting up the Packet Squirrel
  • Getting Started
    • Changes & New features
    • Packet Squirrel Basics
    • Accessing the Packet Squirrel
    • Web UI
    • Getting the Packet Squirrel online
    • Status LED
    • Cloud C²
    • USB storage support
    • Selecting and editing payloads
    • Configuring payloads
    • Running payloads
    • Networking and modes
  • Networking Tutorial
    • Glossary
    • OSI layers
    • Private IP ranges
    • Network masks
    • Packet injection
    • Translation and redirection
    • Packet capture
  • Payload Development
    • Payload development basics
    • DuckyScript for Packet Squirrel
      • BUTTON
      • C2EXFIL
      • C2NOTIFY
      • C2WATCHDIR
      • DYNAMICPROXY
      • KILLPORT
      • KILLSTREAM
      • LED
      • MATCHPORT
      • MATCHSTREAM
      • NETMODE
      • SELFDESTRUCT
      • SSH_START
      • SSH_STOP
      • SPOOFDNS
      • SWITCH
      • UI_START
      • UI_STOP
      • USB_FREE
      • USB_STORAGE
      • USB_WAIT
  • Advanced payloads
    • Quotes and expansions
    • Flow control
    • Redirecting output
    • Payload configuration
    • Return codes & success
    • Background commands
    • Command groups
    • Processing JSON
    • USB encryption
    • VPN configuration
    • Network manipulation
    • Tips, tricks, & pitfalls
    • Python
  • Payload repository
  • Troubleshooting
    • Troubleshooting networking
    • Troubleshooting payloads
    • Factory reset
  • Software Updates
    • Upgrading firmware
Powered by GitBook
On this page
  • Running payloads in Arming & Configuration mode
  • Enabling SSH and the web UI in a payload
  • Logging commands to a file

Was this helpful?

  1. Troubleshooting

Troubleshooting payloads

Last updated 1 year ago

Was this helpful?

When developing a payload (or deploying a new payload which may require configuration or tweaking), it can sometimes be difficult to identify the reason it is not activating as expected.

There are several ways to debug a payload:

Running payloads in Arming & Configuration mode

Payloads can often be run interactively in Arming & Configuration mode via the web UI terminal, or via a SSH connection.

To run a payload interactively from a terminal, simply launch the payload script via bash:

root@squirrel:~# /bin/bash /root/payloads/switch1/payload

This method is the simplest when your payload does not require an offline mode - remember, if you change the NETMODE in your payload, you may lose network access to the Packet Squirrel!

While debugging, you may be able to comment out the NETMODE line in a payload. Remember to restore it when you're done!

Enabling SSH and the web UI in a payload

SSH and the web UI can be enabled in any payload mode where the Packet Squirrel has a network connection (NAT, BRIDGE, and JAIL) with the commands START_SSH and START_UI. Once SSH or the web UI has been started, you can connect to your Packet Squirrel and examine the state or re-run the payload.

Logging commands to a file

The output of commands can be sent to a file (see the chapter on for more information). This can help diagnose errors in a payload that can not be debugged interactively.

Remember that files in /tmp are not preserved over a reboot - but you can log to /root/, for example:

mkdir -p /root/payload_logs

command1 2>&1 >> /root/payload_logs/payload_debug.txt
command2 2>&1 >> /root/payload_logs/payload_debug.txt

Remember to use >> to add to the end of the log file instead of replacing it!

Redirecting output