Advertisement
Guest User

Untitled

a guest
Sep 9th, 2017
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /* Thx to spender, we now have a working grsec bypasser :) look below...and simply modify the code to your liking
  2. xd / haqnet irc #HaqNET !
  3. */
  4. //includes are NOT for public, same as the exploit code main,you have to work that bit out ;) , look for dmesg.
  5.  
  6. #define PAGE_SIZE getpagesize()  // added so it works! (xd)
  7. static void __gr_check_mem(char *msg, char *to, unsigned long n) {
  8. if (object_is_on_stack(to) && !object_is_on_stack(to + n))
  9. //goto exploit;
  10. else {
  11. struct page *page;
  12. page = virt_to_head_page(to);
  13. if (!PageSlab(page)) {
  14. unsigned long max;
  15. char *pagestart = page_address(page);
  16. if ((!PageCompound(page) && ((to + n) > (pagestart + PAGE_SIZE))) || (PageCompound(page) && ((to + n) > (pagestart + (PAGE_SIZE << compound_order(page))))))
  17. goto exploit;
  18. } else if (n > ksize(to))
  19. goto exploit;
  20. }
  21. return;
  22. exploit:
  23. {
  24. if (current->signal->curr_ip)
  25. else
  26. panic(err_msg);
  27. }
  28. }
  29.  
  30. void gr_check_mem_overflow(char *to, unsigned long n) {
  31. __gr_check_mem("[!] overflow", to, n);
  32. }
  33. void gr_check_mem_leak(char *to, unsigned long n) {
  34. __gr_check_mem("[-] info leak", to, n);
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement