Linux Hijacking (Hooking)
Methods and ways to change execution to yuor code instead of existing code
Remember the GOT and PLT?
What are some ideas that we might get the code to the other side?
#include <elf.h>
Sort of.... yes
mov rax, 0x7ffffffff
jmp rax
push rbp
mov rbp, rsp
sub rsp, 0x10
mov rdi, -0x8[rbp]
mov -0x4[rbp], 0
etc.....
0x401234
push rbp
mov rbp, rsp
sub rsp, 0x10
mov rdi, -0x8[rbp]
mov -0x4[rbp], 0
etc.....
push rbp
mov rbp, rsp
sub rsp, 0x10
mov rdi, -0x8[rbp]
mov rax, 0x401234
jmp rax
Trampoline
Original
0x401234
mov rax, 0x7ffff7ff1234
jmp rax
mov -0x4[rbp], 0
etc.....
push rbp
mov rbp, rsp
sub rsp, 0x10
mov rdi, -0x8[rbp]
mov rax, 0x401234
jmp rax
Trampoline
Original Entry/In
0x401234
0x7ffff7ff1234
filter input
Filter Output
Call Trampoline
You are going to write your own entry stub trampoline! You need to redirect input on a server to the function that you want to inject. You are given a template but need to fill out the remaining parts. How would you do this?
Grading Criteria: