https://github.com/plusls/pwn-docker-environment
Debug pwn in docker, no need for virtual machines
https://github.com/plusls/pwn-docker-environment
Last synced: 12 months ago
JSON representation
Debug pwn in docker, no need for virtual machines
- Host: GitHub
- URL: https://github.com/plusls/pwn-docker-environment
- Owner: plusls
- Created: 2020-02-17T10:01:46.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-04-06T05:23:11.000Z (about 4 years ago)
- Last Synced: 2025-03-18T13:44:44.683Z (over 1 year ago)
- Language: Python
- Size: 4.75 MB
- Stars: 35
- Watchers: 1
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# pwn-docker-environment
Debug pwn in docker, no need for virtual machines
## Introduction
Did you debug pwn in a virtual machine?
Are you still worried about the virtual machine taking up too much hard disk?

Try this!
Just need to install the basic libraries in docker, you can debug the program as usual!
The docker image will take up very little space.

## Quick Start
### Linux
1. Install docker and docker-compose pwndbg
2. Add your user to docker group.
3. Install requirements:
```bash
pip3 install pwntools --user
```
4. Install pwn-docker-environment.
```bash
git clone https://github.com/plusls/pwn-docker-environment.git
cd pwn-docker-environment
docker-compose up -d
```
5. Run test script
```bash
cd binary
python3 test.py
```
### Screenshot
1. wsl2 + tmux

2. wsl2 + windows terminal

### Tips
1. You can link `docker_debug.py` to `~/.local/lib/{python_version}/site-packages/docker_debug.py`
```bash
ln -s ~/pwn-docker-environment/docker_debug.py ~/.local/lib/{python_version}/site-packages/docker_debug.py
```
2. You can add `cp-pwn` script to `~/.local/bin` to quick copy binary to docker
example:
```bash
#!/bin/bash
cp -r $1 ~/pwn-docker-environment/binary/.
```
You can use it like this:
```bash
cp-pwn ./mybinary
```
You also can add alias in `.bashrc`
```bash
alias cp-pwn='_cp_pwn(){ if [ ! -n "$1" ] ;then echo "cp-pwn ";else cp -r $1 ${HOME}/pwn-docker-environment/binary/.; fi}; _cp_pwn'
```
3. When use windows terminal with wsl2, you can add config to `~/.config/pwn.conf`
```
[context]
terminal=['wt.exe', '-w', '0', 'split-pane', 'wsl.exe', '-e']
[update]
interval=never
```
3. When use tmux, you can add config to `~/.config/pwn.conf`
```
[context]
terminal=['tmux', 'splitw', '-h']
[update]
interval=never
```