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

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

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

  2. 攻防世界 reverse evil

    这是2017 ddctf的一道逆向题, 挑战:<恶意软件分析> 赛题背景: 员工小A收到了一封邮件,带一个文档附件,小A随手打开了附件.随后IT部门发现小A的电脑发出了异常网络访问请求,进 ...

  3. 攻防世界 reverse tt3441810

    tt3441810 tinyctf-2014 附件给了一堆数据,将十六进制数据部分提取出来, flag应该隐藏在里面,(这算啥子re,) 保留可显示字符,然后去除填充字符(找规律 0.0) 处理脚本: ...

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

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

  5. Flex: Holy Grail

    Flex:Holy Grail <html> <head> <style type="text/css"> body,div,header,ma ...

  6. CTF--web 攻防世界web题 robots backup

    攻防世界web题 robots https://adworld.xctf.org.cn/task/answer?type=web&number=3&grade=0&id=506 ...

  7. CTF--web 攻防世界web题 get_post

    攻防世界web题 get_post https://adworld.xctf.org.cn/task/answer?type=web&number=3&grade=0&id=5 ...

  8. 【CSS-flex】圣杯布局(Holy Grail Layout)、输入框的布局、悬挂式布局、固定的底栏

    1.圣杯布局(Holy Grail Layout) 其指的是一种最常见的网站布局.页面从上到下,分成三个部分:头部(header),躯干(body),尾部(footer).其中躯干又水平分成三栏,从左 ...

  9. 攻防世界 web进阶练习 NewsCenter

    攻防世界 web进阶练习 NewsCenter   题目是NewsCenter,没有提示信息.打开题目,有一处搜索框,搜索新闻.考虑xss或sql注入,随便输入一个abc,没有任何搜索结果,页面也没有 ...

  10. 【攻防世界】高手进阶 pwn200 WP

    题目链接 PWN200 题目和JarvisOJ level4很像 检查保护 利用checksec --file pwn200可以看到开启了NX防护 静态反编译结构 Main函数反编译结果如下 int ...

随机推荐

  1. 渗透技巧——如何逃逸Linux的受限制shell执行任意命令

    导语:本文介绍了如何在受限制的shell中执行任意命令,实现交互.其相应的利用场景是说当我们通过一些手段拿到当前Linux机器的shell时,由于当前shell的限制,很多命令不能执行,导致后续的渗透 ...

  2. Hexo-域名设置+收录

    Hexo-域名设置+Github域名加速+网址收录 Github.Gitee绑定域名,然后进行网址收录. 不想购买域名也完全可以进行网址收录. 购买阿里云域名 1.进入阿里云域名网站 2.进入价格详情 ...

  3. MDN & JavaScript 文档翻译状态

    MDN & JavaScript 文档翻译状态 https://developer.mozilla.org/zh-CN/docs/MDN/Doc_status/JavaScript refs ...

  4. LeetCode & list cycle

    LeetCode & list cycle 链表是否存在环检测 singly-linked list 单链表 "use strict"; /** * * @author x ...

  5. 同城速递 & 同城跑腿 & 竞品分析

    同城速递 & 同城跑腿 & 竞品分析 toC / toB 闪送 https://www.ishansong.com/ https://www.tianyancha.com/compan ...

  6. Node.js & process.env & OS Platform checker

    Node.js & process.env & OS Platform checker Window 10 Windows 7 ia32 CentOS $ node # process ...

  7. qrcode & console.log

    qrcode & console.log image https://fs-api.lightyy.com/service/utils/qrcode?url=http://169.254.13 ...

  8. flutter 使用Android studio编辑kt插件

    使用android studio打开/example/android 文件即可

  9. WebView & WKWebView & UIWebView

    WebView & WKWebView & UIWebView WebView WKWebView https://developer.apple.com/documentation/ ...

  10. WLAN-AC+AP射频一劳永逸的调优方式

    AP射频调优组网图 射频调优简介 射频调优的主要功能就是动态调整AP的信道和功率,可以使同一AC管理的各AP的信道和功率保持相对平衡,保证AP工作在最佳状态.WLAN网络中,AP的工作状态会受到周围环 ...