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

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

Netcat

Maintaining Access

Basic TCP/IP swiss army knife for shells and port scanning.

Socat

Maintaining Access

Advanced bidirectional relay for shells, forwarding, and SSL tunnels.

Metasploit

Exploitation

Full exploitation framework with Meterpreter for post-exploitation.

LinPEAS

Post Exploitation

Linux privilege escalation auditing script for finding privesc vectors.

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.