Added a simple rop problem
Needs to be built on a linux machine and the binary put in the files/description so that its easier to solve. Also needs to be put on the shell.
This commit is contained in:
parent
b755f8e6f7
commit
7c970f316f
6 changed files with 42 additions and 0 deletions
2
simple-rop/Makefile
Normal file
2
simple-rop/Makefile
Normal file
|
@ -0,0 +1,2 @@
|
|||
(all):
|
||||
gcc -m32 -o simple-rop -fno-stack-protector -O0 simple-rop.c
|
3
simple-rop/description.md
Normal file
3
simple-rop/description.md
Normal file
|
@ -0,0 +1,3 @@
|
|||
On the shell there is a folder `<insert location>`.
|
||||
Read flag.txt
|
||||
[Source](${simple-rop.c})
|
1
simple-rop/flag.txt
Normal file
1
simple-rop/flag.txt
Normal file
|
@ -0,0 +1 @@
|
|||
easyctf{r0p_7o_v1ct0ry}
|
4
simple-rop/grader.py
Normal file
4
simple-rop/grader.py
Normal file
|
@ -0,0 +1,4 @@
|
|||
def grade(random, key):
|
||||
if key.find("r0p_7o_v1ct0ry") != -1:
|
||||
return True, "Correct!"
|
||||
return False, "Nope."
|
7
simple-rop/problem.yml
Normal file
7
simple-rop/problem.yml
Normal file
|
@ -0,0 +1,7 @@
|
|||
title: Simple Rop
|
||||
category: Binary Exploitation
|
||||
value: 75
|
||||
author: r3ndom
|
||||
autogen: false
|
||||
files:
|
||||
- simple-rop.c
|
25
simple-rop/simple-rop.c
Normal file
25
simple-rop/simple-rop.c
Normal file
|
@ -0,0 +1,25 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
void print_flag();
|
||||
void what_did_you_say();
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
gid_t gid = getegid();
|
||||
setresgid(gid, gid, gid);
|
||||
what_did_you_say();
|
||||
return 0;
|
||||
}
|
||||
|
||||
void print_flag()
|
||||
{
|
||||
system("cat flag.txt");
|
||||
}
|
||||
|
||||
void what_did_you_say()
|
||||
{
|
||||
char buff[64];
|
||||
gets(buff);
|
||||
printf("You said: %s\n", buff);
|
||||
}
|
Loading…
Reference in a new issue