## [[Root-Me](https://www.root-me.org/)] [[Cracking](https://www.root-me.org/en/Challenges/Cracking/)] [[ELF C++ - 0 protection](https://www.root-me.org/en/Challenges/Cracking/ELF-C-0-protection)] [[解题报告](https://exp-blog.com/safe/ctf/rootme/cracking/elf-c-0-protection/)]
------
## 初步分析
不太水的水题,需要懂得反汇编工具的使用,以及一些汇编原理。
开始挑战后下载了一个 `ch25.bin` 文件,判断是 Linux 下编译的可执行二进制文件。
放到 Linux 下执行 `./ch25.bin` (注意赋予 `x` 执行权限),提示使用方法为 `./ch25.bin password`
尝试输入任意密码执行,提示密码错误。
![](https://github.com/lyy289065406/CTF-Solving-Reports/blob/master/rootme/Cracking/%5B04%5D%20%5B10P%5D%20ELF%20C%2B%2B%20-%200%20protection/imgs/01.png)
初步判断可能密码以常量方式存储在代码中。
使用文本编辑器打开,尝试搜索关键字 `password` ,发现一段常量文字,但是密码被隐藏其中:
![](https://github.com/lyy289065406/CTF-Solving-Reports/blob/master/rootme/Cracking/%5B04%5D%20%5B10P%5D%20ELF%20C%2B%2B%20-%200%20protection/imgs/02.png)
看来只能 **反编译** 了。
------------
## 反汇编
Linux 下的反汇编可以直接使用 `objdump` 工具,执行以下命令生成反汇编源码:
`objdump ch25.bin -S >> ch25-src.asm`
![](https://github.com/lyy289065406/CTF-Solving-Reports/blob/master/rootme/Cracking/%5B04%5D%20%5B10P%5D%20ELF%20C%2B%2B%20-%200%20protection/imgs/03.png)
```asm
;ch25-src.asm
ch25.bin: file format elf32-i386
Disassembly of section .init:
08048738 <_init>:
8048738: 53 push %ebx
8048739: 83 ec 08 sub $0x8,%esp
804873c: e8 7f 01 00 00 call 80488c0 <__x86.get_pc_thunk.bx>
8048741: 81 c3 bf 28 00 00 add $0x28bf,%ebx
8048747: 8b 83 fc ff ff ff mov -0x4(%ebx),%eax
804874d: 85 c0 test %eax,%eax
804874f: 74 05 je 8048756 <_init+0x1e>
8048751: e8 3a 00 00 00 call 8048790 <__gmon_start__@plt>
8048756: 83 c4 08 add $0x8,%esp
8048759: 5b pop %ebx
804875a: c3 ret
Disassembly of section .plt:
08048760 <.plt>:
8048760: ff 35 04 b0 04 08 pushl 0x804b004
8048766: ff 25 08 b0 04 08 jmp *0x804b008
804876c: 00 00 add %al,(%eax)
...
08048770 <__cxa_atexit@plt>:
8048770: ff 25 0c b0 04 08 jmp *0x804b00c
8048776: 68 00 00 00 00 push $0x0
804877b: e9 e0 ff ff ff jmp 8048760 <.plt>
08048780 <_ZNSspLEc@plt>:
8048780: ff 25 10 b0 04 08 jmp *0x804b010
8048786: 68 08 00 00 00 push $0x8
804878b: e9 d0 ff ff ff jmp 8048760 <.plt>
08048790 <__gmon_start__@plt>:
8048790: ff 25 14 b0 04 08 jmp *0x804b014
8048796: 68 10 00 00 00 push $0x10
804879b: e9 c0 ff ff ff jmp 8048760 <.plt>
080487a0 <_ZNSsixEj@plt>:
80487a0: ff 25 18 b0 04 08 jmp *0x804b018
80487a6: 68 18 00 00 00 push $0x18
80487ab: e9 b0 ff ff ff jmp 8048760 <.plt>
080487b0 <_ZNSt8ios_base4InitC1Ev@plt>:
80487b0: ff 25 1c b0 04 08 jmp *0x804b01c
80487b6: 68 20 00 00 00 push $0x20
80487bb: e9 a0 ff ff ff jmp 8048760 <.plt>
080487c0 <__libc_start_main@plt>:
80487c0: ff 25 20 b0 04 08 jmp *0x804b020
80487c6: 68 28 00 00 00 push $0x28
80487cb: e9 90 ff ff ff jmp 8048760 <.plt>
080487d0 <_ZNKSs6lengthEv@plt>:
80487d0: ff 25 24 b0 04 08 jmp *0x804b024
80487d6: 68 30 00 00 00 push $0x30
80487db: e9 80 ff ff ff jmp 8048760 <.plt>
080487e0 <_ZNSt8ios_base4InitD1Ev@plt>:
80487e0: ff 25 28 b0 04 08 jmp *0x804b028
80487e6: 68 38 00 00 00 push $0x38
80487eb: e9 70 ff ff ff jmp 8048760 <.plt>
080487f0 <_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@plt>:
80487f0: ff 25 2c b0 04 08 jmp *0x804b02c
80487f6: 68 40 00 00 00 push $0x40
80487fb: e9 60 ff ff ff jmp 8048760 <.plt>
08048800 <_ZNSsD1Ev@plt>:
8048800: ff 25 30 b0 04 08 jmp *0x804b030
8048806: 68 48 00 00 00 push $0x48
804880b: e9 50 ff ff ff jmp 8048760 <.plt>
08048810 <_ZNKSs7compareEPKc@plt>:
8048810: ff 25 34 b0 04 08 jmp *0x804b034
8048816: 68 50 00 00 00 push $0x50
804881b: e9 40 ff ff ff jmp 8048760 <.plt>
08048820 <_ZNSsC1EPKcRKSaIcE@plt>:
8048820: ff 25 38 b0 04 08 jmp *0x804b038
8048826: 68 58 00 00 00 push $0x58
804882b: e9 30 ff ff ff jmp 8048760 <.plt>
08048830 <_ZNSaIcED1Ev@plt>:
8048830: ff 25 3c b0 04 08 jmp *0x804b03c
8048836: 68 60 00 00 00 push $0x60
804883b: e9 20 ff ff ff jmp 8048760 <.plt>
08048840 <_ZNSolsEPFRSoS_E@plt>:
8048840: ff 25 40 b0 04 08 jmp *0x804b040
8048846: 68 68 00 00 00 push $0x68
804884b: e9 10 ff ff ff jmp 8048760 <.plt>
08048850 <_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@plt>:
8048850: ff 25 44 b0 04 08 jmp *0x804b044
8048856: 68 70 00 00 00 push $0x70
804885b: e9 00 ff ff ff jmp 8048760 <.plt>
08048860 <_ZNSaIcEC1Ev@plt>:
8048860: ff 25 48 b0 04 08 jmp *0x804b048
8048866: 68 78 00 00 00 push $0x78
804886b: e9 f0 fe ff ff jmp 8048760 <.plt>
08048870 <__gxx_personality_v0@plt>:
8048870: ff 25 4c b0 04 08 jmp *0x804b04c
8048876: 68 80 00 00 00 push $0x80
804887b: e9 e0 fe ff ff jmp 8048760 <.plt>
08048880 <_Unwind_Resume@plt>:
8048880: ff 25 50 b0 04 08 jmp *0x804b050
8048886: 68 88 00 00 00 push $0x88
804888b: e9 d0 fe ff ff jmp 8048760 <.plt>
Disassembly of section .text:
08048890 <_start>:
8048890: 31 ed xor %ebp,%ebp
8048892: 5e pop %esi
8048893: 89 e1 mov %esp,%ecx
8048895: 83 e4 f0 and $0xfffffff0,%esp
8048898: 50 push %eax
8048899: 54 push %esp
804889a: 52 push %edx
804889b: 68 90 8d 04 08 push $0x8048d90
80488a0: 68 20 8d 04 08 push $0x8048d20
80488a5: 51 push %ecx
80488a6: 56 push %esi
80488a7: 68 86 8a 04 08 push $0x8048a86
80488ac: e8 0f ff ff ff call 80487c0 <__libc_start_main@plt>
80488b1: f4 hlt
80488b2: 66 90 xchg %ax,%ax
80488b4: 66 90 xchg %ax,%ax
80488b6: 66 90 xchg %ax,%ax
80488b8: 66 90 xchg %ax,%ax
80488ba: 66 90 xchg %ax,%ax
80488bc: 66 90 xchg %ax,%ax
80488be: 66 90 xchg %ax,%ax
080488c0 <__x86.get_pc_thunk.bx>:
80488c0: 8b 1c 24 mov (%esp),%ebx
80488c3: c3 ret
80488c4: 66 90 xchg %ax,%ax
80488c6: 66 90 xchg %ax,%ax
80488c8: 66 90 xchg %ax,%ax
80488ca: 66 90 xchg %ax,%ax
80488cc: 66 90 xchg %ax,%ax
80488ce: 66 90 xchg %ax,%ax
080488d0 <deregister_tm_clones>:
80488d0: b8 5f b0 04 08 mov $0x804b05f,%eax
80488d5: 2d 5c b0 04 08 sub $0x804b05c,%eax
80488da: 83 f8 06 cmp $0x6,%eax
80488dd: 77 01 ja 80488e0 <deregister_tm_clones+0x10>
80488df: c3 ret
80488e0: b8 00 00 00 00 mov $0x0,%eax
80488e5: 85 c0 test %eax,%eax
80488e7: 74 f6 je 80488df <deregister_tm_clones+0xf>
80488e9: 55 push %ebp
80488ea: 89 e5 mov %esp,%ebp
80488ec: 83 ec 18 sub $0x18,%esp
80488ef: c7 04 24 5c b0 04 08 movl $0x804b05c,(%esp)
80488f6: ff d0 call *%eax
80488f8: c9
没有合适的资源?快使用搜索试试~ 我知道了~
CTF 解题报告.zip
共781个文件
png:463个
md:148个
flagzip:81个
需积分: 5 0 下载量 170 浏览量
2023-12-29
21:18:18
上传
评论
收藏 88.67MB ZIP 举报
温馨提示
CTF 解题报告.zip
资源推荐
资源详情
资源评论
收起资源包目录
CTF 解题报告.zip (781个子文件)
ch25-src.asm 26KB
index.php.bak 1KB
ch3.bin 691KB
ch25.bin 12KB
ch7.bin 45B
page.css 24KB
ch22.exe 26KB
ch15.exe 12KB
flagzip 342B
flagzip 325B
flagzip 189B
flagzip 186B
flagzip 181B
flagzip 178B
flagzip 174B
flagzip 174B
flagzip 171B
flagzip 170B
flagzip 170B
flagzip 170B
flagzip 169B
flagzip 169B
flagzip 168B
flagzip 167B
flagzip 167B
flagzip 167B
flagzip 167B
flagzip 167B
flagzip 167B
flagzip 167B
flagzip 164B
flagzip 164B
flagzip 164B
flagzip 163B
flagzip 162B
flagzip 161B
flagzip 160B
flagzip 160B
flagzip 159B
flagzip 158B
flagzip 158B
flagzip 157B
flagzip 157B
flagzip 157B
flagzip 157B
flagzip 157B
flagzip 157B
flagzip 157B
flagzip 157B
flagzip 157B
flagzip 156B
flagzip 155B
flagzip 155B
flagzip 155B
flagzip 155B
flagzip 154B
flagzip 154B
flagzip 154B
flagzip 154B
flagzip 154B
flagzip 154B
flagzip 153B
flagzip 153B
flagzip 153B
flagzip 153B
flagzip 152B
flagzip 152B
flagzip 151B
flagzip 151B
flagzip 151B
flagzip 151B
flagzip 150B
flagzip 150B
flagzip 150B
flagzip 150B
flagzip 150B
flagzip 150B
flagzip 149B
flagzip 149B
flagzip 148B
flagzip 148B
flagzip 148B
flagzip 148B
flagzip 148B
flagzip 147B
flagzip 147B
flagzip 147B
flagzip 146B
flagzip 146B
index.html 76KB
payload.html 131B
payload.html 107B
payload.html 75B
payload.html 69B
payload.html 67B
payload-1.html 57B
payload.html 55B
payload-1.html 43B
payload.html 43B
payload-3.html 37B
共 781 条
- 1
- 2
- 3
- 4
- 5
- 6
- 8
资源评论
YOLO数据集工作室
- 粉丝: 442
- 资源: 1569
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功