首页
社区
课程
招聘
1
看雪CTF2019Q2-第3题 金字塔的诅咒
发表于: 2019-6-18 22:50 5050

看雪CTF2019Q2-第3题 金字塔的诅咒

2019-6-18 22:50
5050

checksec

1
2
3
4
5
6
    Arch:     i386-32-little
    RELRO:    Full RELRO
    Stack:    Canary found
    NX:       NX enabled
    PIE:      PIE enabled
    FORTIFY:  Enabled

1
2
3
4
5
6
    Arch:     i386-32-little
    RELRO:    Full RELRO
    Stack:    Canary found
    NX:       NX enabled
    PIE:      PIE enabled
    FORTIFY:  Enabled

格式化字符串漏洞
1
2
3
4
5
6
7
8
9
10
11
.text:5662B933                 sub     esp, 8
.text:5662B936                 push    18h
.text:5662B938                 lea     eax, (echo - 5662CFB0h)[ebx] ; ""
.text:5662B93E                 push    eax
.text:5662B93F                 call    read_input
.text:5662B944                 add     esp, 10h
.text:5662B947                 sub     esp, 0Ch
.text:5662B94A                 lea     eax, (echo - 5662CFB0h)[ebx] ; ""
.text:5662B950                 push    eax             ; format
.text:5662B951                 call    _printf
.text:5662B956                 add     esp, 10h

1
2
3
4
5
6
7
8
9
10
11
.text:5662B933                 sub     esp, 8
.text:5662B936                 push    18h
.text:5662B938                 lea     eax, (echo - 5662CFB0h)[ebx] ; ""
.text:5662B93E                 push    eax
.text:5662B93F                 call    read_input
.text:5662B944                 add     esp, 10h
.text:5662B947                 sub     esp, 0Ch
.text:5662B94A                 lea     eax, (echo - 5662CFB0h)[ebx] ; ""
.text:5662B950                 push    eax             ; format
.text:5662B951                 call    _printf
.text:5662B956                 add     esp, 10h

%x泄露地址
%n修改栈返回地址为one_gadget
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
FFD5F0C0  5664300C  .bss:echo
FFD5F0C4  00000018  %1$x
FFD5F0C8  00000004  
FFD5F0CC  566418F3  %3$x, main+6D
FFD5F0D0  00000001  
FFD5F0D4  FFD5F194  %5$x
FFD5F0D8  FFD50A31
FFD5F0DC  36B20200  STACK_COOKIE
FFD5F0E0  FFD5F100  %8$x, SAVED_ECX
FFD5F0E4  00000000  SAVED_EBX
FFD5F0E8  00000000  SAVED_EBP
FFD5F0EC  F7D75637  %11$x, __libc_start_main+F7
...
FFD5F0FC  F7D75637  RET
...
FFD5F194  FFD6128A  %53$x
 
.text:56630985 lea     esp, [ebp-8]
.text:56630988 pop     ecx
.text:56630989 pop     ebx
.text:5663098A pop     ebp
.text:5663098B lea     esp, [ecx-4]
.text:5663098E retn
.text:5663098E main endp

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
FFD5F0C0  5664300C  .bss:echo
FFD5F0C4  00000018  %1$x
FFD5F0C8  00000004  
FFD5F0CC  566418F3  %3$x, main+6D
FFD5F0D0  00000001  
FFD5F0D4  FFD5F194  %5$x
FFD5F0D8  FFD50A31
FFD5F0DC  36B20200  STACK_COOKIE
FFD5F0E0  FFD5F100  %8$x, SAVED_ECX
FFD5F0E4  00000000  SAVED_EBX
FFD5F0E8  00000000  SAVED_EBP
FFD5F0EC  F7D75637  %11$x, __libc_start_main+F7
...
FFD5F0FC  F7D75637  RET
...
FFD5F194  FFD6128A  %53$x
 
.text:56630985 lea     esp, [ebp-8]
.text:56630988 pop     ecx
.text:56630989 pop     ebx
.text:5663098A pop     ebp
.text:5663098B lea     esp, [ecx-4]
.text:5663098E retn
.text:5663098E main endp

[注意]看雪招聘,专注安全领域的专业人才平台!

最后于 2019-6-19 02:01 被风间仁编辑 ,原因:
收藏
免费 1
支持
分享
赞赏记录
参与人
雪币
留言
时间
PLEBFE
为你点赞~
2023-1-25 03:10
最新回复 (1)
雪    币: 260
活跃值: (39)
能力值: ( LV9,RANK:144 )
在线值:
发帖
回帖
粉丝
2
666
2019-6-25 21:54
0
游客
登录 | 注册 方可回帖
返回

账号登录
验证码登录

忘记密码?
没有账号?立即免费注册