Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

Cover image for Inject code in Python process
petercour
petercour

Posted on

     

Inject code in Python process

Python is widely used for software development. By universities, companies and many more. So is Python an utopia that will solve all computer problems?

Did you know you can inject code into a running Python process? You can usePyrasite for that. This needs Python 2.4 or higher.

You can watch a demo here:demo

It comes with several programs, including a shell

$ pyrasite-shellUsage: pyrasite-shell <PID>
Enter fullscreen modeExit fullscreen mode

So you can inject a payload

$ pyrasite <PID> payload.py
Enter fullscreen modeExit fullscreen mode

You can find someexample payloads here.

So if you have the process id , you can inject anything into the running program.

There's also aGUI. It lets you easily monitor, analyze, introspect, and alter running Python programs.

Related links:

Top comments(0)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

  • Joined

More frompetercour

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp