SUCTF 2016 : dMd
这个题可以说是比较坑了(还不是我很弱...)
Linux跑一下:
要输密码
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((__int64)&v38);
std::string::string(&v39, &v42, &v38);
md5((MD5 *)&v40, (const std::string *)&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[] !=
|| v41[] !=
|| v41[] !=
|| v41[] !=
|| v41[] !=
|| v41[] !=
|| v41[] !=
|| v41[] !=
|| v41[] !=
|| v41[] !=
|| v41[] !=
|| v41[] !=
|| v41[] !=
|| v41[] !=
|| v41[] !=
|| v41[] !=
|| v41[] !=
|| v41[] !=
|| v41[] !=
|| v41[] !=
|| v41[] !=
|| v41[] !=
|| v41[] !=
|| v41[] !=
|| v41[] !=
|| v41[] != )
{
v23 = std::operator<<<std::char_traits<char>>(&std::cout, 73LL);
v24 = std::operator<<<std::char_traits<char>>(v23, 110LL);
v25 = std::operator<<<std::char_traits<char>>(v24, 118LL);
v26 = std::operator<<<std::char_traits<char>>(v25, 97LL);
v27 = std::operator<<<std::char_traits<char>>(v26, 108LL);
v28 = std::operator<<<std::char_traits<char>>(v27, 105LL);
v29 = std::operator<<<std::char_traits<char>>(v28, 100LL);
v30 = std::operator<<<std::char_traits<char>>(v29, 32LL);
v31 = std::operator<<<std::char_traits<char>>(v30, 75LL);
v32 = std::operator<<<std::char_traits<char>>(v31, 101LL);
v33 = std::operator<<<std::char_traits<char>>(v32, 121LL);
v34 = std::operator<<<std::char_traits<char>>(v33, 33LL);
v35 = std::operator<<<std::char_traits<char>>(v34, 32LL);
v36 = std::operator<<<std::char_traits<char>>(v35, 58LL);
v37 = std::operator<<<std::char_traits<char>>(v36, 40LL);
std::ostream::operator<<(v37, &std::endl<char,std::char_traits<char>>);
result = ;
}
else
{
v3 = std::operator<<<std::char_traits<char>>(&std::cout, 84LL);
v4 = std::operator<<<std::char_traits<char>>(v3, 104LL);
v5 = std::operator<<<std::char_traits<char>>(v4, 101LL);
v6 = std::operator<<<std::char_traits<char>>(v5, 32LL);
v7 = std::operator<<<std::char_traits<char>>(v6, 107LL);
v8 = std::operator<<<std::char_traits<char>>(v7, 101LL);
v9 = std::operator<<<std::char_traits<char>>(v8, 121LL);
v10 = std::operator<<<std::char_traits<char>>(v9, 32LL);
v11 = std::operator<<<std::char_traits<char>>(v10, 105LL);
v12 = std::operator<<<std::char_traits<char>>(v11, 115LL);
v13 = std::operator<<<std::char_traits<char>>(v12, 32LL);
v14 = std::operator<<<std::char_traits<char>>(v13, 118LL);
v15 = std::operator<<<std::char_traits<char>>(v14, 97LL);
v16 = std::operator<<<std::char_traits<char>>(v15, 108LL);
v17 = std::operator<<<std::char_traits<char>>(v16, 105LL);
v18 = std::operator<<<std::char_traits<char>>(v17, 100LL);
v19 = std::operator<<<std::char_traits<char>>(v18, 32LL);
v20 = std::operator<<<std::char_traits<char>>(v19, 58LL);
v21 = std::operator<<<std::char_traits<char>>(v20, 41LL);
std::ostream::operator<<(v21, &std::endl<char,std::char_traits<char>>);
result = ;
}
return result;
}
可以看出来是先将输入的字符串进行md5加密 然后进行比对 正确就会输出一串字符
一开始我以为flag应该是输出的字符 于是:
a=[84,104,101,32,107,101,121,32,105,115,32,118,97,108,105,100,32,58,41] s='' for i in a:
s+=chr(i) print(s)
结果输出是:
The key is valid :)
okey....应该是考虑错了
那么就是md5这里:
b=[55,56,48,52,51,56,100,53,98,54,101,50,57,100,98,48,56,57,56,98,99,52,102,48,50,50,53,57,51,53,99,48] s='' for i in b:
s+=chr(i) print(s)
输出:
780438d5b6e29db0898bc4f0225935c0
这是md5加密后的值,把它解密:

输出是 grape
满心欢喜提交 错误......
仔细看一下这个md5的类型:
md5(md5($pass))
也就是加密了之后又进行了一遍md5加密的 所以grape是最初的字符串 780438d5b6e29db0898bc4f0225935c0是最终的密文
那么我们的key应该就是中间加密一次得到的字符串!
将 grape 加密一遍得到:
b781cbb29054db12f88f08c6e161c199
提交正确!
SUCTF 2016 : dMd的更多相关文章
- suctf逆向部分
自己真的菜,然后在网上找了一篇分析pyc反编译后的文件然后进行手撸opcode,过程真痛苦 http://www.wooy0ung.me/writeup/2017/10/11/0ctf-quals-2 ...
- Be Better:遇见更好的自己-2016年记
其实并不能找到好的词语来形容过去的一年,感觉就如此平淡的过了!没有了毕业的稚气,看事情淡了,少了一丝浮躁,多了一分认真.2016也许就是那句话-多读书,多看报,少吃零食多睡觉,而我更愿意说--Be B ...
- Connect() 2016 大会的主题 ---微软大法好
文章首发于微信公众号"dotnet跨平台",欢迎关注,可以扫页面左面的二维码. 今年 Connect 大会的主题是 Big possibilities. Bold technolo ...
- “.Net 社区虚拟大会”(dotnetConf) 2016 Day 3 Keynote: Scott Hanselman
美国时间 6月7日--9日,为期三天的微软.NET社区虚拟大会正式在 Channel9 上召开,美国时间6.9 是第三天, Scott Hanselman 做Keynote.今天主题围绕的是.NET ...
- “.Net 社区虚拟大会”(dotnetConf) 2016 Day 2 Keynote: Miguel de Icaza
美国时间 6月7日--9日,为期三天的微软.NET社区虚拟大会正式在 Channel9 上召开,美国时间6.8 是第二天, Miguel de Icaza 做Keynote,Miguel 在波士顿Xa ...
- “.Net 社区虚拟大会”(dotnetConf) 2016 Day 1 Keynote: Scott Hunter
“.Net 社区虚拟大会”(dotnetConf) 2016 今天凌晨在Channel9 上召开,在Scott Hunter的30分钟的 Keynote上没有特别的亮点,所讲内容都是 微软“.Net社 ...
- 微软发布正式版SQL Server 2016
微软于今天在SQL 官方博客上宣布 SQL Server 数据库软件的正式发布版本(GA),历时一年多,微软为该软件发布了多个公共预览版和候选版本,而今天最终版本终于上线了.在博客中,微软数据集团的企 ...
- Summary of Critical and Exploitable iOS Vulnerabilities in 2016
Summary of Critical and Exploitable iOS Vulnerabilities in 2016 Author:Min (Spark) Zheng, Cererdlong ...
- 黑云压城城欲摧 - 2016年iOS公开可利用漏洞总结
黑云压城城欲摧 - 2016年iOS公开可利用漏洞总结 作者:蒸米,耀刺,黑雪 @ Team OverSky 0x00 序 iOS的安全性远比大家的想象中脆弱,除了没有公开的漏洞以外,还有很多已经公开 ...
随机推荐
- php将表单中数据传入到数据库
<html> <head> <meta http-equiv="Content-Type" content="text/html; char ...
- java-HashMap默认机制
HashMap:键值对(key-value): 通过对象来对对象进行索引,用来索引的对象叫做key,其对应的对象叫做value. 默认是1:1关系: 存在则覆盖,当key已经存在,则利用新的value ...
- Python全栈学习_作业集锦(持续更新)
python基础 day1 python初识 . 计算机基础(cpu,内存,硬盘,操作系统) . Python出生于应用 . python发展史 . 编程语言分类 . python优缺点 . pyth ...
- 前端入门14-JavaScript进阶之继承
声明 本系列文章内容全部梳理自以下几个来源: <JavaScript权威指南> MDN web docs Github:smyhvae/web Github:goddyZhao/Trans ...
- ps快捷键(有道云笔记翻出来以前的存货)
打开 ctrl+o 关闭 ctrl+w 全选 ctrl+a 新建画布 ctrl+n 取消选区 ctrl+d 标尺 ctrl+r 虚线 ...
- Dynamics 365 Customer Engagement V9 活动源功能报错的解决方法
微软动态CRM专家罗勇 ,回复300或者20190120可方便获取本文,同时可以在第一间得到我发布的最新博文信息,follow me!我的网站是 www.luoyong.me . 安装好Dynamic ...
- Linux 监控CPU、内存、IO
安装说明 # tar zxvf sysstat-11.5.6.tar.gz# cd sysstat-11.5.6# ./configure# make# make install 备注:若在linux ...
- Easyui datagrid combobox输入框非法输入判断与事件总结
datagrid combobox输入框非法输入判断与事件总结 by:授客 QQ:1033553122 测试环境 jquery-easyui-1.5.3 常见事件 onSelect // 选择下拉列表 ...
- Android的WebView调试工具(无需Fan墙,可同时调试多个设备,永不过期)
缘起 前端开发离不开Chrome的开发者工具,尤其是调试Android WebView时.然而,如果使用chrome://Inspect的方法,国内的开发者会惊奇地发现“空白啊”!为此,我发布过这个离 ...
- 接入渠道SDK时出现乙方SDK回调不起作用
使用activity.runOnUiThread(new Runnable() {} 方法去解决