攻防世界 reverse reverse-for-the-holy-grail-350
reverse-for-the-holy-grail-350 tu-ctf-2016
程序流程很简单,就一个检验函数:
1 __int64 __fastcall stringMod(__int64 *a1)
2 {
3 __int64 length; // r9
4 char *c_str; // r10
5 __int64 i; // rcx
6 signed int v4; // er8
7 int *temp_2; // rdi
8 int *temp_3; // rsi
9 signed int t; // ecx
10 signed int j; // er9
11 int index; // er10
12 unsigned int tmp; // eax
13 int sign; // esi
14 int v12; // esi
15 int temp[24]; // [rsp+0h] [rbp-60h]
16
17 memset(temp, 0, 0x48uLL);
18 length = a1[1];
19 if ( length )
20 {
21 c_str = (char *)*a1;
22 i = 0LL;
23 v4 = 0;
24 do
25 {
26 v12 = c_str[i];
27 temp[i] = v12;
28 if ( 3 * ((unsigned int)i / 3) == (_DWORD)i && v12 != firstchar[(unsigned int)i / 3] )// 当i是3的倍数时,str=first[i/3]
29 // { 65, 105, 110, 69, 111, 97}
30 v4 = -1;
31 ++i;
32 }
33 while ( i != length );
34 }
35 else
36 {
37 v4 = 0;
38 }
39 temp_2 = temp;
40 temp_3 = temp;
41 t = 666;
42 do
43 {
44 *temp_3 = t ^ *(unsigned __int8 *)temp_3;
45 t += t % 5;
46 ++temp_3;
47 }
48 while ( &temp[18] != temp_3 ); // 异或操作
49 j = 1;
50 index = 0;
51 tmp = 1;
52 sign = 0;
53 do // 0,1,2 每三个数验证
54 {
55 if ( sign == 2 )
56 {
57 if ( *temp_2 != thirdchar[index] ) // { 751, 708, 732, 711, 734, 764, 0, 0 }
58 // temp[2]=
59 v4 = -1;
60 if ( tmp % *temp_2 != masterArray[index] )// { 471, 12, 580, 606, 147, 108 }
61 //
62 // temp[0]*temp[1]%temp[2]=
63 v4 = -1;
64 ++index;
65 tmp = 1;
66 sign = 0;
67 }
68 else // sign 0,1,
69 {
70 tmp *= *temp_2; // 0 tmp=temp[0]
71 // 1 tmp=temp[0]*temp[1]
72 if ( ++sign == 3 )
73 sign = 0;
74 }
75 ++j;
76 ++temp_2;
77 }
78 while ( j != 19 ); // 18循环
79 return (unsigned int)(t * v4);
80 }
wp:
1 firstchar=[65, 105, 110, 69, 111, 97]
2 thirdchar=[751, 708, 732, 711, 734, 764]
3 masterArray=[471, 12, 580, 606, 147, 108 ]
4 t=[]
5 x=666
6 for i in range(18):
7 t.append(x)
8 x+=x%5
9 flag=[0 for i in range(18)]
10 index=0
11 for i in range(0,18,3):
12 flag[i]=firstchar[index] #0,3,6
13 index+=1
14 index=0
15 for i in range(2,18,3):
16 flag[i]=thirdchar[index]^t[i] #2 5,8
17 index+=1
18 index=0
19 for i in range(1,18,3):
20 for f in range(32,126): #常用可输入字符
21 if (flag[i-1]^t[i-1])*(f^t[i])%(flag[i+1]^t[i+1])==masterArray[index]:
22 flag[i]=f
23 index+=1
24 break;
25
26 print('tuctf{'+''.join(map(chr,flag))+'}')
tuctf{AfricanOrEuropean?}
攻防世界 reverse reverse-for-the-holy-grail-350的更多相关文章
- 攻防世界 reverse 进阶 10 Reverse Box
攻防世界中此题信息未给全,题目来源为[TWCTF-2016:Reverse] Reverse Box 网上有很多wp是使用gdb脚本,这里找到一个本地还原关键算法,然后再爆破的 https://www ...
- 攻防世界 reverse evil
这是2017 ddctf的一道逆向题, 挑战:<恶意软件分析> 赛题背景: 员工小A收到了一封邮件,带一个文档附件,小A随手打开了附件.随后IT部门发现小A的电脑发出了异常网络访问请求,进 ...
- 攻防世界 reverse tt3441810
tt3441810 tinyctf-2014 附件给了一堆数据,将十六进制数据部分提取出来, flag应该隐藏在里面,(这算啥子re,) 保留可显示字符,然后去除填充字符(找规律 0.0) 处理脚本: ...
- 攻防世界 reverse 进阶 APK-逆向2
APK-逆向2 Hack-you-2014 (看名以为是安卓逆向呢0.0,搞错了吧) 程序是.net写的,直接祭出神器dnSpy 1 using System; 2 using System.Diag ...
- Flex: Holy Grail
Flex:Holy Grail <html> <head> <style type="text/css"> body,div,header,ma ...
- 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 ...
- 【CSS-flex】圣杯布局(Holy Grail Layout)、输入框的布局、悬挂式布局、固定的底栏
1.圣杯布局(Holy Grail Layout) 其指的是一种最常见的网站布局.页面从上到下,分成三个部分:头部(header),躯干(body),尾部(footer).其中躯干又水平分成三栏,从左 ...
- 攻防世界 web进阶练习 NewsCenter
攻防世界 web进阶练习 NewsCenter 题目是NewsCenter,没有提示信息.打开题目,有一处搜索框,搜索新闻.考虑xss或sql注入,随便输入一个abc,没有任何搜索结果,页面也没有 ...
- 【攻防世界】高手进阶 pwn200 WP
题目链接 PWN200 题目和JarvisOJ level4很像 检查保护 利用checksec --file pwn200可以看到开启了NX防护 静态反编译结构 Main函数反编译结果如下 int ...
随机推荐
- 微软官方 free 教程 & 教材 ,MVC ,ASP.NET,.NET,
MVA https://mva.microsoft.com/ebooks free ebooks 微软官方, free, 教程 ,教材,微软官方 free 教程 & 教材,MVC ,ASP.N ...
- Flipper & React Native
Flipper & React Native Flipper Flipper是一款用于调试移动应用程序的出色开发人员工具,在Android和iOS社区中颇受欢迎. Flipper is a g ...
- jest all in one
jest all in one ES Modules & TypeScript & React https://github.com/xgqfrms/FEAT/tree/master/ ...
- JavaScript Number Type Checker
JavaScript Number Type Checker Number.isInteger // static 方法 Number.isInteger(value) https://develop ...
- js & array & shuffle
js & array & shuffle const list = [1, 2, 3, 4, 5, 6, 7, 8, 9]; list.sort(() => Math.rando ...
- http cache & 浏览器缓存,存储位置的优先级,条件?
http cache & 浏览器缓存,存储位置的优先级,条件? memory cache disk cache 浏览器缓存,存储位置的优先级,条件, 机制,原理是什么? from memory ...
- Flutter: OrientationBuilder 根据方向更新UI
文档 api class _HomePageState extends State<HomePage> { @override Widget build(BuildContext cont ...
- MySQL全面瓦解22:索引的介绍和原理分析
索引的定义 MySQL官方对索引的定义为:索引(Index)是协助MySQL高效获取数据的数据结构. 本质上,索引的目的是为了提高查询效率,通过不断地缩小想要获取数据的范围来筛选出最终想要的结果,同时 ...
- go-admin在线开发平台学习-3[细节解析]
本章节主要的内容是对go-admin中的一些有趣编码进行分析,为自己以后提供一些借鉴 使用cli方式启动项目 使用cobra[眼镜蛇]完成强壮cli的工具,确保稳定. 使用cli的方式启动项目的好处显 ...
- 生成类库项目时同时生成的pdb文件是什么东东?
英文全称:Program Database File Debug里的PDB是full,保存着调试和项目状态信息.有断言.堆栈检查等代码.可以对程序的调试配置进行增量链接.Release 里的PDB是p ...