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的安全性远比大家的想象中脆弱,除了没有公开的漏洞以外,还有很多已经公开 ...
随机推荐
- Apollo配置中心动态刷新日志级别
Apollo配置中心动态刷新日志级别 添加次配置后,当在apollo上面调整日志级别不需要重启服务器,马上就能生效 /** * 结合apollo动态刷新日志级别 * @author: nj * @da ...
- 关于HTTP中GET与POST的区别
GET和POST是HTTP请求的两种基本方法,要说它们的区别,接触过WEB开发的人都能说出一二. 看似很简单,其实是一道送命题 “标准答案”: GET在浏览器回退时是无害的,而POST会再次提交请求. ...
- 通过Web API调用Action时各种类型输入参数传递值的方法
本人微信公众号:微软动态CRM专家罗勇 ,回复280或者20180906可方便获取本文,同时可以在第一间得到我发布的最新博文信息,follow me!我的网站是 www.luoyong.me . Dy ...
- 诗人般的机器学习,ML工作原理大揭秘
诗人般的机器学习,ML工作原理大揭秘 https://mp.weixin.qq.com/s/7N96aPAM_M6t0rV0yMLKbg 选自arXiv 作者:Cassie Kozyrkov 机器之心 ...
- iOS----------拨打电话的3种方式
iOS实现拨打电话的方式: 方法一.requestWithURL,此方法拨打前弹出提示 NSMutableString * string = [[NSMutableString alloc] in ...
- js 数组去重小技巧
js 数组去重小技巧 Intro 今天遇到一个问题,需要对数据进行去重,想看一下有没有什么比较方便的方法,果然有些收获. Question 问题描述: 我有一个这样的数据: [ { "Pro ...
- Mysql增量写入Hdfs(二) --Storm+hdfs的流式处理
一. 概述 上一篇我们介绍了如何将数据从mysql抛到kafka,这次我们就专注于利用storm将数据写入到hdfs的过程,由于storm写入hdfs的可定制东西有些多,我们先不从kafka读取,而先 ...
- 会话固定攻击 - yxcms session固定漏洞
目录 会话固定攻击 e.g. yxcms session固定攻击 分析 了解更多 会话固定攻击 Session fixation attack(会话固定攻击)是利用服务器的session不变机制,借他 ...
- MySQL5.7参数log_timestamps
最近测试MySQL 5.7.21 Community Server这个版本的MySQL数据库时,发现其错误日志的时间跟系统当前时间不一致,后面检查发现日期时间格式都是UTC时间,查了一下相关资料,原 ...
- 【原】Java学习笔记020 - 面向对象
package cn.temptation; public class Sample01 { public static void main(String[] args) { // 成员方法的参数列表 ...