suryamp97 / Return-to-libc-buffer-overflow-attack-Computer-Security

A short C program that illustrates a return-to-lib buffer overflow attack

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Execute the commands in order to reproduce the Return-to-libc buffer overflow attack (Linux terminal): (The video illustrates step-by-step parts of the attack)

sudo sysctl -w kernel.randomize_va_space=0

cat vulnerable.c

sudo gcc -m32 -fno-stack-protector -z noexecstack -o vulnerable vulnerable.c

export MYSHELL=/bin/sh

env | grep MYSHELL

cat shelladdr.c

sudo gcc -m32 -fno-stack-protector -z noexecstack -o shelladdr shelladdr.c

./shelladdr

gdb vulnerable

sudo gcc -m32 -fno-stack-protector -z noexecstack -o exploit exploit.c

./exploit

./vulnerable

About

A short C program that illustrates a return-to-lib buffer overflow attack


Languages

Language:C 100.0%