Skip to main content

Inject code into a running Python process

Project description

Injects code into a running Python process.

Requirements

Example Payloads

Hello World

pyrasite <PID> payloads/helloworld.py

This payload is used by the test suite, which can be run by doing:

python setup.py test

Reverse Python Shell

$ python
>>> x = 'foo'
$ pyrasite <PID> payloads/reverse_python_shell.py
$ nc -l localhost 9001
Python 2.7.1 (r271:86832, Apr 12 2011, 16:15:16)
[GCC 4.6.0 20110331 (Red Hat 4.6.0-2)]
Type 'quit' to exit.
>>> print x
foo

>>> globals()['x'] = 'bar'

Reverse Shell

$ pyrasite <PID> payloads/reverse_shell.py
$ nc -l localhost 9001
Linux tomservo 2.6.40.3-0.fc15.x86_64 #1 SMP Tue Aug 16 04:10:59 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux
Type 'quit' to exit.
% ls

Dumping memory, modules, stacks

payloads/dump_memory.py
payloads/dump_modules.py
payloads/dump_stacks.py

Project details


Release history Release notifications

History Node

2.0

History Node

2.0beta9

History Node

2.0beta8

History Node

2.0beta7

History Node

2.0beta6

History Node

2.0beta5

History Node

2.0beta4

History Node

2.0beta3

History Node

2.0beta2

History Node

2.0beta

History Node

1.1

History Node

1.0

This version
History Node

1.0dev

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
pyrasite-1.0dev.tar.gz (4.8 kB) Copy SHA256 hash SHA256 Source None Sep 10, 2011

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page