Skip to content
ex6pPublic

About

e.cat is a native, single-binary netcat/ncat alternative written in Go with no runtime dependencies. It is designed for Linux, CTF environments, local labs, embedded devices, and quick remote access. The listener stays open for multiple clients and allocates a PTY by default, so shells, editors, and interactive programs behave like a real terminal.

Topics

Resources

Stars

2 stars

Watchers

1 watching

Forks

Repository files navigation

e.cat

Native netcat / ncat alternative in a single Go binary.

Go Linux MIT Release Build

Quick start Usage Features Interactive

PTY by default · Multi-accept listener · Encryption · HTTP masking · File transfer

Demo

fsoc.mp4

Contents

  1. What is e.cat
  2. Why e.cat
  3. Features
  4. Quick start
  5. Install
  6. Build
  7. Usage
  8. Options
  9. Modes
  10. PTY
  11. Interactive mode
  12. Encryption
  13. Web masking
  14. Port scan
  15. Forwarder
  16. Chat relay
  17. Exec
  18. Exit codes
  19. Recipes
  20. Update
  21. Security
  22. License
  23. Demo

What is e.cat

e.cat is a single-file Go replacement for netcat, ncat, socat and simple TCP/UDP relays. It keeps the listener open, accepts multiple clients, allocates a PTY by default, and can scan ports, forward traffic, relay chat, execute commands on connect, and transfer files.

It is designed for Linux, CTF, local labs, embedded devices and quick remote access. The binary has no runtime dependencies and uses only the Go standard library.

e.cat <host> <port>                 # client
e.cat -l <port>                     # listener
e.cat -z <host> <ports>             # port scan
e.cat -L <host:port> -l -p <port>   # forwarder
e.cat --broker -l -p <port>         # chat relay

Why e.cat

  • One binary, no runtime dependencies.
  • PTY by default — vim, top, less, ssh-style shells behave correctly.
  • Listener stays open for multiple clients.
  • Short flag clusters — -lvnp4444.
  • Flags before or after positionals.
  • UDP, Unix socket, IPv4, IPv6.
  • Encryption (-X) and HTTP masking (--web).
  • File transfer (upload / download) with progress.
  • JSON scan output, open-only mode, proper exit codes.
  • No telemetry, no config file, no daemon.

Features

Feature Description
PTY by default Full pseudo-terminal on the listener side, like SSH.
Multi-accept Port stays open, multiple clients can connect.
Encryption -X <password> — AES-256-GCM, per-record authenticated.
Web masking --web — wraps the stream in HTTP-looking requests.
File transfer Interactive upload / download with live progress.
Inject Loads e.cat into remote RAM (/dev/shm) via base64.
UDP / Unix -u and -U modes.
Port scan -z with ranges, lists, JSON and rate limits.
Forwarder -L TCP port forwarding.
Chat relay --broker relays data between clients.
Exec -e / -c run commands on connect.
PTY fallback script → python3 → python → ruby → perl → expect → shell.
IPv6 -4 / -6.
Exit codes Proper non-zero on failure.
Redirects < file and > file are translated to -i / -o.
No DNS -n disables reverse DNS.
Keep open -k keeps the listener after a client disconnects.
Quit after one -q exits after the first client.
Source address -s binds a source address or interface.
Timeout -w sets a timeout in seconds.

Quick start

curl -fsSL https://raw.githubusercontent.com/ex6p/e.cat/main/install.sh -o install.sh
chmod +x install.sh
./install.sh
e.cat --version

Or grab a prebuilt binary from the latest release for linux (amd64, arm64, armv7, 386, riscv64, loong64) and macOS (amd64, arm64).


Install

Automatic

./install.sh

The script detects OS and CPU architecture, checks Go 1.21+, installs Go when needed, builds the binary and installs it into /usr/local/bin or ~/.local/bin.

Manual

make
sudo ./install.sh

User install

make
mkdir -p ~/.local/bin
install -Dm755 e.cat ~/.local/bin/e.cat
export PATH="$HOME/.local/bin:$PATH"

Build

make build
make clean
make install

The build command is:

go build -trimpath -ldflags="-s -w" -o e.cat .

-trimpath removes local paths. -ldflags="-s -w" strips debug information. The result is a small static binary.


Usage

e.cat <host> <port>                 TCP client
e.cat -lvnp 4444                    listener + default PTY
e.cat -lvnp 4444 --shell /bin/fish  choose shell
e.cat -u -lvnp 5353                 UDP listener
e.cat -U /tmp/sock -l               Unix socket
e.cat -z 10.0.0.1 1-1000            port scan
e.cat -z 10.0.0.1 22,80,443 --json  JSON scan
e.cat -e /bin/sh -lvnp 4444         exec on connect
e.cat -c 'id; uname -a' -lvnp 4444  shell command
e.cat -L 8080:127.0.0.1:80 -l -p 8080
e.cat --broker -lvnp 4444           chat relay
e.cat -X pass -lvnp 4444            encrypted listener
e.cat --web -X pass -lvnp 4444      encrypted + HTTP-masked

Short clusters work: -lvnp4444, -zv host 80. Flags can appear before or after positionals.


Options

Flag Description
-l Listen mode.
-p <port> Local port.
-u UDP mode.
-U <path> Unix socket mode.
-z Zero-I/O port scan.
-w <sec> Timeout in seconds.
-v Verbose output.
-n Disable DNS resolution.
-k Keep listener open after client disconnects.
-s <src> Source address/interface.
-4 Force IPv4.
-6 Force IPv6.
-N Shutdown write after stdin EOF.
-q Listener quits after first client.
-i <file> Input file.
-o <file> Output file.
-e <cmd> Execute command on connect.
-c <cmd> Execute shell command on connect.
-L <host:port> TCP port forwarder.
-X <password> Encrypt traffic (AES-256-GCM).
--encrypt <password> Alias for -X.
--web Mask traffic as HTTP requests.
--http Alias for --web.
--broker Chat relay between clients.
--chat Alias for --broker.
--tty Auto-stabilize incoming shell.
--pty Allocate PTY on the listener side.
--no-pty Disable default PTY.
--shell <path> Explicit shell for PTY.
--json JSON scan output.
--open-only Print only open ports.
--min-rate <n> Minimum scan rate.
--max-rate <n> Maximum scan rate.
--up Update from GitHub repository.
--help Show help.
--version Show version.

Modes

Client

e.cat 127.0.0.1 4444
e.cat -n 127.0.0.1 4444
e.cat -4 127.0.0.1 4444
e.cat -6 ::1 4444
e.cat -w 5 127.0.0.1 4444
e.cat -i input.txt 127.0.0.1 4444
e.cat -o output.txt 127.0.0.1 4444

Listener

e.cat -lvnp 4444
e.cat -lvnp 4444 -k
e.cat -lvnp 4444 -q
e.cat -lvnp 4444 --no-pty
e.cat -lvnp 4444 --shell /bin/bash
e.cat -lvnp 4444 -v

UDP

e.cat -u -lvnp 5353
e.cat -u 127.0.0.1 5353

Unix socket

e.cat -U /tmp/ecat.sock -l
e.cat -U /tmp/ecat.sock

PTY

PTY is enabled by default on the listener side. It makes remote shells behave like real terminals. Disable it with --no-pty.

e.cat -lvnp 4444
e.cat -lvnp 4444 --no-pty
e.cat -lvnp 4444 --shell /bin/fish

Fallback order:

script -> python3 -> python -> ruby -> perl -> expect -> shell

If no PTY helper exists, e.cat still starts the selected shell without a PTY.


Interactive mode

While attached to a session, press Ctrl+] to open the e.cat interactive terminal. It provides inject, upload and download, plus help and exit. Press exit or Enter on an empty line to return to the session. Press Ctrl+C to detach on the client side; the remote session keeps running.

  • upload <local> [remote] — send a local file to the remote side (default remote path /tmp/<name>).
  • download <remote> [local] — fetch a remote file to your local machine (default local name = remote basename).

Both show a live progress indicator (percent for upload, bytes received for download). Transfers run over the existing session using base64 with start/end markers, so they also work through -X encryption and --web masking.

e.cat> help
commands: inject | upload <local> [remote] | download <remote> [local] | exit
e.cat> inject
e.cat> upload file.bin /tmp/file.bin
e.cat> download /etc/passwd ./passwd

inject sends the local e.cat binary to the remote side as base64 and assembles it in RAM under /dev/shm (tmpfs, no disk write), so e.cat is available on both ends for upload/download.


Encryption

-X <password> (alias --encrypt) encrypts the whole stream with AES-256-GCM. Both sides must use the same password. The key is derived from the password with SHA-256. Each chunk is an independent authenticated record, so tampering is detected and wrong passwords yield no plaintext.

e.cat -X hunter2 -lvnp 4444
e.cat -X hunter2 127.0.0.1 4444

Web masking

--web (alias --http) wraps the stream in HTTP-looking requests so it blends with normal web traffic. Combine it with -X to both encrypt and disguise. Both sides must pass the same flags.

e.cat --web -X hunter2 -lvnp 4444
e.cat --web -X hunter2 127.0.0.1 4444

-X and --web apply to TCP and Unix sockets. They are ignored over UDP.


Port scan

e.cat -z 127.0.0.1 1-1000
e.cat -z 127.0.0.1 22,80,443
e.cat -z 127.0.0.1 1-65535 --open-only
e.cat -z 127.0.0.1 1-1000 --json
e.cat -z 127.0.0.1 1-1000 --min-rate 100 --max-rate 1000
e.cat -z -w 2 127.0.0.1 1-1000

Port lists accept ranges and comma separated values. JSON output is useful for scripts.


Forwarder

e.cat -L 8080:127.0.0.1:80 -l -p 8080

The forwarder listens on the local port and forwards to the target.


Chat relay

e.cat --broker -lvnp 4444
e.cat --chat -lvnp 4444

Connect multiple clients and messages are relayed between them.


Exec

e.cat -e /bin/sh -lvnp 4444
e.cat -c "id; uname -a" -lvnp 4444
e.cat -c "cat /etc/os-release" -lvnp 4444

-e executes a binary. -c executes a shell command line.


Exit codes

0  success
1  runtime failure
2  usage error

Scripts can rely on non-zero exit codes.


Recipes

# Goal Command
1 Send a file e.cat -lvnp 4444 > file.bin
2 Receive a file e.cat -i file.bin 127.0.0.1 4444
3 Remote shell e.cat -lvnp 4444
4 Remote shell client e.cat 127.0.0.1 4444
5 UDP listener e.cat -u -lvnp 5353
6 UDP client e.cat -u 127.0.0.1 5353
7 Unix listener e.cat -U /tmp/ecat.sock -l
8 Unix client e.cat -U /tmp/ecat.sock
9 Scan localhost e.cat -z 127.0.0.1 1-1000
10 JSON scan e.cat -z 127.0.0.1 1-1000 --json
11 Forward HTTP e.cat -L 8080:127.0.0.1:80 -l -p 8080
12 Chat relay e.cat --broker -lvnp 4444
13 Encrypted shell e.cat -X pass -lvnp 4444
14 Masked + encrypted e.cat --web -X pass -lvnp 4444

Update

e.cat --up

--up checks the latest commit, compares it with the commit embedded in the current binary, downloads the latest source, builds a new binary and replaces the running executable (and the system e.cat in /usr/local/bin, ~/.local/bin and PATH when present).


Security

e.cat is a power tool. It can expose shells and transfer files. Use it only on networks and hosts you own or are authorized to test.

  • Prefer --no-pty when a shell is not required.
  • Bind to 127.0.0.1 instead of 0.0.0.0 when possible.
  • Use firewall rules.
  • Do not expose e.cat to the public internet without authentication.
  • Scan only authorized targets.

License

MIT — see LICENSE.


About

e.cat is a native, single-binary netcat/ncat alternative written in Go with no runtime dependencies. It is designed for Linux, CTF environments, local labs, embedded devices, and quick remote access. The listener stays open for multiple clients and allocates a PTY by default, so shells, editors, and interactive programs behave like a real terminal.

Topics

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages