Mad Max
Spraying the kernel heap for fun, profit and filling up holes.
Problem Statement
Create a poc that exploits the kernel driver to gain root access and write a file to root directory. The poc should include some explanation of the exploit, your source code and a binary that exploits the vulnerability.
credentials: two users madmax and root
TEXT
madmax: madmax
root:ImmortanSend the poc to : xxxxxx[REDACTED]xxxxxxxx@gmail.com together with your ctfd username and email.
TEXT
Files https://drive.google.com/file/d/1X6bSq0f0SlD2OKDTG5Dqw0utxlRqgyBn/view?usp=sharingBugs
- UAF in
tanker- The free’d tanker struct is not set to NULL.

- The free’d tanker struct is not set to NULL.
Exploit
- Spray
cred_jarby creating lots of processes. - Spray
kmalloc-128by opening lots offdsto/proc/self/stat - Allocate 2x tanker
- Free 2x tanker
- Now allocation requests to
kmalloc-128have chance of being served the just free’d pointers - Spray
msg_msgandseq_operationsone after another, to make sure the UAF slots get pointers tomsg_msg(which contains heap ptr) andseq_operations(which contains kernel text) read_fuel_lineontankers[1]to leak kernel heap address. Nowleaked_addr- 0x80 =*tankers[0]- Craft arb read and arb write primitives with read_fuel_line and write_fuel_line.
- arb_red to leak kernel text, find kernel base, then find modprobe_path
- Overwrite modprobe_path with
/tmp/a - Create
/tmp/ashellscript which creates file/root/i_finally_won_kpwn_hard - Win!
Exploit Code
Main exploit
C — EXPLOIT.C
|
|
IOCTL Interface code
C — LIB.C
|
|
Makefile to compile exploit
MAKE
|
|
Flag

