Skip to content

Commit 3c0124b

Browse files
committed
deleted unnecessary pages and modified some techniques
1 parent cd46c8b commit 3c0124b

27 files changed

+69
-1235
lines changed

src/exploit/container/docker/docker-escape.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ tags:
77
refs:
88
- https://book.hacktricks.xyz/linux-hardening/privilege-escalation/docker-breakout/docker-breakout-privilege-escalation
99
- https://gist.github.com/PwnPeter/3f0a678bf44902eae07486c9cc589c25
10-
date: 2024-09-25
10+
date: 2024-12-24
1111
draft: false
1212
---
1313

@@ -26,6 +26,15 @@ ls -al /usr/local/sbin
2626
ls -al /usr/bin
2727
ls -al /bin
2828

29+
# User enumeration
30+
cat /etc/passwd
31+
cat /etc/shadow
32+
getent passwd
33+
34+
# Networks
35+
cat /etc/hosts
36+
cat /etc/resolv.conf
37+
2938
# Bash history
3039
cat /root/.bash_history
3140
cat /home/<username>/.bash_history
@@ -75,8 +84,8 @@ capsh --print
7584

7685
### Access Another Host
7786

78-
If we found another host but cannot access it by restrictions, we need to port forward.
79-
Please see [details](/exploit/network/port-forwarding/port-forwarding-with-chisel) for port fowarding.
87+
If we found another host but cannot access it by restrictions, we need to **reverse port forward**.
88+
Please see [details](/exploit/network/port-forwarding/port-forwarding-with-chisel).
8089

8190
### Import Required Binary from Local Machine
8291

src/exploit/container/kubernetes/index.md

Lines changed: 12 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: A portable, extensible, open source platform for managing container
44
tags:
55
- Container
66
refs:
7-
date: 2024-08-11
7+
date: 2024-12-24
88
draft: false
99
---
1010

@@ -36,37 +36,28 @@ chmod +x /tmp/kubectl
3636

3737
## Investigation From Inside
3838

39-
### JWT
40-
4139
```sh
40+
# JWT token
4241
cat /var/run/secrets/kubernetes.io/serviceaccount/token
4342
# if we find the token, decode it in https://jwt.io/
44-
```
45-
46-
### Sensitive Information
4743

48-
```sh
44+
# Sensitinve information
4945
ls -a /var/lib/k0s/containerd/
50-
```
5146

52-
### Permissions
47+
# All information
48+
kubectl get all
5349

54-
```sh
50+
# Permissions
5551
kubectl auth can-i --list
5652
# /var/run/secrets/kubernetes.io/serviceaccount/token
5753
kubectl auth can-i --list --token=<JWT>
58-
```
5954

60-
### All Information
55+
# Roles
56+
kubectl get rolebindings -n <namespace>
57+
kubectl describe <bind_name> -n <namespace>
58+
kubectl describe role <role_name> -n <namespace>
6159

62-
```sh
63-
# All information
64-
kubectl get all
65-
```
66-
67-
### Pods
68-
69-
```sh
60+
# Pods
7061
kubectl get pods
7162
# -A: List all pods across all namespaces
7263
kubectl get pods -A
@@ -75,62 +66,40 @@ kubectl get pods -A
7566
kubectl get pod <pod-name> -o yaml
7667
# Specify the namespace
7768
kubectl get pod <pod-name> -n <namespace> -o yaml
78-
7969
# Get detailed information
8070
kubectl describe pods <pod-name>
8171
kubectl describe pod -n <namespace>
8272
# ClusterRole information
8373
kubectl describe clusterrole <role-name>
8474
# ClusterRoleBinding information
8575
kubectl describe clustrrolebinding <role-name>
86-
```
87-
88-
### Services
8976

90-
```sh
9177
# Services
9278
kubectl get svc
93-
```
94-
95-
### Jobs
9679

97-
```sh
9880
# Jobs
9981
kubectl get job -n <namespace>
10082
# -o: Output details
10183
kubectl get job -n <namespace> -o json
102-
```
10384

104-
### Secrets
105-
106-
```sh
10785
# Secrets
10886
kubectl get secrets
10987
kubectl get secrets -n <namespace>
110-
11188
# Get the specific secret
11289
kubectl get secret <secret-name> -o json
11390
kubectl get secret <secret-name> -n <namespace> -o json
114-
11591
# Edit the secret
11692
kubectl edit secret <secret-name>
11793
kubectl edit secret <secret-name> -n <namespace>
118-
11994
# List all data contained in the specific secret
12095
kubectl describe secret <secret-name>
12196
kubectl describe secret <secret-name> -n <namespace>
122-
```
12397

124-
### ServiceAccount
125-
126-
```sh
127-
# Get a ServiceAccounts
98+
# ServiceAccounts
12899
kubectl get serviceaccount
129100
kubectl get serviceaccount -n <namespace>
130-
131101
# Create a ServiceAccount
132102
kubectl create serviceaccount api-explorer
133-
134103
# Bind the ClusterRole to a ServiceAccount
135104
# eg. namespace: default
136105
kubectl create rolebinding api-explorer:log-reader --clusterrole log-reader --serviceaccount default:api-explorer

src/exploit/cryptography/conversion/convert-binary-to-int-in-python.md

Lines changed: 0 additions & 21 deletions
This file was deleted.

src/exploit/cryptography/conversion/convert-bytes-to-matrix-in-python.md

Lines changed: 0 additions & 21 deletions
This file was deleted.

src/exploit/cryptography/conversion/convert-hex-to-int-in-python.md

Lines changed: 0 additions & 27 deletions
This file was deleted.

src/exploit/cryptography/conversion/convert-int-to-string-in-python.md

Lines changed: 0 additions & 21 deletions
This file was deleted.

src/exploit/cryptography/conversion/convert-matrix-to-bytes-in-python.md

Lines changed: 0 additions & 23 deletions
This file was deleted.

src/exploit/cryptography/conversion/convert-string-to-int-in-python.md

Lines changed: 0 additions & 36 deletions
This file was deleted.

src/exploit/linux/privilege-escalation/chrome-remote-debugger-pentesting.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ tags:
55
- Linux
66
- Privilege Escalation
77
refs:
8-
date: 2023-03-11
8+
date: 2024-12-24
99
draft: false
1010
---
1111

@@ -42,3 +42,7 @@ Then click **“Configure…”** at the right of **“Discover network targets
4242
In the modal window, enter **“localhost:12345”** then click **“Done”**.
4343
Now we should see the remote host appears at the bottom of the **“Remote Target”**.
4444
Click **“inspect”** then new browser open. We can browse the website.
45+
46+
### (Option) Find Credentials
47+
48+
If the login page found when inspecting, we may see a credential in the developer tool at the right pane. Go to `Network` and click the target page such as `login.php` then go to the `Payload` tab. We can find credentials.

src/exploit/linux/privilege-escalation/index.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ tags:
66
- Remote Code Execution
77
refs:
88
- https://book.hacktricks.xyz/linux-hardening/privilege-escalation
9-
date: 2024-11-08
9+
date: 2024-12-24
1010
draft: false
1111
---
1212

@@ -59,13 +59,19 @@ For example above, we can search **`ubuntu 4.4.0-31-generic`** in search engines
5959
## Interesting Information
6060

6161
```sh
62-
# Current user
62+
# Current user information
6363
whoami
6464
id
6565
id <username>
6666
groups
6767
groups <username>
6868

69+
# Users and passwords
70+
cat /etc/passwd
71+
cat /etc/shadow
72+
# for NSS (Name Service Switch)
73+
getent passwd
74+
6975
# Bash files
7076
# If we have the write permission for .bashrc or .profile,
7177
# we can write arbitrary command to any line in that files.
@@ -201,19 +207,21 @@ cat /etc/mysql/mysql.conf.d/mysql.cnf
201207

202208
# Nameserver
203209
cat /etc/resolv.conf
210+
204211
# NFS settings
205212
cat /etc/exports
213+
206214
# PAM
207215
cat /etc/pam.d/passwd
216+
208217
# Sudo config
209218
cat /etc/sudoers
210219
cat /etc/sudoers.d/usersgroup
220+
211221
# SSH config
212222
cat /etc/ssh/ssh_config
213223
cat /etc/ssh/sshd_config
214-
# Users and passwords
215-
cat /etc/passwd
216-
cat /etc/shadow
224+
217225
# List of all groups on the system
218226
cat /etc/group
219227

0 commit comments

Comments
 (0)