New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

hypno

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hypno

A tool/library allowing to inject python code into a running python process.

  • 1.1.0
  • PyPI
  • Socket score

Maintainers
1

Hypno

PyPI version PyPI Supported Python Versions GitHub license Tests (GitHub Actions) chat

A cross-platform tool/library allowing to inject python code into a running python process. Based on kmaork/pyinjector.

If you are trying to debug a python process, check out kmaork/madbg.

Installation

pip install hypno

Both source distributions, manylinux, musslinux, mac and windows wheels are uploaded to pypi for every release.

Usage

CLI
hypno <pid> <python_code>
API
from hypno import inject_py

inject_py(pid, python_code)
Example

This example runs a python program that prints its pid, and then attaches to the newly created process and injects it with another print statement using hypno. Mac users will need to use sudo for the second command.

python -c "import os, time; print('Hello from', os.getpid()); time.sleep(0.5)" &\
hypno $! "import os; print('Hello again from', os.getpid())"

Security

Hypno briefly generates a temporary file containing the requested python code. This file is given 644 permissions by default, which means all users can read it. To use custom permissions, you can pass the permissions argument to inject_py().

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc