- gdb (version 7.3+)
Pyrasite works with Python 2.4 and newer. Injection works between versions as well, so you can run Pyrasite under Python 3 and inject into 2, and vice versa.
You can download the latest tarballs, RPMs, and debs from PyPi. Installing the package specific to your distribution is recommended. However, you can also install it using pip if you wish
pip install pyrasite pyrasite-gui
Additional installation notes
If you're using Fedora 17 or later, you'll need to disable an SELinux boolean to allow ptrace.
sudo setsebool -P deny_ptrace=off
Mac OS X
If you don't want to override Apple's default gdb, install the latest version of gdb with a prefix (e.g. gnu)
$ ./configure --program-prefix=gnu $ pyrasite <PID> payloads/reverse_python_shell.py --gdb-prefix="gnu"
You can install pyrasite from the Arch User Repository If you want python debugging symbols, you may have to self compile python2.
Since version 10.10, Ubuntu ships with a controversial patch that restricts the scope of ptrace, which can be disabled by running:
echo 0 > /proc/sys/kernel/yama/ptrace_scope
You can make this change permanent by setting ptrace_scope to 0 in /etc/sysctl.d/10-ptrace.conf.