Skip to content

Buffer overflow is a critical security vulnerability that occurs when a program writes more data into a buffer than it can handle, leading to memory corruption. Attackers can exploit this flaw to execute arbitrary code, modify program behavior, or escalate privileges, making it a severe risk in server

Notifications You must be signed in to change notification settings

Priyabug/Server-Side-Buffer-Overflow-Exploitation

Repository files navigation

🛡️ Server-side Buffer Overflow Exploitation

📄 Description

Buffer overflow is a condition where a program attempts to write data beyond the allocated boundary of a buffer. This vulnerability can be exploited by an attacker to alter the program’s flow, potentially leading to arbitrary code execution.

The goal of this lab is to:

  • Understand how buffer overflow vulnerabilities work.
  • Gain practical experience in exploiting them.
  • Analyze the effectiveness of various security countermeasures.

🧰 Languages and Utilities Used

  • Python
  • Ubuntu 20.04 VM

💻 Environments Used

  • Windows 10 (21H2)

📚 Lab Topics Covered

  • Getting familiar with the Shellcode
  • Attack Implementation:
    • Creating a malicious bad file
    • Using revised shellcode that defeats countermeasures in bash and dash
  • Experimenting with:
    • Address Randomization
    • Other Countermeasures
  • Guidelines on creating a Reverse Shell

🛠️ Shell Script Commands

Script Description
./dc-build.sh Builds the Docker images. Accepts one optional parameter (e.g., --no-cache).
./dc-up.sh Starts the Docker containers in the foreground.
./dc-up-d.sh Starts the Docker containers in the background.
./dc-stop.sh Stops the Docker containers. Accepts one optional parameter.
./dc-down.sh Stops and removes the Docker containers. Accepts one optional parameter.
./dc-unittest.sh A utility script for running a specific unit test class.

🧪 Program Walkthrough

In this lab, we are introduced to four servers, each running a program with a buffer-overflow vulnerability. The task involves:

  • Exploiting the vulnerability to gain root access.
  • Using a variety of techniques to craft and inject shellcode.
  • Evaluating the effectiveness of security countermeasures.

🔍 Objectives

  • Develop exploitation schemes.
  • Perform root-privilege escalations on vulnerable servers.
  • Analyze and report on the effectiveness of:
    • Address randomization
    • Stack canaries
    • No-eXecute (NX) bit
    • Other OS-level defenses

💡 Note: This lab provides hands-on exposure to both offensive and defensive security practices. Ethical application and responsible usage of the knowledge gained are highly encouraged.

About

Buffer overflow is a critical security vulnerability that occurs when a program writes more data into a buffer than it can handle, leading to memory corruption. Attackers can exploit this flaw to execute arbitrary code, modify program behavior, or escalate privileges, making it a severe risk in server

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published