tinyctf-2014

elrond32

 1 int __cdecl main(int a1, char **arg_input)
2 {
3 if ( a1 > 1 && check_8048414(arg_input[1], 0) )
4 {
5 puts("Access granted");
6 print_flag_8048538((int)arg_input[1]);
7 }
8 else
9 {
10 puts("Access denied");
11 }
12 return 0;
13 }

关注check_8048414函数和print_flag_8048538函数

 1 signed int __cdecl sub_8048414(_BYTE *a1, int a2)
2 {
3 signed int result; // eax
4
5 switch ( a2 )
6 {
7 case 0:
8 if ( *a1 == 'i' )
9 goto LABEL_19;
10 result = 0;
11 break;
12 case 1:
13 if ( *a1 == 'e' )
14 goto LABEL_19;
15 result = 0;
16 break;
17 case 3:
18 if ( *a1 == 'n' )
19 goto LABEL_19;
20 result = 0;
21 break;
22 case 4:
23 if ( *a1 == 'd' )
24 goto LABEL_19;
25 result = 0;
26 break;
27 case 5:
28 if ( *a1 == 'a' )
29 goto LABEL_19;
30 result = 0;
31 break;
32 case 6:
33 if ( *a1 == 'g' )
34 goto LABEL_19;
35 result = 0;
36 break;
37 case 7:
38 if ( *a1 == 's' )
39 goto LABEL_19;
40 result = 0;
41 break;
42 case 9:
43 if ( *a1 == 'r' )
44 LABEL_19:
45 result = check_8048414(a1 + 1, 7 * (a2 + 1) % 11);// arg2-->0 7 1 3 6 5 9 4
46 else
47 result = 0;
48 break;
49 default:
50 result = 1;
51 break;
52 }
53 return result;
54 }

上面函数验证输入

输出flag函数print_flag_8048538:

1 int __cdecl print_flag_8048538(int a1)
2 {
3 int v2[33]; // [esp+18h] [ebp-A0h]
4 int i; // [esp+9Ch] [ebp-1Ch]
5
6 qmemcpy(v2, data_8048760, sizeof(v2));
7 for ( i = 0; i <= 32; ++i )
8 putchar(v2[i] ^ *(char *)(a1 + i % 8));
9 return putchar(10);

wp:

 1 a='ie ndags r'
2 x=0
3 s=[]
4 for i in range(8):
5 x=7*x%11
6 s.append(a[x])
7 x+=1
8 print(''.join(s))
9 data=[15, 31, 4, 9, 28, 18, 66, 9, 12, 68, 13, 7, 9, 6, 45, 55, 89, 30, 0, 89, 15, 8, 28, 35, 54, 7, 85, 2, 12, 8, 65, 10, 20]
10 for i in range(33):
11 print(chr(ord(s[i%8])^data[i]),end='')

isengard
flag{s0me7hing_S0me7hinG_t0lki3n}

攻防世界 reverse elrond32的更多相关文章

  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. 攻防世界 reverse Windows_Reverse2

    Windows_Reverse2   2019_DDCTF 查壳: 寻找oep-->dump-->iat修复   便可成功脱壳 int __cdecl main(int argc, con ...

  6. 攻防世界 reverse BabyXor

    BabyXor     2019_UNCTF 查壳 脱壳 dump 脱壳后 IDA静态分析 int main_0() { void *v0; // eax int v1; // ST5C_4 char ...

  7. 攻防世界 reverse parallel-comparator-200

    parallel-comparator-200 school-ctf-winter-2015 https://github.com/ctfs/write-ups-2015/tree/master/sc ...

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

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

  9. 攻防世界 reverse easy_Maze

    easy_Maze 从题目可得知是简单的迷宫问题 int __cdecl main(int argc, const char **argv, const char **envp) { __int64 ...

随机推荐

  1. filter_var 函数()绕过执行命令

    escape 过滤器来过滤link,而实际上这里的 escape 过滤器,是用PHP内置函数 htmlspecialchars 来实现的 htmlspecialchars 函数定义如下: htmlsp ...

  2. SSH Keys vs GPG Keys

    SSH Keys vs GPG Keys SSH Keys SSH keys allow you to establish a secure connection between your compu ...

  3. 2020 Web 全栈面经

    2020 Web 全栈面经 1.简历 2. 技术 3. 项目 4. 架构 5. 沟通,协作 6.成长 7. 面试技巧 准备 电话确认,面试流程,五险一金缴纳情况 有无笔试,几轮,面试时间,答复时间 细 ...

  4. Free Video Player All In One

    Free Video Player All In One VLC media player https://github.com/videolan/vlc VideoLAN https://www.v ...

  5. JSDoc in action

    JSDoc in action JSDoc https://jsdoc.app/index.html https://github.com/jsdoc/jsdoc $ npm -g jsdoc $ n ...

  6. Web 安全 & 反爬虫原理

    Web 安全 & 反爬虫原理 数据加密/解密 HTTPS ip 封锁 请求限制 爬虫识别,canvas 指纹 refs https://segmentfault.com/a/119000001 ...

  7. vue & watch props

    vue & watch props bug OK watch: { // props // chatObj: () => { // // bug // log(`this.chatObj ...

  8. bowser checker & UA

    bowser checker & UA navigator.userAgent; https://developer.mozilla.org/en-US/docs/Web/HTTP/Brows ...

  9. 2020 NGK 全球启动大会于美国硅谷圆满落幕

    据NCC报道美国西海岸时间11月25日,NGK全球启动大会在美国加利福尼亚北部的硅谷会展中心成功举办.本次大会吸引了来自世界各地的企业家.创业者.开发者,以及投资人达一万人次齐聚硅谷. NGK创始人. ...

  10. Python数据结构与算法_搜索插入位置(07)

    给定一个排序数组和一个目标值,在数组中找到目标值,并返回其索引.如果目标值不存在于数组中,返回它将会被按顺序插入的位置. 你可以假设数组中无重复元素. 示例 1: 输入: [1,3,5,6], 5输出 ...