Commit ca9ae4ee authored by Luke Macken's avatar Luke Macken

Merge branch 'develop'

Conflicts:
	pyrasite/tools/gui.py
	setup.py
parents b9f8d553 76067e84
...@@ -6,17 +6,10 @@ pyrasite ...@@ -6,17 +6,10 @@ pyrasite
Pyrasite lets you to inject arbitrary code into an unaltered running Python Pyrasite lets you to inject arbitrary code into an unaltered running Python
process. process.
It also contains a graphical interface that makes it easy to monitor and
introspect running processes.
Requirements Requirements
~~~~~~~~~~~~ ~~~~~~~~~~~~
- gdb (https://www.gnu.org/s/gdb) (version 7.3+) - gdb (https://www.gnu.org/s/gdb) (version 7.3+)
- python-gobject-dev (on debian or ubuntu: apt-get install python-gobject-dev)
- Cython (http://cython.org)
- meliae (https://launchpad.net/meliae)
- easy_install/pip may not work for this install. If not, use the tarball from the distribution website
Download Download
~~~~~~~~ ~~~~~~~~
...@@ -25,19 +18,23 @@ Download the latest stable release from PyPi: http://pypi.python.org/pypi/pyrasi ...@@ -25,19 +18,23 @@ Download the latest stable release from PyPi: http://pypi.python.org/pypi/pyrasi
:: ::
easy_install pyrasite pip install pyrasite
Grab the latest source by running: You can also run the latest pyrasite from source:
:: ::
git clone git://git.fedorahosted.org/git/pyrasite git clone git://git.fedorahosted.org/git/pyrasite
cd pyrasite
python -m pyrasite.main
You can also fork pyrasite on GitHub: http://github.com/lmacken/pyrasite You can also fork pyrasite on GitHub: http://github.com/lmacken/pyrasite
pyrasite-gui pyrasite-gui
~~~~~~~~~~~~ ~~~~~~~~~~~~
The gui has been moved into it's own repository: https://github.com/lmacken/pyrasite-gui
.. image:: http://lewk.org/img/pyrasite/pyrasite-info.png .. image:: http://lewk.org/img/pyrasite/pyrasite-info.png
API API
...@@ -48,7 +45,7 @@ API ...@@ -48,7 +45,7 @@ API
from pyrasite.inject import CodeInjector from pyrasite.inject import CodeInjector
ci = CodeInjector(p.pid) ci = CodeInjector(p.pid)
ci.inject('payloads/helloworld.py') ci.inject('pyrasite/payloads/helloworld.py')
Payloads Payloads
...@@ -67,7 +64,7 @@ This lets you easily introspect or alter any objects in your running process. ...@@ -67,7 +64,7 @@ This lets you easily introspect or alter any objects in your running process.
:: ::
$ pyrasite <PID> payloads/reverse_python_shell.py $ pyrasite <PID> pyrasite/payloads/reverse_python_shell.py
$ nc -l localhost 9001 $ nc -l localhost 9001
Python 2.7.1 (r271:86832, Apr 12 2011, 16:15:16) Python 2.7.1 (r271:86832, Apr 12 2011, 16:15:16)
[GCC 4.6.0 20110331 (Red Hat 4.6.0-2)] [GCC 4.6.0 20110331 (Red Hat 4.6.0-2)]
...@@ -82,13 +79,19 @@ Viewing the largest objects in your process ...@@ -82,13 +79,19 @@ Viewing the largest objects in your process
This payload uses `meliae <https://launchpad.net/meliae>`_ to dump all of the objects in your process to an `objects.json` file (currently dumped in the working directory of your process). This payload uses `meliae <https://launchpad.net/meliae>`_ to dump all of the objects in your process to an `objects.json` file (currently dumped in the working directory of your process).
:: We recommend using python-meliae from your OS distribution, if available. If it
is not, you will need to first install Cython, and then meliae seperately. If
pip/easy_install does not work, you may need to use the tarball from the
upstream website.
$ pyrasite <PID> payloads/dump_memory.py ::
$ pyrasite <PID> pyrasite/payloads/dump_memory.py
Pyrasite also provides a tool to view the values of largest objects in your process.
Pyrasite also provides a tool to view the values of largest objects in your
process. This requires `urwid <http://pypi.python.org/pypi/urwid>`_ to be
installed.
:: ::
...@@ -103,7 +106,7 @@ Reverse Shell ...@@ -103,7 +106,7 @@ Reverse Shell
:: ::
$ pyrasite <PID> payloads/reverse_shell.py $ pyrasite <PID> pyrasite/payloads/reverse_shell.py
$ nc -l localhost 9001 $ 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 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. Type 'quit' to exit.
...@@ -118,8 +121,8 @@ graph using `pycallgraph <http://pycallgraph.slowchop.com>`_. ...@@ -118,8 +121,8 @@ graph using `pycallgraph <http://pycallgraph.slowchop.com>`_.
:: ::
$ pyrasite <PID> payloads/start_callgraph.py $ pyrasite <PID> pyrasite/payloads/start_callgraph.py
$ pyrasite <PID> payloads/stop_callgraph.py $ pyrasite <PID> pyrasite/payloads/stop_callgraph.py
The callgraph is then generated using `graphviz <http://www.graphviz.org>`_ and The callgraph is then generated using `graphviz <http://www.graphviz.org>`_ and
saved to `callgraph.png`. You can see an example callgraph `here <http://pycallgraph.slowchop.com/pycallgraph/wiki/RegExpExample>`_. saved to `callgraph.png`. You can see an example callgraph `here <http://pycallgraph.slowchop.com/pycallgraph/wiki/RegExpExample>`_.
...@@ -130,9 +133,9 @@ Dumping modules, thread stacks, and forcing garbage collection ...@@ -130,9 +133,9 @@ Dumping modules, thread stacks, and forcing garbage collection
:: ::
payloads/dump_modules.py pyrasite/payloads/dump_modules.py
payloads/dump_stacks.py pyrasite/payloads/dump_stacks.py
payloads/force_garbage_collection.py pyrasite/payloads/force_garbage_collection.py
Additional installation notes Additional installation notes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...@@ -145,7 +148,7 @@ If you don't want to override Apple's default gdb, install the latest version of ...@@ -145,7 +148,7 @@ If you don't want to override Apple's default gdb, install the latest version of
:: ::
$ ./configure --program-prefix=gnu $ ./configure --program-prefix=gnu
$ pyrasite <PID> payloads/reverse_python_shell.py --prefix="gnu" $ pyrasite <PID> pyrasite/payloads/reverse_python_shell.py --prefix="gnu"
Ubuntu Ubuntu
------ ------
......
pyrasite-gui - A graphical interface for Pyrasite pyrasite-gui - A graphical interface for Pyrasite
================================================= =================================================
The GUI has been moved into it's own repository:
https://github.com/lmacken/pyrasite-gui
.. image:: http://lewk.org/img/pyrasite/pyrasite-info.png .. image:: http://lewk.org/img/pyrasite/pyrasite-info.png
.. image:: http://lewk.org/img/pyrasite/pyrasite-stacks.png .. image:: http://lewk.org/img/pyrasite/pyrasite-stacks.png
......
This diff is collapsed.
This diff is collapsed.
...@@ -6,12 +6,6 @@ f = open('README.rst') ...@@ -6,12 +6,6 @@ f = open('README.rst')
long_description = f.read().split('split here')[1] long_description = f.read().split('split here')[1]
f.close() f.close()
try:
from meliae import version_info
except ImportError:
print "We require meliae to be installed."
exit(1)
setup(name='pyrasite', setup(name='pyrasite',
version=version, version=version,
description="Inject code into a running Python process", description="Inject code into a running Python process",
...@@ -24,13 +18,7 @@ setup(name='pyrasite', ...@@ -24,13 +18,7 @@ setup(name='pyrasite',
packages=find_packages(exclude=['ez_setup', 'examples', 'tests']), packages=find_packages(exclude=['ez_setup', 'examples', 'tests']),
include_package_data=True, include_package_data=True,
zip_safe=False, zip_safe=False,
install_requires=[ install_requires=[],
"Cython", # Needed for meliae
"meliae",
"pycallgraph",
"psutil",
"Sphinx",
],
tests_require=['nose'], tests_require=['nose'],
test_suite='nose.collector', test_suite='nose.collector',
entry_points=""" entry_points="""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment