Address Space Layout Randomization
ASLR is a technique that makes memory attacks difficult by placing the addresses of stacks, heaps, libraries, etc. randomly in the process address space, so that the address of the data changes every time it is executed.
Probabilistic defense against code reuse attacks which make base address of each segment randomized. As a results, Attackers cannot statically find code addresses. The executable must be PIE (PositionIndependent Executable)
Relative differences remain the same between addresses since ASLR is large-scale global randomizing. Every function address is randomized, and it is required to find the function address at runtime, which is implemented cursorily. There are several implementations, and there is always a tradeoff balance between security and performance for the compiler.
Linux ASLR level
randomize_va_space=0: Disable ASLR
randomize_va_space=1: Random stack & Random library
randomize_va_space=2: Random stack & Random library & Random heap
/etc/sysctl.confBypassing ASLR via Position-Independent ROP
Partial pointer overwrite
GOT Section 과 일정한 offset으로 우회가능

Address space layout randomization
Address space layout randomization (ASLR) is a computer security technique involved in preventing exploitation of memory corruption vulnerabilities.[1] In order to prevent an attacker from reliably redirecting code execution to, for example, a particular exploited function in memory, ASLR randomly arranges the address space positions of key data areas of a process, including the base of the executable and the positions of the stack, heap and libraries.
https://en.wikipedia.org/wiki/Address_space_layout_randomization
linux 환경에서의 메모리 보호기법을 알아보자(1)
지금부터 Linux 환경에서의 메모리 보호 기법에 대해 알아봅시다! 이번 편에서는 ASLR, NX, ASCII-Armor, Stack canary에 대해 알아보겠습니다. 위키를 통해 "메모리 보호"라는 말의 정의를 알아보고 넘어갑시다. 실습 환경: CentOS 6.7 (32bit) ASLR : Address Space Layout Randomization 먼저 ASLR에 대해 알아보겠습니다. ASLR이란, 메모리상의 공격을 어렵게 하기 위해 스택이나 힙, 라이브러리 등의 주소를 랜덤으로 프로세스 주소 공간에...
https://bpsecblog.wordpress.com/2016/05/16/memory_protect_linux_1/

ROP(Return Oriented Programming)
/* written by kaspy (kaspyx@gmail.com)*/ 1. 시작하며 ROP(Return Oriented Programming) 이란 버퍼 오버플로우 취약점이 발생하는 바이너리를 exploit 할때 가장 많이 사용되는 기법으로 바이너리 내부에 존재하는 gadget을 사용하여 호출 함수 및 인자를 조작하는 방법이다. 솔직히 관련 자료도 굉장히 많은데.. 나도 복습 할겸 정리해보았다. 일반적으로 ASLR이 걸려있는 바이너리는 Memory leak 또는 got, plt 등에 함수가 존재해야하는 특수한 전제가 붙어야 exploit 가능하지만, ROP 기법을 사용하면 (PIE가 걸려있지않아야함) 바이너리의 고정주소의 gadget을 활용하여 exploit 할수있다. 여기서 gadget이란 바이너리..
https://kaspyx.tistory.com/100

Seonglae Cho
