Skip to content

Docker environment for Pwn in CTF! Fuck the environment setup that's why this repo is created.

Notifications You must be signed in to change notification settings

Xh1Xxhg/NoPwnDocker

 
 

Repository files navigation

NoPwnDocker

Ubuntu16.04 到 Ubuntu24.04,一键 Pwn Docker 环境

程序

程序名称 说明 快捷键/用法
python python3.12 python
pwndbg GDB 调试增强插件 gdb
Pwngdb GDB 调试增强插件 gdb
gef GDB 调试增强插件,bata24 魔改,对内核支持更强 gdb,输入 gef-init
one_gadget 快速查找 libc 中的 execve("/bin/sh") one_gadget libc.so.6
ROPgadget ROP gadget 查找工具 ROPgadget --binary ./program
pwntools PWN 开发框架 Python 中 from pwn import *
seccomp-tools Seccomp 规则分析工具 seccomp-tools dump ./program
ropper 另一个 ROP gadget 查找工具 ropper -f ./program
tmux 终端复用工具 tmux (前缀键 Ctrl+a)
fish 友好的交互式 shell 默认 shell
z 快速目录跳转 z 目录名
fzf.fish 模糊查找增强 Ctrl+R (历史), Ctrl+F (文件)

安装

git clone https://github.com/MuelNova/NoPwnDocker
cd NoPwnDocker
docker compose build
# or
# docker compose up -d

运行

如果使用 docker compose:

docker exec -it NoPwn2404

如果仅运行

docker run -it --rm \  # 如果需要持久化,则去掉 --rm
           --security-opt seccomp:unconfined \
           --cap-add SYS_PTRACE \
           --add-host host.docker.internal:host-gateway \
           -v "$(pwd):/ctf" nopwnv2:18.04  # 或是其他版本

配置

Docker 中 Python GDB 版本等均可自定义,至于 Proxy,思想实验觉得是可以设置的,未实验。

docker-compose.ymlw

# 通用的构建参数
x-build-args: &build-args
  # 代理地址,在 Docker 中使用 host.docker.internal 访问主机
  # PROXY: "http://host.docker.internal:7890"
  PROXY: ""
  NO_PROXY: "localhost,127.0.0.1"

# 通用的服务配置
x-common: &common
  volumes:
    # - ./challenges:/ctf  # 修改为你的目录
  cap_add:
    - SYS_PTRACE
  security_opt:
    - seccomp=unconfined
  extra_hosts:
    - "host.docker.internal:host-gateway"

services:
  ubuntu24.04:
    build:
      context: .
      args:
        IMAGE: ubuntu:24.04
        <<: *build-args
        PYTHON_VERSION: 3.12.0
        GDB_VERSION: 15.2
        GDB_MULTIARCH: no
        RUBY_VERSION: 3.2.6
    <<: *common
    image: nopwnv2:24.04
    hostname: NoPwnV2_24.04
    container_name: NoPwn2404

对于额外的包,可以找到对应的 Dockerfile,在最下面添加。

修改后,重新编译即可

docker compose build ubuntu24.04

信息

amd R7 8845H + 32G RAM,代理网络速度大约在 7Mb/s 的情况下,总共花费大约 1600s 完成镜像编译。

每个镜像在 2.35GB ~ 2.77GB 之间。

About

Docker environment for Pwn in CTF! Fuck the environment setup that's why this repo is created.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Dockerfile 79.5%
  • Shell 15.8%
  • GDB 4.7%