攻防世界 reverse 进阶5-7

5.re-for-50-plz-50  tu-ctf-2016

流程很简单,异或比较

1 x=list(‘cbtcqLUBChERV[[[email protected]_X^D]X_YPV[CJ‘)
2 y=0x37
3 z=‘‘
4 for t in x:
5     z+=chr(ord(t)^y)
6 print(z)

TUCTF{but_really_whoisjohngalt}



6.key csaw-ctf-2016-quals

运行后打印完?W?h?a?t h?a?p?p?e?n? 便结束

修改指令跳过文件读取,输出=W=r=o=n=g=K=e=y=

关键点就是sub_4020c0函数

关注if比较处

动态调试可直接获得flag

这里的的v7其实是sub_4020c0函数中第三个参数

关注Memory,发现两次循环处理

脚本:

 1 x=[ 0x74, 0x68, 0x65, 0x6D, 0x69, 0x64, 0x61, 0x74, 0x68, 0x65,
 2   0x6D, 0x69, 0x64, 0x61, 0x74, 0x68, 0x65, 0x6D, 0x69, 0x64,
 3   0x6]
 4 y=[0x3E, 0x2D, 0x2D, 0x2D, 0x2D, 0x2B, 0x2B, 0x2B, 0x2B, 0x2E,
 5   0x2E, 0x2E, 0x2E, 0x3C, 0x3C, 0x3C, 0x3C, 0x2E]
 6 # print(len(x))
 7 # print(len(y))
 8 z=[]
 9 for i in range(18):
10     z.append((x[i]^y[i])+22+9)
11
12 # print(‘ ‘.join(map(hex,z)))
13 print(‘‘.join(map(chr,z)))

idg_cni~bjbfi|gsxb



7.simple-check-100  school-ctf-winter-2015

exe文件有坑,满是辛酸泪,分析elf文件

过掉check_key()函数在linux便可直接输出flag

分析:

 1   a1[0] = 0xE37EC854;
 2   a1[1] = 0x9A16C764;
 3   a1[2] = 0x326511CD;
 4   a1[3] = 0x43D3E32D;
 5   a1[4] = 0xD29DA992;
 6   a1[5] = 0xD32C6DE6;
 7   a1[6] = 0x6AFEBDB6;
 8   v14 = 0x13;
 9   v3 = alloca(32);
10   v15 = &v7;
11   printf("Key: ");
12   __isoc99_scanf((int)"%s", (int)v15, v5, v6, v7, v8, v9, (int)v10, v11, v12, a1[0], a1[1], a1[2], a1[3], a1[4], a1[5]);
13   if ( check_key((int)v15) )
14     interesting_function(a1);
 1 unsigned int *__cdecl interesting_function(int a1[7])
 2 {
 3   unsigned int *result; // eax
 4   unsigned int temp; // [esp+18h] [ebp-20h]
 5   int i; // [esp+1Ch] [ebp-1Ch]
 6   int j; // [esp+20h] [ebp-18h]
 7   int *__attribute__((__org_arrdim(0,7))) v5; // [esp+24h] [ebp-14h]
 8   char *ptr_temp; // [esp+28h] [ebp-10h]
 9   unsigned int v7; // [esp+2Ch] [ebp-Ch]
10
11   v7 = __readgsdword(0x14u);
12   result = (unsigned int *)a1;
13   v5 = a1;
14   for ( i = 0; i <= 6; ++i )
15   {
16     temp = v5[i] ^ 0xDEADBEEF;
17     result = &temp;
18     ptr_temp = (char *)&temp;
19     for ( j = 3; j >= 0; --j )
20       result = (unsigned int *)putchar((char)(ptr_temp[j] ^ flag_data[i][j]));
21   }
22   return result;
23 }

脚本:

 1 win=[0x54, 0xB8, 0xFE, 0x61, 0x00, 0x13, 0x00, 0x00, 0x00, 0x61, 0x6A, 0xFE, 0xBD, 0xB6, 0xD3, 0x2C,
 2 0x6D, 0xE6, 0xD2, 0x9D, 0xA9, 0x92, 0x43, 0xD3, 0xE3, 0x2D, 0x32, 0x65, 0x11, 0xCD, 0x9A, 0x16,
 3 0xC7, 0x64, 0xE3, 0x7E, 0xC8, 0x30]#windows下调试获取的操作数据
 4 win2=[0x6A, 0xFE, 0xBD, 0xB6, 0xD3, 0x2C,
 5 0x6D, 0xE6, 0xD2, 0x9D, 0xA9, 0x92, 0x43, 0xD3, 0xE3, 0x2D, 0x32, 0x65, 0x11, 0xCD, 0x9A, 0x16,
 6 0xC7, 0x64, 0xE3, 0x7E, 0xC8, 0x54]
 7 win2=win2[::-1]
 8
 9 flag_date=[0xDC, 0x17, 0xBF, 0x5B, 0xD4, 0x0A, 0xD2, 0x1B, 0x7D, 0xDA,
10   0xA7, 0x95, 0xB5, 0x32, 0x10, 0xF6, 0x1C, 0x65, 0x53, 0x53,
11   0x67, 0xBA, 0xEA, 0x6E, 0x78, 0x22, 0x72, 0xD3]
12
13
14 a1=[0 for i in range(7)]
15 a1[0] = 0xE37EC854;
16 a1[1] = 0x9A16C764;
17 a1[2] = 0x326511CD;
18 a1[3] = 0x43D3E32D;
19 a1[4] = 0xD29DA992;
20 a1[5] = 0xD32C6DE6;
21 a1[6] = 0x6AFEBDB6;
22
23 x=[0xef,0xbe,0xad,0xde]
24
25 s=‘‘
26 for i in range(7):
27     temp=(a1[i]^0xDEADBEEF).to_bytes(4,‘little‘)
28     for j in range(3,-1,-1):
29         s+=chr(temp[j]^flag_date[i*4+j])
30         print(chr(win[i * 4 + j] ^ flag_date[i * 4 + j] ^ x[j]), end=‘‘)
31 #         print(chr(v8[i*4+j]^flag_date[i*4+j]^x[j]),end=‘‘)
32 print()
33 print(s)

exe中栈内变量布局与linux不同,

exe文件:äìgŧ;µ`?n:ç,=?c?!hí±t
elf文件:flag_is_you_know_cracking!!!

flag_is_you_know_cracking!!!



原文地址:https://www.cnblogs.com/DirWang/p/11432234.html

时间: 2024-11-05 04:38:11

攻防世界 reverse 进阶5-7的相关文章

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

8.The_Maya_Society Hack.lu-2017 在linux下将时间调整为2012-12-21,运行即可得到flag. 下面进行分析 1 signed __int64 __fastcall main(__int64 a1, char **a2, char **a3) 2 { 3 size_t v3; // rbx 4 size_t v4; // rax 5 unsigned __int64 size; // rax 6 unsigned __int64 size_1; // ra

攻防世界 reverse 进阶 10 Reverse Box

攻防世界中此题信息未给全,题目来源为[TWCTF-2016:Reverse] Reverse Box 网上有很多wp是使用gdb脚本,这里找到一个本地还原关键算法,然后再爆破的 https://www.megabeets.net/twctf-2016-reverse-reverse-box/ [TWCTF-2016:Reverse] Reverse Box Writeup 标准 Shak的客座文章. 挑战描述$ ./reverse_box $ {FLAG} 95eeaf95ef942349995

攻防世界 reverse 进阶 16-zorropub

16.zorropub  nullcon-hackim-2016 (linux平台以后整理) https://github.com/ctfs/write-ups-2016/tree/master/nullcon-hackim-2016/re/zorropub-100 nullcon{nu11c0n_s4yz_x0r1n6_1s_4m4z1ng} 原文地址:https://www.cnblogs.com/DirWang/p/11448008.html

攻防世界 reverse 进阶 15-Reversing-x64Elf-100

15.Reversing-x64Elf-100 这题非常简单, 1 signed __int64 __fastcall sub_4006FD(__int64 a1) 2 { 3 signed int i; // [rsp+14h] [rbp-24h] 4 const char *v3; // [rsp+18h] [rbp-20h] 5 const char *v4; // [rsp+20h] [rbp-18h] 6 const char *v5; // [rsp+28h] [rbp-10h] 7

攻防世界 reverse BabyXor

BabyXor     2019_UNCTF 查壳 脱壳 dump 脱壳后 IDA静态分析 int main_0() { void *v0; // eax int v1; // ST5C_4 char *v2; // ST6C_4 const char *v3; // ST68_4 void *v4; // ST64_4 size_t v5; // eax char *v6; // ST60_4 v0 = (void *)sub_4010B4((int)&unk_4395F0, "世界上

攻防世界 reverse 新手练习区

1.re1 DUTCTF IDA shift+F12 查看字符串 DUTCTF{We1c0met0DUTCTF} 2.game ZSCTF zsctf{T9is_tOpic_1s_v5ry_int7resting_b6t_others_are_n0t} 3.Hello, CTF  Pediy CTF 2018 CrackMeJustForFun 将16进制字符串转ascii字符串得到flag 4.open-source HackYou CTF 参数 51966 25 h4cky0u flag为:

攻防世界 reverse android-app-100

 android-app-100  suctf-2016 jeb启动,找到点击事件: 验证流程: 输入作为参数 --> processObjectArrayFromNative 得到一返回值(ret_a) --> IsCorrect 返回0,失败:返回1,成功 --> 输出"Sharif_CTF("+md5(str(d+ret_a)+” “+”)“      (.d = 0x1BEBE) 可以发现flag的获取关键在于processObjectArrayFromNat

攻防世界 web进阶区 ics-06

进入题目的界面,一通乱点点出了唯一一个可以进入的界面. 观察url http://111.198.29.45:41597/index.php?page=index 觉得page变量有问题,既然他可以为index(即文件名,那可不可以显示文件源码呢?) 于是构造payload http://111.198.29.45:41597/index.php?page=php://filter/read=convert.base64-encode/resource=index.php 果然爆出了源码.放到解

攻防世界 reverse 2ex1

2ex1 CISCN-2018-Quals mark 1 import base64 2 3 std_base= "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" 4 mg_base='@,.1fgvw#`/2ehux$~\"3dity%_;4cjsz^+{5bkrA&=}6alqB*-[70mpC()]89noD' 5 6 en_trantab=str.maketrans(std_b