DiceCTF2022
目录
DiceCTF2020
DiceCTF题目好怪啊
interview
在主函数有一个溢出,覆盖main的返回地址为_libc_strat_main
内,可以再次调用main同时得到libc地址。
|
|
baby-rop
uaf,通过对ub中的chunk的复用泄漏libc地址,uaf控制一个strings的结构体,从而可以任意地址读写,泄露栈地址,向栈中写rop
|
|
dataeater
可以控制scanf的参数,不能rop。这样可以写任意写buf和link_map。覆盖link_map->l_info[strtab]为buf,从而在buf伪造system字符串,使其搜索system地址。
|
|
chutes-ladders
- First, copy all the Player->mark to the first board->players
Game:
- spin a num (0-6), 0 pass
cur_player->square
- update board
board->bitmap ^= (1 << palyer_idx)
- leave here
- clear
board->players
- if
bitmap == 0
:- free
board->players
- free
- clear
Player->square += spin
- if hit a ladders:
cur_player->square = ladders_end
- update board
board->bitmap ^= (1 << palyer_idx)
- enter here
- first get the board:
- allocte
board->players
, init with ’ '
- allocte
- copy mark
- first get the board:
ladders_hit = 1
- if hit a chutes:
cur_player->square = chutes_end
- update board
board->bitmap ^= (1 << palyer_idx)
- enter here
- first get the board:
- allocte
board->players
, init with ’ '
- allocte
- copy mark
- first get the board:
chutes_hit = 1
- else
- update board
board->bitmap ^= (1 << palyer_idx)
- enter here
- first get the board:
- allocte
board->players
, init with ’ '
- allocte
- copy mark
- first get the board:
chutes_hit = 1
- update board
- if
bitmap == 0
:board->players = 0
- next turn
- repeat
10 players
- [0, 1, 2, 3, 4, 5, 6, 7, 8] at 1
- allocate one chunk
- [3, 4, 5, 6, 7, 8] at 1, [0, 1, 2] at 2
- allocate two chunk
- [3, 4, 5, 6, 7, 8] at 1, [1, 2] at 2, 0 at 5
- allocate three chunk
- [1, 2, 3, 4, 5, 6, 7, 8] at 2, [0] at 5
- allocate two chunk
- free 1
- [1, 2, 3, 4, 5, 6, 7, 8] at 2, [0] leave but ret to 5
- allocate one chunk
- free 3 (UAF) -> free 1
- [8, 9] at 2, [0, 1, 2, 3, 4, 5, 6, 7] at 5
- allocate one chunk
- free 3 (UAF) -> __malloc_hook
- [8, 9] at 2, [1, 2, 3, 4, 5, 6, 7] at 5, [9] at 6
- __malloc_hook
- [8] at 2, [1, 2, 3, 4, 5, 6, 7] at 5, [9] at 6, [0] at 10
- 10 is __malloc_hook - 4
- [1, 2, 3, 8] at 5, [0, 4, 5, 6, 7, 9] at 10
- overwrite malloc_hook to one gadget
- [1, 2, 3] at 5, [0, 4, 5, 6, 7, 8, 9] at 10
- overwrite malloc_hook to one gadget
- [1, 2, 3] at 5, [4, 5, 6, 7, 8, 9] at 10, [0] at 14 hit chutes to 0!
- clear rdx=0, trigger one gadget
|
|