攻防世界 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 ...
随机推荐
- Community Cloud零基础学习(五)Topic(主题)管理
我们以前讲过 Service Cloud 零基础(三)Knowledge浅谈,我们日常可以看见很多得文章或者帖子,我们可以将其通过data category / group进行管理.但是一个系统中得文 ...
- Ubuntu16安装Caffe+Python3缺少libboost
如果在/usr/lib/x86_64-linux-gnu中找到libboost_python-py3.5.so, 则 sudo ln -s libboost_python-py3.5.so libbo ...
- Chrome new features preview
Chrome new features preview CSS Overview https://css-tricks.com/new-in-chrome-css-overview/ capture ...
- js & touch & pull down & load more
js & touch & pull down & load more https://www.jianshu.com/p/93597d6bd77d index-list htt ...
- vue农历日历
<template> <div class="calendar-main"> <div class="choose_year"&g ...
- Error Code: 1452 Cannot add or update a child row: a foreign key constraint fails
错误: Error Code: 1452 Cannot add or update a child row: a foreign key constraint fails 错误产生情景:我向一张带外键 ...
- React组件复用的方式
React组件复用的方式 现前端的工程化越发重要,虽然使用Ctrl+C与Ctrl+V同样能够完成需求,但是一旦面临修改那就是一项庞大的任务,于是减少代码的拷贝,增加封装复用能力,实现可维护.可复用的代 ...
- IDEA重新安装之后配置GIT
注:此方法可用于配置gitlab也可用于配置github 1.在github中创建一个账号:https://github.com/join?source=header-home 2.下载并安装git: ...
- 怎么去掉右下角的thinkphp的图标
关闭thinkphp右下角的trace可以试试以下步骤: 1.在入口文件index.php 加入 define("APP_DEBUG", false); 2.在config.php ...
- nacos集群
本章分析一下nacos集群之间nacos服务器上线,下线原理 每5秒运行定时任务ServerListManager.ServerListUpdater获取新上线的节点或下线的节点 每2秒运行定时任务S ...