这里主要是记录,台湾大佬Angelboy的pwn的练习题,链接https://github.com/scwuaptx/HITCON-Training
lab1
题目代码
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
void get_flag(){
int fd ;
int password;
int magic ;
char key[] = "Do_you_know_why_my_teammate_Orange_is_so_angry???";
char cipher[] = {
7, 59, 25, 2, 11, 16, 61, 30, 9, 8, 18, 45, 40, 89, 10, 0, 30, 22, 0, 4, 85, 22, 8, 31, 7, 1, 9, 0, 126, 28, 62, 10, 30, 11, 107, 4, 66, 60, 44, 91, 49, 85, 2, 30, 33, 16, 76, 30, 66};
fd = open("/dev/urandom",0);
read(fd,&password,4);
printf("Give me maigc :");
scanf("%d",&magic);
if(password

该博客介绍了如何通过两种方法解决一个CTF挑战。第一种方法是使用Python解析加密字符串并手动解密。第二种方法是利用GDB调试器,在程序运行时修改内存中的密码值,跳过if判断,直接显示旗标。博客详细展示了代码分析、断点设置和寄存器操作的过程,强调了调试器在动态分析中的强大作用。
最低0.47元/天 解锁文章
2267

被折叠的 条评论
为什么被折叠?



