[Docker] 시스템해킹 Docker 빌드했는데 socat 권한이 없을 때

2024-07-09 16:56:27 2024/07/09 07:56:27 socat[9] E execvp("/home/test/test", "/home/test/test"): Permission denied
2024-07-09 16:56:27 2024/07/09 07:56:27 socat[8] E waitpid(): child 9 exited with status 1

 

가끔 Dockerfile을 빌드해도 권한 문제로 기본적인 문제풀이를 위한 로컬 구성이 되지 않을 때가 많은데

여러 이유가 있겠지만 Dockerfile내에 chmod를 통한 권한 설정과  $user 설정까지 다 잘 되어있다면

 

 

Dockerfile 에서 chown -R root:root 구문을 삭제하고 빌드해보자.

RUN chown -R root:root /home/$user

 

 

chown 삭제 전

> nc 127.0.0.1 7182
whoami
ls
cat

chown 삭제 후

nc 127.0.0.1 7182
[1] Leak Canary
Buf: 이걸 원했지 
Buf: 이걸 원했지

[2] Input ROP payload

 

 

뭐랄까 뭐가 꼬였는진 몰라도 참 .. 억까다.