攻防世界 reverse 进阶 9-re1-100
9.re1-100
1 if ( numRead )
2 {
3 if ( childCheckDebugResult() )
4 {
5 responseFalse();
6 }
7 else if ( bufParentRead[0] == '{' ) // 第一位
8 {
9 if ( strlen(bufParentRead) == 42 ) // 输入的长度为42d
10 {
11 if ( !strncmp(&bufParentRead[1], "53fc275d81", 0xAuLL) )// 输入的1-10位(输入的第2位到第11位)
12 {
13 if ( bufParentRead[strlen(bufParentRead) - 1] == '}' )// 最后一位
14 {
15 if ( !strncmp(&bufParentRead[31], "4938ae4efd", 0xAuLL) )// 输入的31-40位
16 {
17 if ( !confuseKey(bufParentRead, 42) )//关键
18 {
19 responseFalse();
20 }
21 else if ( !strncmp(bufParentRead, "{daf29f59034938ae4efd53fc275d81053ed5be8c}", 0x2AuLL) )// 修改后的结果进行比较
22 {
23 responseTrue(); // {53fc275d81053ed5be8cdaf29f59034938ae4efd}
24 }
25 else
26 {
27 responseFalse();
主要分析confuseKey(bufParentRead, 42)函数
1 bool __cdecl confuseKey(char *szKey, int iKeyLength)
2 {
3 char szPart1[15]; // [rsp+10h] [rbp-50h]
4 char szPart2[15]; // [rsp+20h] [rbp-40h]
5 char szPart3[15]; // [rsp+30h] [rbp-30h]
6 char szPart4[15]; // [rsp+40h] [rbp-20h]
7 unsigned __int64 v7; // [rsp+58h] [rbp-8h]
8
9 v7 = __readfsqword(0x28u);
10 *(_QWORD *)szPart1 = 0LL;
11 *(_DWORD *)&szPart1[8] = 0;
12 *(_WORD *)&szPart1[12] = 0;
13 szPart1[14] = 0;
14 *(_QWORD *)szPart2 = 0LL;
15 *(_DWORD *)&szPart2[8] = 0;
16 *(_WORD *)&szPart2[12] = 0;
17 szPart2[14] = 0;
18 *(_QWORD *)szPart3 = 0LL;
19 *(_DWORD *)&szPart3[8] = 0;
20 *(_WORD *)&szPart3[12] = 0;
21 szPart3[14] = 0;
22 *(_QWORD *)szPart4 = 0LL;
23 *(_DWORD *)&szPart4[8] = 0;
24 *(_WORD *)&szPart4[12] = 0;
25 szPart4[14] = 0;
26 if ( iKeyLength != 42 )
27 return 0;
28 if ( !szKey )
29 return 0;
30 if ( strlen(szKey) != 42 )
31 return 0;
32 if ( *szKey != 123 )
33 return 0;
34 strncpy(szPart1, szKey + 1, 0xAuLL); // 将输入去掉头尾{}后的部分分成4部分
35 strncpy(szPart2, szKey + 11, 0xAuLL);
36 strncpy(szPart3, szKey + 21, 0xAuLL);
37 strncpy(szPart4, szKey + 31, 0xAuLL);
38 memset(szKey, 0, iKeyLength);
39 *szKey = '{';
40 strcat(szKey, szPart3); // 分割后的部分重新组合
41 strcat(szKey, szPart4);
42 strcat(szKey, szPart1);
43 strcat(szKey, szPart2);
44 szKey[41] = '}';
45 return 1;
46 }
算法十分简单:
1 s1='53fc275d81'
2 s4='4938ae4efd'
3 # 3,4,1,2
4 ss='daf29f59034938ae4efd53fc275d81053ed5be8c'
5 x=[]
6 for i in range(0,len(ss),10):
7 x.append(ss[i:i+10])
8 print(x)
9 print('{',''.join((x[2],x[3],x[0],x[1])),'}',sep='')
10
11 # ['daf29f5903', '4938ae4efd', '53fc275d81', '053ed5be8c']
12 # {53fc275d81053ed5be8cdaf29f59034938ae4efd}
{53fc275d81053ed5be8cdaf29f59034938ae4efd}
这题实在是简单,签到题水平,竟然放到了进阶区,,,,
因为提交时没有{}
是不是很坑,
hahah
攻防世界 reverse 进阶 9-re1-100的更多相关文章
- 攻防世界 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 ...
- 攻防世界 reverse 进阶 8-The_Maya_Society Hack.lu-2017
8.The_Maya_Society Hack.lu-2017 在linux下将时间调整为2012-12-21,运行即可得到flag. 下面进行分析 1 signed __int64 __fastca ...
- 攻防世界 reverse 进阶 12 ReverseMe-120
程序流程很清晰 1 int __cdecl main(int argc, const char **argv, const char **envp) 2 { 3 unsigned int v3; // ...
- 攻防世界 reverse 进阶 notsequence
notsequence RCTF-2015 关键就是两个check函数 1 signed int __cdecl check1_80486CD(int a1[]) 2 { 3 signed int ...
- 攻防世界 reverse 进阶 easyre-153
easyre-153 查壳: upx壳 脱壳: 1 int __cdecl main(int argc, const char **argv, const char **envp) 2 { 3 int ...
- 攻防世界 reverse 进阶 -gametime
19.gametime csaw-ctf-2016-quals 这是一个小游戏,挺有意思的 's'-->' ' 'x'-->'x' 'm'-->'m' 观察流程,发现检验函 ...
- 攻防世界 reverse 进阶 16-zorropub
16.zorropub nullcon-hackim-2016 (linux平台以后整理) https://github.com/ctfs/write-ups-2016/tree/master/nu ...
- 攻防世界 reverse 进阶 15-Reversing-x64Elf-100
15.Reversing-x64Elf-100 这题非常简单, 1 signed __int64 __fastcall sub_4006FD(__int64 a1) 2 { 3 signed int ...
随机推荐
- js class static property & public class fields & private class fields
js class static property class static property (public class fields) const log = console.log; class ...
- alipay 小程序开发教程
alipay 小程序开发教程 https://opendocs.alipay.com/mini/00ccmd 或访问开放平台:https://opendocs.alipay.com/mini/00cc ...
- go好用的类型转换第三方组件
Cast介绍 开源地址 https://github.com/spf13/cast Cast是什么? Cast是一个库,以一致和简单的方式在不同的go类型之间转换. Cast提供了简单的函数,可以轻松 ...
- CSS中Position属性static、absolute、fixed、relative
在html中网页可以看成一个立体的空间,一个完整的页面是由很多个页面堆积形成的,如下图所示 CSS中Position属性有四个可选值,它们分别是:static.absolute.fixed.rel ...
- 使用hive增量更新
目录 1.增量更新 2.对第一种情况 2.1.准备工作 2.2.更新数据 3.对第二种情况 3.1.准备工作 3.2.方法1 3.3.方法2 参考文末文章,加上自己的理解. 1.增量更新 有一个 ba ...
- Python安装教程
1.下载好Python安装包后,双击打开(第一个是32位,第二个是64位,根据自己电脑位数进行选择): 2.打开后如下,先将下方的Python添加到系统环境变量勾选上,再点击第一个默认安装即可: 3. ...
- banner自用图床2
- Vue使用 空白占位符
当有时候需要在页面显示时显示空格时,可以使用 ,但是使用这个占位符时,无论写多少个,就只能显示一个空格.要想显示多个空格进行占位,这种方式显然是可行的,解决方法是使用转义字符. 先看代码: <t ...
- JS判断对象是否包含某个属性
1.使用hasOwnProperty()判断 hasOwnProperty方法的参数就是要判断的属性名称,当对象的属性存在时返回true,否则返回false. var obj = { name:'ja ...
- 保姆级别学生党安装Clion IDE(面向华师同学)
保姆级别学生党安装Clion IDE(面向华师同学) 界面UI 废话不多说,直接上图 具备功能 UI美观 (下面会介绍) 基础的代码编写能力 大容量的IDE插件 (下面会介绍) 代码补全,以及搭配Ki ...