How to install Pupy

Pupy is an open source tool for cross-platform remote administration (Windows, Linux, OSX, Android are supported as “clients”) and post-exploitation. Written mostly in Python.

Simply say, this program will create backdoors for different OSs, perform actions to add persistence on remote systems, perform exploits to collect data, increase the privileges, to download or upload files, screen capture, keylogging, etc. At the same time, Pupy also perfectly is suitable for legitimate remote administration of systems.

Potential uses of Pupy:

  • Security research
  • Education
  • Penetration testing
  • System Administration
  • Privacy focused python projects requiring low disk footprints
  • And more…

More information about Pupy you will find here:

This is one of several articles about Pupy. In this one the installation is described step by step. The following articles will discuss the principles of the program, basic concepts, practical examples of use.

Those interested in this topic also recommend the article ‘Concealed control of a Windows-based computer’ dedicated to similar tools in Metasploit.

How to install Pupy in Kali Linux

The author of the program offers two installation options: directly to the system and using Docker.

This program has a bug (about it will be slightly lower) due to incompatibility with the latest version of one of the Python module. This bug leads to the fact that Pupy does not work in listen mode (it cannot accept connections). When using Docker, errors are not displayed on the screen and it is difficult to understand what the problem is. But much worse is that it is not clear how to fix the problem with the library in this container.

Therefore, I will consider two options for installation — directly into the system and using Docker — but I recommend using the installation option directly into the system.

How to install Pupy on Kali Linux without Docker

Run the following commands:

sudo apt install git libssl1.0-dev libffi-dev python-dev python-pip build-essential swig tcpdump python-virtualenv
git clone --recursive
cd pupy
python -DG pupyw

To fix the error:

sudo pip2 install rpyc==3.4.4

For start:

export PATH=$PATH:~/.local/bin; pupysh

Installing Pupy on Kali Linux using Docker

To install and run Docker, run the following commands:

git clone
cd pupy

Open the file and replace the line there:

if [ "$EUID" == 0 ]


if [ "$EUID" == 100500 ]

Then run the commands:

sudo pip uninstall backports.ssl-match-hostname
sudo apt-get install python-backports.ssl-match-hostname

To run the program:


Installation in BlackArch

Installation in BlackArch is as follows:

sudo pacman -S pupy

To fix the bug, you need to remove the new version of one of the Python packages, so that the system does not remove Pupy itself, for which this file is a mandatory dependency:

sudo pacman -Rdd python2-rpyc

And install a version that does not cause problems:

sudo pip2 install rpyc==3.4.4

But payloads, which I generated in BlackArch, do not to connect to the controlling computer…

Solving the problem with the ‘Cannot read wireshark manuf database’ error

When you run Pupy, see if the line is there:

Cannot read wireshark manuf database

If present, then there is a serious error. Details about this bug here:

The problem is that when the Victim’s computer tries to connect to the Attacker’s computer, the following error appears:

Exception AttributeError: AttributeError("'PupyConnection' object has no attribute '_closed'",) in <object repr() failed> ignored
Exception in thread Authentication Thread (
Traceback (most recent call last):
  File "/usr/lib/python2.7/", line 801, in __bootstrap_inner
  File "/usr/lib/python2.7/", line 754, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/usr/share/pupy/network/lib/", line 135, in _setup_connection
  File "/usr/share/pupy/network/lib/", line 269, in __init__
    Connection.__init__(self, *args, **kwargs)
TypeError: __init__() got an unexpected keyword argument '_lazy'
Exception AttributeError: AttributeError("'PupyConnection' object has no attribute '_closed'",) in <object repr() failed> ignored

That is, the listening mode for the reverse shell in Pupy does not actually work.

The problem is solved by downgrading the version of the rpyc package to 3.4.4:

sudo pip2 install rpyc==3.4.4

Last Updated on

Recommended for you:

Leave a Reply

Your email address will not be published.