Remote vanilla PDB (over TCP sockets) done right: no extras, proper handling around connection failures and CI.

Overview

Overview

docs Documentation Status
tests
Travis-CI Build Status AppVeyor Build Status Requirements Status
Coverage Status Coverage Status
package

Remote vanilla PDB (over TCP sockets) done right: no extras, proper handling around connection failures and CI. Based on pdbx.

  • Free software: BSD 2-Clause License

Installation

pip install remote-pdb

Usage

To open a remote PDB on first available port:

from remote_pdb import set_trace
set_trace() # you'll see the port number in the logs

To use some specific host/port:

from remote_pdb import RemotePdb
RemotePdb('127.0.0.1', 4444).set_trace()

To connect just run telnet 127.0.0.1 4444. When you are finished debugging, either exit the debugger, or press Control-], then Control-d.

Alternately, one can connect with NetCat: nc -C 127.0.0.1 4444 or Socat: socat readline tcp:127.0.0.1:4444 (for line editing and history support). When finished debugging, either exit the debugger, or press Control-c.

Note that newer Ubuntu disabled readline support in socat, so if you get unknown device/address "readline" try using rlwrap like this:

rlwrap socat - tcp:127.0.0.1:4444

Using in containers

If you want to connect from the host to remote-pdb running inside the container you should make sure that:

  • The port you will use is mapped (eg: -p 4444:4444).
  • The host is set to 0.0.0.0 (localhost` or ``127.0.0.1 will not work because Docker doesn't map the port on the local interface).

Integration with breakpoint() in Python 3.7+

If you are using Python 3.7 one can use the new breakpoint() built in to invoke remote PDB. In this case the following environment variable must be set:

PYTHONBREAKPOINT=remote_pdb.set_trace

The debugger can then be invoked as follows, without any imports:

breakpoint()

As the breakpoint() function does not take any arguments, environment variables can be used to specify the host and port that the server should listen to. For example, to run script.py in such a way as to make telnet 127.0.0.1 4444 the correct way of connecting, one would run:

PYTHONBREAKPOINT=remote_pdb.set_trace REMOTE_PDB_HOST=127.0.0.1 REMOTE_PDB_PORT=4444 python script.py

If REMOTE_PDB_HOST is omitted then a default value of 127.0.0.1 will be used. If REMOTE_PDB_PORT is omitted then the first available port will be used. The connection information will be logged to the console, as with calls to remote_pdb.set_trace().

To quiet the output, set REMOTE_PDB_QUIET=1, this will prevent RemotePdb from producing any output -- you'll probably want to specify REMOTE_PDB_PORT as well since the randomized port won't be printed.

Note about OS X

In certain scenarios (backgrounded processes) OS X will prevent readline to be imported (and readline is a dependency of pdb). A workaround (run this early):

import signal
signal.signal(signal.SIGTTOU, signal.SIG_IGN)

See #9 and cpython#14892.

Requirements

Python 2.6, 2.7, 3.2, 3.3 and PyPy are supported.

Similar projects

Owner
Ionel Cristian Mărieș
Ionel Cristian Mărieș
Distribute a portion of your yield to other addresses 💙

YSHARE Distribute a portion of your yield to other addresses. How does it work Desposit your yToken or tokens into this contract Set the benificiaries

11 Nov 24, 2021
OptiPLANT is a cloud-based based system that empowers professional and non-professional data scientists to build high-quality predictive models

OptiPLANT OptiPLANT is a cloud-based based system that empowers professional and non-professional data scientists to build high-quality predictive mod

Intellia ICT 1 Jan 26, 2022
The Delegate Network: An Interactive Voice Response Delegative Democracy Implementation of Liquid Democracy

The Delegate Network Overview The delegate network is a completely transparent, easy-to-use and understand version of what is sometimes called liquid

James Bowery 2 Feb 25, 2022
Asynchronous For Python(asyncio)

asyncio is a library to write concurrent code using the async/await syntax.asyncio is used as a foundation for multiple Python asynchronous frameworks that provide high-performance network and web-se

Janak raikhola 0 Feb 05, 2022
A simple and lightweight server that allows clients to connect and launch a shell remotely through a browser.

carrotsh A simple and lightweight server that allows clients to connect and launch a shell remotely through a browser. Uses xterm.js for the frontend

V9 31 Dec 27, 2022
A python 3 library which helps in using nmap port scanner.

A python 3 library which helps in using nmap port scanner. This is done by converting each nmap command into a callable python3 method or function. System administrators can now automatic nmap scans

Nmmapper 179 Dec 19, 2022
Wallc - Calculate the layout on the wall to hang up pictures

wallc Calculate the layout on the wall to hang up pictures. Installation pip install git+https://github.com/trbznk/wallc.git Getting Started Currently

Alex Trbznk 68 Sep 09, 2022
Simple Port Scanner With Socket Module In Python 3x

PortScanner Simple Port Scanner With Socket Module In Python 3x How To Install Requirements Of This Port Scanner sudo apt install python3;sudo apt ins

1 Nov 23, 2021
Dshell is a network forensic analysis framework.

Dshell An extensible network forensic analysis framework. Enables rapid development of plugins to support the dissection of network packet captures. K

DEVCOM Army Research Laboratory 5.4k Jan 06, 2023
sshuttle: where transparent proxy meets VPN meets ssh

Transparent proxy server that works as a poor man's VPN. Forwards over ssh. Doesn't require admin. Works with Linux and MacOS. Supports DNS tunneling.

9.4k Jan 09, 2023
Herramienta para transferir eventos de Shadowserver REST API hacia Azure Blob Storage.

Herramienta para transferir eventos de Shadowserver REST API hacia Azure Blob Storage.

CSIRT-RD 1 Feb 04, 2022
SMS Based Headless Browsing

Browse the internet without a network connection - Submission for ConUHacks VI

Zafir Khalid 2 Feb 07, 2022
A light-weight open-source project CLI utility for showing services running on ports in a host

Portable Port Scanner (ppscanner) Portable Port Scanner (ppscanner) is a light-weight open-source CLI utility that leverages on nmap to make quick and

1 Oct 30, 2021
pureSxS - A tool to export Component Based Servicing packages from a full Windows installation

pureSxS A tool to export Component Based Servicing packages from a full Windows installation. Usage pureSxS.py source_mum destination pureSxS wor

Gamers Against Weed 3 Oct 03, 2022
Simple local RPG turn-based to play while learn something using the anki system

Simple local RPG turn-based to play while learn something using the anki system

Raphael Kieling 5 Aug 02, 2022
A simple port scanner for Web/ip scanning Port 0/500 editable inside the .py file

Simple-Port-Scanner a simple port scanner for Web/ip scanning Port 0/500 editable inside the .py file Open Cmd/Terminal Cmd Downloads Run Command: pip

YABOI 1 Nov 22, 2021
Tripwire monitors ports and icmp to send the admin a message if somebody is scanning a machine that shouldn't be touched

Tripwire monitors ports and icmp to send the admin a message if somebody is scanning a machine that shouldn't be touched

3 Apr 05, 2022
TsuserverMoS - A Python-based server for Attorney Online,

tsuserverMoS A Python-based server for Attorney Online, forked from RealKaiser/tsuserverCC Requires Python 3.7+ and PyYAML. Changes/additions from tsu

1 Dec 30, 2021
It's a little project for change MAC address, for ethical hacking purposes

MACChangerPy It's a small project for MAC address change, for ethical hacking purposes, don't use it for bad purposes, any infringement will be your r

Erick Adriano Nunes da Silva 1 Mar 11, 2022
Take a list of domains and probe for working HTTP and HTTPS servers

httprobe Take a list of domains and probe for working http and https servers. Install ▶ go get -u github.com/tomnomnom/httprobe Basic Usage httprobe

Tom Hudson 2.3k Dec 28, 2022