Open-source cross-platform RAT and post-exploitation framework

Pupy C2

Pupy is an open-source, cross-platform remote access and post-exploitation framework written mostly in Python. It runs an implant in memory on Windows, Linux, macOS, and Android, and gives the operator a single console to execute commands, move laterally, and pull data off any of them. Published as a research and red-team tool, it has spent years as a favorite of state-linked crews, most notably Iranian groups, and was rebuilt into the Decoy Dog backdoor used against Russian targets. The controller is the server the implants call home to, and that is the part exposed to the internet.

A detected Pupy controller tells you the handler is live and listening, not who is operating it. The same server could belong to a red team mid-engagement or to an espionage crew staging the next intrusion, so a hit is the start of an investigation rather than its conclusion.

  • Actively tracked
  • First seen 2015
Analysis

Quick facts

  • Aliases: Pupy, Pupy RAT, Pupy C2; the Decoy Dog backdoor is a heavily modified fork

  • Type: open-source cross-platform RAT and post-exploitation framework

  • Lineage: single project by Nicolas Verdier (n1nj4sec); forked and extended into Decoy Dog by a separate actor

  • Written in: Python, with reflective in-memory loading so the implant avoids touching disk

  • Default handler ports: 9000 and 9001

  • First seen: 2015

  • Project: github.com/n1nj4sec/pupy

  • MITRE ATT&CK: T1219 Remote Access Software, T1071 Application Layer Protocol, T1620 Reflective Code Loading, T1105 Ingress Tool Transfer

Analysis

Where a Pupy handler phones home

Pupy splits into an implant and a handler. The implant loads reflectively and beacons out, which keeps it off disk and hard to catch on the endpoint. The handler is the operator's server, and it has to accept those connections on a port, which is where it becomes findable. On a stock build that port is 9000 or 9001, and the handful of operators who never change it leave the handler listening in the open on a public VPS.

Pupy C2 controllers in Hunt.io's view with the live IP trend over the month and validation stateFigure 01. Pupy controllers as Hunt.io tracks them, with the month's trend and the ports the handler listens on.

The implant's in-memory design means endpoint hunting for Pupy is thankless, so the infrastructure side is where the leverage sits. A handler on 9000 or 9001, with a TLS layer that does not match any real service, is a concrete thing to find and pivot on even when the implant on the victim leaves almost no trace.

Analysis

Pupy IOC feed: live handlers

Showing the current handlers. Unlock all IOCs for free to pull them with first-seen and last-seen timestamps.

HuntSQL

Locating Pupy handlers in HuntSQL

The count comes from one HuntSQL query against the malware table, over unique IPs:

count unique active servers
SELECT uniq(ip) AS unique_ips
FROM malware
WHERE malware.name = 'Pupy C2' AND is_active = true

With only a handful of handlers live, a port-and-country rollup beats a raw list; it shows the listener ports and where each clusters in one view:

group results
SELECT port, asn.country_code, uniq(ip) AS servers
FROM malware
WHERE malware.name = 'Pupy C2' AND is_active = true
GROUP BY port, asn.country_code
ORDER BY servers DESC

Output example:

HuntSQL results for live Pupy handlers with the events-over-time bars and the IP rowsFigure 02. Live Pupy handlers from HuntSQL, with the activity timeline above the rows.

The same rollup runs through the Hunt.io MCP server without writing SQL. Asked to count live Pupy C2 handlers, Claude queries the feed, deduplicates to distinct hosts, and breaks the result down by port and hosting ASN in one pull.

Claude counting live Pupy C2 handlers through the Hunt.io MCP, split by port and ASNFigure 03. The same count through the Hunt.io MCP: distinct active Pupy handlers split by port and ASN, with the 9001 listeners concentrated on one Hong Kong network.

The 9001 listeners all cluster in Hong Kong while the 9000 handlers scatter across Poland, Singapore, and Japan, so the port here does more than confirm the family, it separates a tight cluster from the one-off boxes. The Hong Kong group on adjacent XNNET addresses points at one operator running more than one handler, the kind of pattern that detecting C2 by its infrastructure surfaces where a payload hunt never would. A handler that shares a certificate or a /24 with another is the thread to pull.

In the wild

Pupy across recent campaigns

Pupy's long tail of state-linked use is what makes it worth tracking despite being a decade old.

One open-source framework serving Iranian espionage, an East Asian crime group, and a Russia-focused operator is why the malware name alone settles nothing; the infrastructure and the fork in use carry the attribution.

Analysis

Turning a handler into a lead

A Pupy handler in the feed is a live console, and from a single IP the moves that pay off are the TLS certificate, the listening port, and the hosting neighborhood. Operators who reuse a certificate across rebuilds link handlers that otherwise look separate, and adjacent addresses on the same small provider, as with the Hong Kong pair above, usually belong to one hand.

The Pupy C2 fleet in Hunt.io's C2 listing, three Hong Kong handlers on port 9001 and a hostname on oneFigure 04. The full Pupy fleet in one view. The three Hong Kong handlers share port 9001 and adjacent XNNET addresses, and one carries a recorded hostname, which is the next thing to pivot on.

Pupy rarely works alone on a box. When a handler shares infrastructure with a Sliver listener or another framework, the overlap ties the recon and command layers of one operation together, and the IOC Hunter connects a handler to the reporting that already names it. Reading the handler as the fixed command-and-control asset it is, and pivoting from it through the C2 infrastructure feed, is how a single detection becomes a view of the operator's wider setup.

Questions

Pupy, answered

What port does Pupy use?

Stock builds listen on 9000 and 9001. Operators can change it, but those two ports remain the clearest signal across live handlers, since the in-memory implant gives little else to pivot on.

Is Pupy malware?

It is an open-source post-exploitation framework, published for research and red-team use, that functions as a full remote access trojan once deployed. A Pupy handler in the wild is far more often part of a real intrusion than a sanctioned test, which is why it is tracked here, but the tool itself is dual-use.

What is Decoy Dog?

Decoy Dog is a heavily modified fork of Pupy, extended with its own persistence and DNS-based control, used by the HellHounds group against Russian organizations. It shares Pupy's core but is a distinct backdoor.

Why do APTs favor an old open-source RAT?

Pupy loads in memory, runs on every major platform from one console, and is free, so it gives capable operators a cross-platform implant with no licensing trail and plenty of plausible deniability. Those traits have kept it in Iranian and other state-linked toolkits for years.

How do you detect a Pupy controller?

Look at the infrastructure, not the endpoint. A handler listening on 9000 or 9001, or a TLS service whose certificate does not match a real application, is the finding, and the certificate and hosting then pivot to the operator's other handlers.