-
ASLR Address Space Layout Randomization is a technique which randomizes addresses in the stack and heap. If addresses of functions are randomized (e.g. from shared libraries like libc), then an attacker cannot use a predefined exploit with hard-coded addresses. Linux Disable ASLR: echo 0 > /proc/sys/kernel/randomize_va_space Enable ASLR: echo 2 > /proc/sys/kernel/randomize_va_space In GDB, ASLR is…
-
General purpose debugger. Hint: gbd disables ASRL by default. Commands General set disassembly-flavor intel/att Process handling run runs a programm without parameters run `python -c 'print("a")'‘ runs a program with a parameter run < <(python -c 'print("a")') runs a program and enters the given string into STDIN c continue si step one instruction Breakpoints break $f…
-
PE Portable Executung or DLL Dynamic Linking Libraries can be edited to remove or add capabilities or own code. Read and modify a PE file The following Python3 script reads a file, prints out a header, modified it to remove ASLR and write a new file without this flag. f = pefile.PE('filename.exe') print(hex(f.OPTIONAL_HEADER.DllCharacteristics)) // print as hex to…