You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/network-services-pentesting/pentesting-kerberos-88/README.md
+54Lines changed: 54 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,6 +19,53 @@ PORT STATE SERVICE
19
19
20
20
### **To learn how to abuse Kerberos you should read the post about**[**Active Directory**](../../windows-hardening/active-directory-methodology/index.html)**.**
21
21
22
+
## Kerberos-only environments: client prep and troubleshooting
23
+
24
+
When NTLM is disabled on domain services (SMB/WinRM/etc.), you must authenticate with Kerberos. Common pitfalls and a working workflow:
25
+
26
+
- Time synchronization is mandatory. If your host clock is skewed by more than a few minutes you will see `KRB_AP_ERR_SKEW` and all Kerberos auth will fail. Sync against the DC:
- Ensure your `/etc/hosts` resolves the exact FQDN you will SSH/SMB to, and that it comes before any bare domain entries if you are overriding DNS. SPN mismatches break GSSAPI.
67
+
- If NTLM is disabled on SMB you may see `STATUS_NOT_SUPPORTED` with NTLM attempts; add `-k` to force Kerberos.
68
+
22
69
## More
23
70
24
71
### Shodan
@@ -36,6 +83,13 @@ https://adsecurity.org/?p=541
36
83
37
84
Other exploits: [https://github.com/SecWiki/windows-kernel-exploits/tree/master/MS14-068/pykek](https://github.com/SecWiki/windows-kernel-exploits/tree/master/MS14-068/pykek)
38
85
86
+
## References
87
+
88
+
-[NetExec (CME) wiki – Kerberos and krb5.conf generation](https://www.netexec.wiki/)
In Kerberos-only environments (NTLM disabled), NTLM attempts against SMB may return `STATUS_NOT_SUPPORTED`. Fix common Kerberos issues and force Kerberos auth:
406
+
407
+
```bash
408
+
# sync clock to avoid KRB_AP_ERR_SKEW
409
+
sudo ntpdate <dc.fqdn>
410
+
411
+
# use Kerberos with tooling (reads your TGT from ccache)
412
+
netexec smb <dc.fqdn> -k
413
+
```
414
+
415
+
For a complete client setup (krb5.conf generation, kinit, SSH GSSAPI/SPN caveats) see:
Copy file name to clipboardExpand all lines: src/network-services-pentesting/pentesting-ssh.md
+28-5Lines changed: 28 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -144,18 +144,39 @@ Some systems have known flaws in the random seed used to generate cryptographic
144
144
145
145
You should look here in order to search for valid keys for the victim machine.
146
146
147
-
### Kerberos
147
+
### Kerberos / GSSAPI SSO
148
148
149
-
**crackmapexec** using the `ssh` protocol can use the option `--kerberos` to **authenticate via kerberos**.\
150
-
For more info run `crackmapexec ssh --help`.
149
+
If the target SSH server supports GSSAPI (for example Windows OpenSSH on a domain controller), you can authenticate using your Kerberos TGT instead of a password.
150
+
151
+
Workflow from a Linux attacker host:
152
+
153
+
```bash
154
+
# 1) Ensure time is in sync with the KDC to avoid KRB_AP_ERR_SKEW
155
+
sudo ntpdate <dc.fqdn>
156
+
157
+
# 2) Generate a krb5.conf for the target realm (optional, but handy)
- If you connect to the wrong name (e.g., short host, alias, or wrong order in `/etc/hosts`), you may get: "Server not found in Kerberos database" because the SPN does not match.
171
+
-`crackmapexec ssh --kerberos` can also use your ccache for Kerberos auth.
Copy file name to clipboardExpand all lines: src/pentesting-web/file-upload/README.md
+53-5Lines changed: 53 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -81,7 +81,7 @@ Other useful extensions:
81
81
-**Possible Information disclosure**:
82
82
1. Upload **several times** (and at the **same time**) the **same file** with the **same name**
83
83
2. Upload a file with the **name** of a **file** or **folder** that **already exists**
84
-
3. Uploading a file with **“.”, “..”, or “…” as its name**. For instance, in Apache in **Windows**, if the application saves the uploaded files in “/www/uploads/” directory, the “.” filename will create a file called “uploads” in the “/www/” directory.
84
+
3. Uploading a file with **“." , “..", or “…” as its name**. For instance, in Apache in **Windows**, if the application saves the uploaded files in “/www/uploads/” directory, the “.” filename will create a file called “uploads” in the “/www/” directory.
85
85
4. Upload a file that may not be deleted easily such as **“…:.jpg”** in **NTFS**. (Windows)
86
86
5. Upload a file in **Windows** with **invalid characters** such as `|<>*?”` in its name. (Windows)
87
87
6. Upload a file in **Windows** using **reserved** (**forbidden**) **names** such as CON, PRN, AUX, NUL, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9, LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, and LPT9.
@@ -98,7 +98,7 @@ The `.inc` extension is sometimes used for php files that are only used to **imp
98
98
99
99
## **Jetty RCE**
100
100
101
-
If you can upload a XML file into a Jetty server you can obtain [RCE because **new \*.xml and \*.war are automatically processed**](https://twitter.com/ptswarm/status/1555184661751648256/photo/1)**.** So, as mentioned in the following image, upload the XML file to `$JETTY_BASE/webapps/` and expect the shell!
101
+
If you can upload a XML file into a Jetty server you can obtain [RCE because **new *.xml and *.war are automatically processed**](https://twitter.com/ptswarm/status/1555184661751648256/photo/1)**.** So, as mentioned in the following image, upload the XML file to `$JETTY_BASE/webapps/` and expect the shell!
@@ -132,10 +132,54 @@ The execution of the payload occurs during the parsing of the configuration file
132
132
133
133
It's crucial to understand the lax nature of uWSGI's configuration file parsing. Specifically, the discussed payload can be inserted into a binary file (such as an image or PDF), further broadening the scope of potential exploitation.
134
134
135
+
### Gibbon LMS arbitrary file write to pre-auth RCE (CVE-2023-45878)
136
+
137
+
Unauthenticated endpoint in Gibbon LMS allows arbitrary file write inside the web root, leading to pre-auth RCE by dropping a PHP file. Vulnerable versions: up to and including 25.0.01.
- The handler performs `base64_decode($_POST["img"])` after splitting by `;` and `,`, then writes bytes to `$absolutePath . '/' . $_POST['path']` without validating extension/type.
175
+
- Resulting code runs as the web service user (e.g., XAMPP Apache on Windows).
176
+
177
+
References for this bug include the usd HeroLab advisory and the NVD entry. See the References section below.
178
+
135
179
## **wget File Upload/SSRF Trick**
136
180
137
181
In some occasions you may find that a server is using **`wget`** to **download files** and you can **indicate** the **URL**. In these cases, the code may be checking that the extension of the downloaded files is inside a whitelist to assure that only allowed files are going to be downloaded. However, **this check can be bypassed.**\
138
-
The **maximum** length of a **filename** in **linux** is **255**, however, **wget** truncate the filenames to **236** characters. You can **download a file called "A"\*232+".php"+".gif"**, this filename will **bypass** the **check** (as in this example **".gif"** is a **valid** extension) but `wget` will **rename** the file to **"A"\*232+".php"**.
182
+
The **maximum** length of a **filename** in **linux** is **255**, however, **wget** truncate the filenames to **236** characters. You can **download a file called "A"*232+".php"+".gif"**, this filename will **bypass** the **check** (as in this example **".gif"** is a **valid** extension) but `wget` will **rename** the file to **"A"*232+".php"**.
139
183
140
184
```bash
141
185
#Create file and HTTP server
@@ -168,7 +212,7 @@ Note that **another option** you may be thinking of to bypass this check is to m
168
212
169
213
## From File upload to other vulnerabilities
170
214
171
-
- Set **filename** to `../../../tmp/lol.png` and try to achieve a **path traversal**
215
+
- Set **filename** to `../../../tmp/lol.png` and try to achieve a **path traversal`
172
216
- Set **filename** to `sleep(10)-- -.jpg` and you may be able to achieve a **SQL injection**
173
217
- Set **filename** to `<svg onload=alert(document.domain)>` to achieve a XSS
174
218
- Set **filename** to `; sleep 10;` to test some command injection (more [command injections tricks here](../command-injection.md))
@@ -247,6 +291,7 @@ Below is an example of Python code used to create a malicious zip file:
247
291
import zipfile
248
292
from io import BytesIO
249
293
294
+
250
295
defcreate_zip():
251
296
f = BytesIO()
252
297
z = zipfile.ZipFile(f, 'w', zipfile.ZIP_DEFLATED)
@@ -285,7 +330,7 @@ For further details **check the original post in**: [https://blog.silentsignal.e
285
330
286
331
```bash
287
332
:set modifiable
288
-
:%s/xxA/..\//g
333
+
:%s/xxA/../g
289
334
:x!
290
335
```
291
336
@@ -335,5 +380,8 @@ How to avoid file type detections by uploading a valid JSON file even if not all
0 commit comments