skysider / pwndocker

A docker environment for pwn in ctf
GNU General Public License v3.0
738 stars 142 forks source link

gdb can't disable ASLR inside the container #18

Closed sudw1n closed 1 year ago

sudw1n commented 1 year ago

While trying to open up a binary with gdb inside the container, it reports:

warning: Error disabling address space randomization: Operation not permitted

A Stack Overflow answer suggested adding a --security-opt seccomp=unconfined option on the command line. The docker-compose version of this would be:

security_opt:
    - seccomp:unconfined

Adding this option to the docker-compose.yml makes gdb work properly. I would just open up a PR but I'm not sure if this is the right approach. The issue is there, modifying the docker-compose.yml file is just a suggestion.

sudw1n commented 1 year ago

Just for clarity, this is what the final version of the docker-compose.yml file looks like:

version: '3'
services:
    pwn:
        container_name: pwn_test
        image: skysider/pwndocker
        cap_add:
            - SYS_PTRACE
        security_opt:
            - seccomp:unconfined
        ports:
            - "23946:23946"
skysider commented 1 year ago

I will deal with it soon