点击此处获得更好的阅读体验
WriteUp来源
https://dunsp4rce.github.io/csictf-2020/miscellaneous/2020/07/21/Mafia.html
by anishbadhri
题目描述
The CTF Mafia wants to remove the competition (i.e.you) to again have monopoly over flags. Bribe the Mafia to get away unscathed and with the flag.
题目考点
解题思路
This problem is an application of binary search. The value of amount is binary searched with a lower bound as 1 and upper bound as 1000000.
In each iteration, the current amount is queried against the current set of friends. All friends with amount greater than the current amount is taken as the set of friends for the next iteration. If no friend has amount greater than current but some friend has equal to current amount, that value is displayed. Otherwise, the same set of friends are taken for a lower amount.
Solution Script:
1 | from pwn import * |
Flag
1 | csictf{y0u_ar5_t8e_k!ng_0f_rAnd0mne55} |