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的更多相关文章

  1. 攻防世界 reverse 进阶 APK-逆向2

    APK-逆向2 Hack-you-2014 (看名以为是安卓逆向呢0.0,搞错了吧) 程序是.net写的,直接祭出神器dnSpy 1 using System; 2 using System.Diag ...

  2. 攻防世界 reverse 进阶 10 Reverse Box

    攻防世界中此题信息未给全,题目来源为[TWCTF-2016:Reverse] Reverse Box 网上有很多wp是使用gdb脚本,这里找到一个本地还原关键算法,然后再爆破的 https://www ...

  3. 攻防世界 reverse 进阶 8-The_Maya_Society Hack.lu-2017

    8.The_Maya_Society Hack.lu-2017 在linux下将时间调整为2012-12-21,运行即可得到flag. 下面进行分析 1 signed __int64 __fastca ...

  4. 攻防世界 reverse 进阶 12 ReverseMe-120

    程序流程很清晰 1 int __cdecl main(int argc, const char **argv, const char **envp) 2 { 3 unsigned int v3; // ...

  5. 攻防世界 reverse 进阶 notsequence

    notsequence  RCTF-2015 关键就是两个check函数 1 signed int __cdecl check1_80486CD(int a1[]) 2 { 3 signed int ...

  6. 攻防世界 reverse 进阶 easyre-153

    easyre-153 查壳: upx壳 脱壳: 1 int __cdecl main(int argc, const char **argv, const char **envp) 2 { 3 int ...

  7. 攻防世界 reverse 进阶 -gametime

    19.gametime csaw-ctf-2016-quals 这是一个小游戏,挺有意思的 's'-->' '    'x'-->'x'   'm'-->'m' 观察流程,发现检验函 ...

  8. 攻防世界 reverse 进阶 16-zorropub

    16.zorropub  nullcon-hackim-2016 (linux平台以后整理) https://github.com/ctfs/write-ups-2016/tree/master/nu ...

  9. 攻防世界 reverse 进阶 15-Reversing-x64Elf-100

    15.Reversing-x64Elf-100 这题非常简单, 1 signed __int64 __fastcall sub_4006FD(__int64 a1) 2 { 3 signed int ...

随机推荐

  1. tensorflow加载ckpt出错

    Issue链接 问题: tensorflow加载ckpt出错 此处原因: 该ckpt文件对应的tensorflow版本过老, 其中的部分内置变量名发生了改变. 提示: Key lstm_o/bidir ...

  2. React Gatsby 最新教程

    React Gatsby 最新教程 https://www.gatsbyjs.com/docs/quick-start/ https://www.gatsbyjs.com/docs/tutorial/ ...

  3. how to read the 10th line of a text using shell script

    how to read the 10th line of a text using shell script shell script / bash script question https://l ...

  4. 「NGK每日快讯」2021.1.15日NGK公链第73期官方快讯!

  5. MySQL 修改数据表

    修改数据表: 创建数据表 更改表明 更改字段数据类型 更改字段名称 更改字段名称和数据类型 为表添加新字段 将字段顺序改为第一位 将字段顺序改为另一个字段之后 删除字段 1 use test; 2 3 ...

  6. JDK源码阅读-FileOutputStream

    本文转载自JDK源码阅读-FileOutputStream 导语 FileOutputStream用户打开文件并获取输出流. 打开文件 public FileOutputStream(File fil ...

  7. 翻译:《实用的 Python 编程》02_07_Objects

    目录 | 上一节 (2.6 列表推导式) | 下一节 (3 从程序组织) 2.7 对象 本节介绍有关 Python 内部对象模型的更多详细信息,并讨论一些与内存管理,拷贝和类型检查有关的问题. 赋值 ...

  8. Charles 抓取https 包

    1.  Recording Settings中 include 添加 host , port端口为443 2.  SSL Proxying Settings 选中 Enable SSL Proxyin ...

  9. 重复代码的克星,高效工具 VSCode snippets 的使用指南

    为什么要用 snippets(代码段)? 不管你使用何种编程语言,在我们日常的编码工作中,都会存在有大量的重复代码编写,例如: 日志打印: console.log,log.info('...') 输出 ...

  10. IDEA SVN 使用

    转: IDEA SVN 使用 一.上传项目到 SVN VCS -> Import into Version Control -> Share Project(Subversion) 点击 ...