<>Solution for CTF similar challenge TOPIC : easyBOF category: ROP, string format Flag format : ADL{printable} S

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

<>Solution for CTF similar challenge TOPIC : easyBOF category: ROP, string format Flag format : ADL{printable} S

Post by answerhappygod »

<<URGENT>>Solution for CTF similar challenge
TOPIC : easyBOF
category: ROP, string format
Flag format : ADL{printable}
Source code:
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
void init()
{
setvbuf(stdin, NULL, _IONBF, 0);
setvbuf(stdout, NULL, _IONBF, 0);
setvbuf(stderr, NULL, _IONBF, 0);
}
void echo(char* buf)
{
printf(buf);
puts("");
}
void saySomething(char* buf)
{
read(0, buf, 0x10);
}
void bof(char* buf)
{
puts("Show your BOF");
read(0, buf, 0x100);
}
int main()
{
init();
char buf[0x10] = {0};
write(1 , "> ", 2);
saySomething(buf) ;
echo(buf);
bof(buf);
return 0;
}
LINKS for download file :
http://ctf.adl.tw/files/140da9235e75b0a ... Gi-R4i9lF0
## Please provide detailed explanation of solving idea and
solving codes FOR THE PROVIDED CODES.
## DO NOT COPY AND PASTE SIMILAR SUBJECT SOLUTION
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply