攻防世界 reverse elrond32
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的更多相关文章
- 攻防世界 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 ...
- 攻防世界 reverse Windows_Reverse2
Windows_Reverse2 2019_DDCTF 查壳: 寻找oep-->dump-->iat修复 便可成功脱壳 int __cdecl main(int argc, con ...
- 攻防世界 reverse BabyXor
BabyXor 2019_UNCTF 查壳 脱壳 dump 脱壳后 IDA静态分析 int main_0() { void *v0; // eax int v1; // ST5C_4 char ...
- 攻防世界 reverse parallel-comparator-200
parallel-comparator-200 school-ctf-winter-2015 https://github.com/ctfs/write-ups-2015/tree/master/sc ...
- 攻防世界 reverse 进阶 8-The_Maya_Society Hack.lu-2017
8.The_Maya_Society Hack.lu-2017 在linux下将时间调整为2012-12-21,运行即可得到flag. 下面进行分析 1 signed __int64 __fastca ...
- 攻防世界 reverse easy_Maze
easy_Maze 从题目可得知是简单的迷宫问题 int __cdecl main(int argc, const char **argv, const char **envp) { __int64 ...
随机推荐
- 018-019 NET5_内置容器支持依赖注入+IServiceCollection的生命周期
概念: DI依赖注入: IServiceCollection仅支持构造函数注入 什么是依赖注入? 如果对象A依赖对象B,对象B依赖对象C,就可以先构造对象C,然后传递给对象B,再把对象B传递给A.得到 ...
- 008.NET5_IIS安装教程
控制面板->程序->启动或关闭Windows功能
- Dyno-queues 分布式延迟队列 之 基本功能
Dyno-queues 分布式延迟队列 之 基本功能 目录 Dyno-queues 分布式延迟队列 之 基本功能 0x00 摘要 0x01 Dyno-queues分布式延迟队列 1.1 设计目标 1. ...
- Building an IMAP Email Client with PHP
1 Building an IMAP Email Client with PHP http://www.toptal.com/php/building-an-imap-email-client-wit ...
- HTML Custom Elements & valid name
HTML Custom Elements & valid name valid custom element name https://html.spec.whatwg.org/multipa ...
- Linux & bash & tcpdump
Linux & bash & tcpdump Linux & tcpdump https://www.tecmint.com/12-tcpdump-commands-a-net ...
- eui & search select
eui & search select https://element.eleme.io/#/zh-CN/component/select demo <template> < ...
- Flutter: random color
import 'dart:math' as math; import 'package:flutter/material.dart'; void main() => runApp(App()); ...
- 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 错误产生情景:我向一张带外键 ...
- Java自学第8期——多线程
1.多线程: 操作系统支持同时运行多个任务,一个任务通常是一个程序,所有运行中的程序就是一个进程().程序内部包含多个顺序执行流,每个顺序执行流就是一个线程. 并发:两个或者多个事件在同一个时间段内交 ...