Module 12 (Linux Buffer OverFlows)

Steps

  1. Control EIP

  2. Locating Space For our shellcode

  3. checking for bad chars

  4. FInding a Return Address

  5. Getting Shell

disable aslr dep

sudo sed -i 's/GRUB_CMDLINE_LINUX_DEFAULT="/GRUB_CMDLINE_LINUX_DEFAULT="noexec=off /' /etc/default/grub && echo 0 | sudo tee /proc/sys/kernel/randomize_va_space && sudo update-grub

compile C

gcc -m32 -fno-stack-protector -g -z execstack -no-pie -o exploit exploit.c

1. Install Dependencies

#!/bin/bash
sudo apt-get update -y
sudo apt-get install -y edb-debugger
sudo dpkg --add-architecture i386
echo "foreign-architecture i386" | sudo tee /etc/dpkg/dpkg.cfg.d/multiarch
sudo apt-get update
sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386
sudo apt-get install multiarch-support
sudo apt-get install libxaw7 libxaw7-dev -y
sudo apt install checksec
wget www.offensive-security.com/crossfire.tar.gz
tar -zxf crossfire.tar.gz
sudo cp -r crossfire /usr/games/
checksec --file=/usr/games/crossfire/bin/crossfire

Control EIP

Overflow = 4379

Get offset

Locating Space For our shellcode

Jmp eax

Plugins > Opcode Search > EAX -> EIP

Plugins > Breakpoint Manger > add address

step into

Plugins > Opcode Search > ESP -> EIP

jmp

Getting a Shell

GDB exploittion

Last updated