Lucene search
K

BoF-Challenge1

🗓️ 02 May 2019 00:00:00Reported by Juan SaccoType 
exploitpack
 exploitpack
👁 21 Views

Buffer overflow challenge to exploit vulnerable functio

Code
#include <stdio.h>
#include <unistd.h>

// Uncalled secret function
// 00000000004005b6
void secretFunction()
{
    printf("Congratulations!\n");
    printf("You have entered in the secret function!\n");

    return;
}

// Vulnerable function
int vuln() {
    // Define variables
    char array[400];

    // Grab user input
    printf("Enter some text:\n");
    // fgets(array, 400, stdin);
    gets(array);

    // Print user input
    printf("You entered: %s\n", array);

    // Return success
    return 0;
}

int main(int argc, char *argv[]) {
    // Call vulnerable function
    vuln();

    // Return success
    return 0;
}

// cat /proc/sys/kernel/randomize_va_space 
// echo 0 > /proc/sys/kernel/randomize_va_space
// gcc -fno-stack-protector -z execstack -mpreferred-stack-boundary=4 -o example -ggdb example.c

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation

02 May 2019 00:00Current
0.8Low risk
Vulners AI Score0.8
21