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
+54-5Lines changed: 54 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -115,8 +115,9 @@ Mitigations:
115
115
-**Possible Information disclosure**:
116
116
1. Upload **several times** (and at the **same time**) the **same file** with the **same name**
117
117
2. Upload a file with the **name** of a **file** or **folder** that **already exists**
118
-
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.
119
-
4. Upload a file that may not be deleted easily such as **"…:.jpg”** in **NTFS**. (Windows)
118
+
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
119
+
uploads” in the "/www/" directory.
120
+
4. Upload a file that may not be deleted easily such as **"…:.jpg"** in **NTFS**. (Windows)
120
121
5. Upload a file in **Windows** with **invalid characters** such as `|<>*?”` in its name. (Windows)
121
122
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.
122
123
- Try also to **upload an executable** (.exe) or an **.html** (less suspicious) that **will execute code** when accidentally opened by victim.
@@ -132,7 +133,7 @@ The `.inc` extension is sometimes used for php files that are only used to **imp
132
133
133
134
## **Jetty RCE**
134
135
135
-
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!
136
+
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!
@@ -166,10 +167,54 @@ The execution of the payload occurs during the parsing of the configuration file
166
167
167
168
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.
168
169
170
+
### Gibbon LMS arbitrary file write to pre-auth RCE (CVE-2023-45878)
171
+
172
+
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.
210
+
- Resulting code runs as the web service user (e.g., XAMPP Apache on Windows).
211
+
212
+
References for this bug include the usd HeroLab advisory and the NVD entry. See the References section below.
213
+
169
214
## **wget File Upload/SSRF Trick**
170
215
171
216
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.**\
172
-
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"**.
217
+
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"**.
173
218
174
219
```bash
175
220
#Create file and HTTP server
@@ -285,6 +330,7 @@ Below is an example of Python code used to create a malicious zip file:
285
330
import zipfile
286
331
from io import BytesIO
287
332
333
+
288
334
defcreate_zip():
289
335
f = BytesIO()
290
336
z = zipfile.ZipFile(f, 'w', zipfile.ZIP_DEFLATED)
@@ -323,7 +369,7 @@ For further details **check the original post in**: [https://blog.silentsignal.e
323
369
324
370
```bash
325
371
:set modifiable
326
-
:%s/xxA/..\//g
372
+
:%s/xxA/../g
327
373
:x!
328
374
```
329
375
@@ -373,6 +419,9 @@ How to avoid file type detections by uploading a valid JSON file even if not all
0 commit comments