攻防世界--dmd-50
测试文件:https://adworld.xctf.org.cn/media/task/attachments/7ef7678559ea46cbb535c0b6835f2f4d
1.准备

获取信息
- 64位文件
2.IDA打开
int __cdecl main(int argc, const char **argv, const char **envp)
{
__int64 v3; // rax
__int64 v4; // rax
__int64 v5; // rax
__int64 v6; // rax
__int64 v7; // rax
__int64 v8; // rax
__int64 v9; // rax
__int64 v10; // rax
__int64 v11; // rax
__int64 v12; // rax
__int64 v13; // rax
__int64 v14; // rax
__int64 v15; // rax
__int64 v16; // rax
__int64 v17; // rax
__int64 v18; // rax
__int64 v19; // rax
__int64 v20; // rax
__int64 v21; // rax
int result; // eax
__int64 v23; // rax
__int64 v24; // rax
__int64 v25; // rax
__int64 v26; // rax
__int64 v27; // rax
__int64 v28; // rax
__int64 v29; // rax
__int64 v30; // rax
__int64 v31; // rax
__int64 v32; // rax
__int64 v33; // rax
__int64 v34; // rax
__int64 v35; // rax
__int64 v36; // rax
__int64 v37; // rax
char v38; // [rsp+Fh] [rbp-71h]
char v39; // [rsp+10h] [rbp-70h]
char v40; // [rsp+20h] [rbp-60h]
_BYTE *v41; // [rsp+28h] [rbp-58h]
char v42; // [rsp+30h] [rbp-50h]
unsigned __int64 v43; // [rsp+68h] [rbp-18h] v43 = __readfsqword(0x28u);
std::operator<<<std::char_traits<char>>(&std::cout, "Enter the valid key!\n", envp);
std::operator>><char,std::char_traits<char>>(&edata, &v42);
std::allocator<char>::allocator(&v38);
std::string::string(&v39, &v42, &v38);
md5(&v40, &v39);
v41 = (_BYTE *)std::string::c_str((std::string *)&v40);
std::string::~string((std::string *)&v40);
std::string::~string((std::string *)&v39);
std::allocator<char>::~allocator(&v38);
if ( *v41 != ''
|| v41[] != ''
|| v41[] != ''
|| v41[] != ''
|| v41[] != ''
|| v41[] != ''
|| v41[] != 'd'
|| v41[] != ''
|| v41[] != 'b'
|| v41[] != ''
|| v41[] != 'e'
|| v41[] != ''
|| v41[] != ''
|| v41[] != 'd'
|| v41[] != 'b'
|| v41[] != ''
|| v41[] != ''
|| v41[] != ''
|| v41[] != ''
|| v41[] != 'b'
|| v41[] != 'c'
|| v41[] != ''
|| v41[] != 'f'
|| v41[] != ''
|| v41[] != ''
|| v41[] != ''
|| v41[] != ''
|| v41[] != ''
|| v41[] != ''
|| v41[] != ''
|| v41[] != 'c'
|| v41[] != '' )
{
v23 = std::operator<<<std::char_traits<char>>(&std::cout, 'I');
v24 = std::operator<<<std::char_traits<char>>(v23, 'n');
v25 = std::operator<<<std::char_traits<char>>(v24, 'v');
v26 = std::operator<<<std::char_traits<char>>(v25, 'a');
v27 = std::operator<<<std::char_traits<char>>(v26, 'l');
v28 = std::operator<<<std::char_traits<char>>(v27, 'i');
v29 = std::operator<<<std::char_traits<char>>(v28, 'd');
v30 = std::operator<<<std::char_traits<char>>(v29, ' ');
v31 = std::operator<<<std::char_traits<char>>(v30, 'K');
v32 = std::operator<<<std::char_traits<char>>(v31, 'e');
v33 = std::operator<<<std::char_traits<char>>(v32, 'y');
v34 = std::operator<<<std::char_traits<char>>(v33, '!');
v35 = std::operator<<<std::char_traits<char>>(v34, ' ');
v36 = std::operator<<<std::char_traits<char>>(v35, ':');
v37 = std::operator<<<std::char_traits<char>>(v36, '(');
std::ostream::operator<<(v37, &std::endl<char,std::char_traits<char>>);
result = ;
}
else
{
v3 = std::operator<<<std::char_traits<char>>(&std::cout, 'T');
v4 = std::operator<<<std::char_traits<char>>(v3, 'h');
v5 = std::operator<<<std::char_traits<char>>(v4, 'e');
v6 = std::operator<<<std::char_traits<char>>(v5, ' ');
v7 = std::operator<<<std::char_traits<char>>(v6, 'k');
v8 = std::operator<<<std::char_traits<char>>(v7, 'e');
v9 = std::operator<<<std::char_traits<char>>(v8, 'y');
v10 = std::operator<<<std::char_traits<char>>(v9, ' ');
v11 = std::operator<<<std::char_traits<char>>(v10, 'i');
v12 = std::operator<<<std::char_traits<char>>(v11, 's');
v13 = std::operator<<<std::char_traits<char>>(v12, ' ');
v14 = std::operator<<<std::char_traits<char>>(v13, 'v');
v15 = std::operator<<<std::char_traits<char>>(v14, 'a');
v16 = std::operator<<<std::char_traits<char>>(v15, 'l');
v17 = std::operator<<<std::char_traits<char>>(v16, 'i');
v18 = std::operator<<<std::char_traits<char>>(v17, 'd');
v19 = std::operator<<<std::char_traits<char>>(v18, ' ');
v20 = std::operator<<<std::char_traits<char>>(v19, ':');
v21 = std::operator<<<std::char_traits<char>>(v20, ')');
std::ostream::operator<<(v21, &std::endl<char,std::char_traits<char>>);
result = ;
}
return result;
}
3.代码分析
查看第50行代码,这是一个md5加密
在看第55~86行代码的字符,猜测应该也是md5加密
780438d5b6e29db0898bc4f0225935c0
将这串字符串解密,得到

