Commit da0f4b47 authored by Ines Kramer's avatar Ines Kramer

added different vuln files

parent a3faf1b2
# include <stdio.h>
# include <stdlib.h>
# include <string.h>
int main (int argc, char *argv[])
{
char buffer[248];
if (argc == 2) {
strcpy(buffer,argv[1]);
printf("%s",buffer);
printf("\n");
}
else{
printf("Enter one command line argument");
}
return 0;
}
#!/usr/bin/env python
from pwn import *
buf = ""
# last version: buf += "A"*400
buf+= cyclic(200)
f = open("in.txt", "w")
f.write(buf)
/* Source: https://movaxbx.ru/2018/02/16/64-bit-linux-stack-smashing-tutorial-part-1/
/* Compile: gcc -fno-stack-protector -z execstack vuln.c -o vuln*/
/* Disable ASLR: echo 0 > /proc/sys/kernel/randomize_va_space */
#include <stdio.h>
#include <unistd.h>
int vuln() {
char buf[80];
int r;
r = read(0, buf, 400);
printf("\nRead %d bytes. buf is %s\n", r, buf);
puts("No shell for you :(");
return 0;
}
int main(int argc, char *argv[]) {
printf("Try to exec /bin/sh");
vuln();
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment