攻防世界 reverse 进阶 easyre-153
easyre-153
查壳:

upx壳
脱壳:

1 int __cdecl main(int argc, const char **argv, const char **envp)
2 {
3 int pipedes[2]; // [esp+18h] [ebp-38h]
4 __pid_t v5; // [esp+20h] [ebp-30h]
5 int v6; // [esp+24h] [ebp-2Ch]
6 char buf; // [esp+2Eh] [ebp-22h]
7 unsigned int v8; // [esp+4Ch] [ebp-4h]
8
9 v8 = __readgsdword(0x14u);
10 pipe(pipedes); // pipe函数可用于创建一个管道,以实现进程间的通信。
11 // pipe函数的定义如下:
12 // #include<unistd.h>
13 // int pipe(int fd[2]);
14 // pipe函数定义中的fd参数是一个大小为2的一个数组类型的指针。该函数成功时返回0,并将一对打开的文件描述符值填入fd参数指向的数组。失败时返回 -1并设置errno。
15 // 通过pipe函数创建的这两个文件描述符 fd[0] 和 fd[1] 分别构成管道的两端,往 fd[1] 写入的数据可以从 fd[0] 读出。并且 fd[1] 一端只能进行写操作,fd[0] 一端只能进行读操作,不能反过来使用。要实现双向数据传输,可以使用两个管道。
16 v5 = fork(); // 1)在父进程中,fork返回新创建子进程的进程ID;
17 // 2)在子进程中,fork返回0;
18 // 3)如果出现错误,fork返回一个负值;
19 if ( !v5 ) // 等于0,即在子进程中时
20 {
21 puts("\nOMG!!!! I forgot kid's id");
22 write(pipedes[1], "69800876143568214356928753", 0x1Du);// 写入
23 puts("Ready to exit ");
24 exit(0);
25 }
26 read(pipedes[0], &buf, 0x1Du); // 读取
27 __isoc99_scanf("%d", &v6);
28 if ( v6 == v5 )
29 {
30 if ( (*(_DWORD *)((_BYTE *)lol + 3) & 0xFF) == 204 )
31 {
32 puts(":D");
33 exit(1);
34 }
35 printf("\nYou got the key\n ");
36 lol(&buf); // 生成flag
37 }
38 wait(0);
39 return 0;
40 }
查看lol(&buf)
1 int __cdecl lol(_BYTE *a1)
2 {
3 char v2; // [esp+15h] [ebp-13h]
4 char v3; // [esp+16h] [ebp-12h]
5 char v4; // [esp+17h] [ebp-11h]
6 char v5; // [esp+18h] [ebp-10h]
7 char v6; // [esp+19h] [ebp-Fh]
8 char v7; // [esp+1Ah] [ebp-Eh]
9 char v8; // [esp+1Bh] [ebp-Dh]
10
11 v2 = 2 * a1[1];
12 v3 = a1[4] + a1[5];
13 v4 = a1[8] + a1[9];
14 v5 = 2 * a1[12];
15 v6 = a1[18] + a1[17];
16 v7 = a1[10] + a1[21];
17 v8 = a1[9] + a1[25];
18 return printf("flag_is_not_here");
19 }
wp:
1 a1='69800876143568214356928753'
2 a1=list(map(ord,a1))
3 v2 = 2 * a1[1];
4 v3 = a1[4] + a1[5];
5 v4 = a1[8] + a1[9];
6 v5 = 2 * a1[12];
7 v6 = a1[18] + a1[17];
8 v7 = a1[10] + a1[21];
9 v8 = a1[9] + a1[25];
10
11 # x=locals().items()
12 # print(x)
13 flag=''
14 for i in range(2,9):
15 flag+=chr(locals()['v'+str(i)])
16 print(flag)
rhelheg
特娘的,提交需要加上RCTF{}
RCTF{rhelheg}
攻防世界 reverse 进阶 easyre-153的更多相关文章
- 攻防世界 reverse 进阶 APK-逆向2
APK-逆向2 Hack-you-2014 (看名以为是安卓逆向呢0.0,搞错了吧) 程序是.net写的,直接祭出神器dnSpy 1 using System; 2 using System.Diag ...
- 攻防世界 reverse 进阶 10 Reverse Box
攻防世界中此题信息未给全,题目来源为[TWCTF-2016:Reverse] Reverse Box 网上有很多wp是使用gdb脚本,这里找到一个本地还原关键算法,然后再爆破的 https://www ...
- 攻防世界 reverse 进阶 9-re1-100
9.re1-100 1 if ( numRead ) 2 { 3 if ( childCheckDebugResult() ) 4 { 5 responseFalse(); 6 } 7 else if ...
- 攻防世界 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 进阶 notsequence
notsequence RCTF-2015 关键就是两个check函数 1 signed int __cdecl check1_80486CD(int a1[]) 2 { 3 signed int ...
- 攻防世界 reverse 进阶 -gametime
19.gametime csaw-ctf-2016-quals 这是一个小游戏,挺有意思的 's'-->' ' 'x'-->'x' 'm'-->'m' 观察流程,发现检验函 ...
- 攻防世界 reverse 进阶 16-zorropub
16.zorropub nullcon-hackim-2016 (linux平台以后整理) https://github.com/ctfs/write-ups-2016/tree/master/nu ...
- 攻防世界 reverse 进阶 15-Reversing-x64Elf-100
15.Reversing-x64Elf-100 这题非常简单, 1 signed __int64 __fastcall sub_4006FD(__int64 a1) 2 { 3 signed int ...
- 攻防世界 reverse 进阶 12 ReverseMe-120
程序流程很清晰 1 int __cdecl main(int argc, const char **argv, const char **envp) 2 { 3 unsigned int v3; // ...
随机推荐
- 输入函数input()、运算符
一.input()函数的基本使用 present = input('大圣想要什么礼物') 作用:接受来自用户的输入 返回值类型:输入值的类型为str 值的存储:使用 = 对输入的值进行存储 name= ...
- Steam 钓鱼模拟器
Steam 钓鱼模拟器 Fishing Planet Fishing Planet 是一个独特和高度现实的在线第一人称多人钓鱼模拟器,由狂热的钓鱼爱好者钓鱼给你带来实际钓鱼充分刺激开发! 选择你的诱饵 ...
- Caddyfile 是干什么的?
Caddyfile 是干什么的? The Caddyfile is a convenient Caddy configuration format for humans. It is most peo ...
- js Array All In One
js Array All In One array 方法,改变原数组(长度),不改变原数组(长度) https://developer.mozilla.org/en-US/docs/Web/JavaS ...
- how to remove git commit history
how to remove git commit history 如何删除 GitHub 仓库的历史数据 git filter-branch remove GitHub git commit hist ...
- GitHub Packages
GitHub Packages https://github.com/xgqfrms?tab=packages // Step 1: Use `publishConfig` option in you ...
- HTML5 QRCode Scaner
HTML5 QRCode Scaner how to scan QR Code using the camera of the phone or website live demo https://c ...
- dragable tabs & iframe & new window
dragable tabs & iframe & new window https://www.npmjs.com/package/react-draggable-tab demo h ...
- ng 设置动态的document title
使用Title服务 相关文章 配置路由, 添加data.title参数 import { NgModule } from '@angular/core'; import { RouterModule, ...
- nodejs 显示进度条插件
ora 显示loading.. progress 进度条 progress var ProgressBar = require("progress"); var bar = new ...