主要可以看到字符串经过2次md5解密,因此我们可以猜测,我们输入的flag是grape的1次md5加密,经过第50行代码的md5再次加密,再与780438d5b6e29db0898bc4f0225935c0比较
将grape经过1次md5加密得到
b781cbb29054db12f88f08c6e161c199
4.get flag!
b781cbb29054db12f88f08c6e161c199
攻防世界--dmd-50的更多相关文章
- 攻防世界web新手区
攻防世界web新手区 第一题view_source 第二题get_post 第三题robots 第四题Backup 第五题cookie 第六题disabled_button 第七题simple_js ...
- 攻防世界Web新手解析
攻防世界入门的题目 view source 禁用右键,F12审查元素 get post hackbar进行post robots 直接访问robots.txt,发现f1ag_1s_h3re.ph文件, ...
- 记录下做攻防世界的misc题
0x00 记录一下,代表自己做过 0x01 flag_universe 看简介是来自2018年的百越杯. 将文件下载下来后,就一个flag_universe.pcapng文件,wireshark打开. ...
- 攻防世界 reverse 进阶 APK-逆向2
APK-逆向2 Hack-you-2014 (看名以为是安卓逆向呢0.0,搞错了吧) 程序是.net写的,直接祭出神器dnSpy 1 using System; 2 using System.Diag ...
- 攻防世界 reverse 进阶 10 Reverse Box
攻防世界中此题信息未给全,题目来源为[TWCTF-2016:Reverse] Reverse Box 网上有很多wp是使用gdb脚本,这里找到一个本地还原关键算法,然后再爆破的 https://www ...
- 攻防世界 WriteUp
附:|>>>攻防世界-WEB-新手练习区<<<| WriteUp目录 01.|>>>baby_web<<<| 02.|>& ...
- 【WP】攻防世界-杂项-Misc
长期更新一波 攻防世界 的杂项题解 这东西主要靠积累吧 攻防世界:https://adworld.xctf.org.cn 因为攻防世界的题目顺序经常变化,我也不改序号了,顺着之前写的位置往下写,推荐使 ...
- 攻防世界-MISC:base64stego
这是攻防世界新手练习区的第十一题,题目如下: 点击下载附件一,发现是一个压缩包,点击解压,发现是需要密码才能解密 先用010editor打开这个压缩包,这里需要知道zip压缩包的组成部分,包括压缩源文 ...
- CTF--web 攻防世界web题 robots backup
攻防世界web题 robots https://adworld.xctf.org.cn/task/answer?type=web&number=3&grade=0&id=506 ...
- CTF--web 攻防世界web题 get_post
攻防世界web题 get_post https://adworld.xctf.org.cn/task/answer?type=web&number=3&grade=0&id=5 ...
随机推荐
- debian系列systemd 配置nodejs服务
1 新建service配置文件 vi /etc/systemd/system/node.service [Unit] Description=My super nodejs app [Service ...
- SQL 1 数据库 表的操作
数据库:是按照数据结构来组织.存储和管理数据的建立在计算机存储设备上的仓库.一句话就是存储数据的仓库 数据库的分类:网络数据库.层级数据库.关系结构数据库. 倘若按照数据库的存储介质来分:关系型数据库 ...
- 设置div 居中 和得到dom元素高度
javascript中获取dom元素高度和宽度的方法如下: 网页可见区域宽: document.body.clientWidth网页可见区域高: document.body.clientHeight网 ...
- mysql错误: waiting for table metadata lock
今天突然发现truncate一个表都慢到不行,于是 SHOW PROCESSLIST 发现错误:waiting for table metadata lock解决方法:查看information_sc ...
- LeetCode--040--组合总和 II(java)
给定一个数组 candidates 和一个目标数 target ,找出 candidates 中所有可以使数字和为 target 的组合. candidates 中的每个数字在每个组合中只能使用一次. ...
- Ubuntu 14.04 虚拟机配置固定ip地址
Ubuntu 14.04 虚拟机配置固定ip地址: 虚拟机用的NAT方式配置: 1.虚拟机: 虚拟机→设置→网络适配器→NAT模式: 2.虚拟机:编辑→虚拟网络编辑器→更改设置→选择NAT→填入子网I ...
- springboot2整合logback.xml动态修改日志打印级别
今天找bug烦到了,生产上的日志级别不能修改,非常不利于排查问题,于是想到了动态修改日志打印级别, 因为上一周把项目升级成springboot2,并且使用logback.xml管理日志打印,所以修改也 ...
- java 构造方法中super()的作用?
手贱百度了一下 :java里面自定义类的有参构造方法为什么不用super() 举个例子: class Father { Father(){print ('father');}; } class Son ...
- php array_intersect()函数 语法
php array_intersect()函数 语法 作用:用于比较两个(或更多个)数组的键值,并返回交集.直线电机生产厂家 语法:array_intersect(array1,array2,arra ...
- 【CF1244D】Paint the Tree(树形DP,树)
题意: n<=1e5,1<=a[i][j]<=1e9 思路: 不是很懂INF为什么要开到1e15,我觉得只要1e14就好 #include<bits/stdc++.h> ...