「配枪朱丽叶。」

RootのCTF学习笔记。

BSidesCF2019/BUUCTF-WEB:Pick Tac Toe

https://s2.ax1x.com/2020/02/17/3iibOP.png
打开就是这种和工具人玩XXOO的游戏(嘿。。
我们代表的是X,正常无论怎么玩都赢不了。

按下f12仔细观察代码:

<!-- HTML for the empty bottom row of a tic tac toe board -->
<tr>
    <form id="form_ul" method="POST" action="/move"></form>
    <input type="hidden" name="move" value="ul">
    <td id="ul" onclick="$('#form_ul').submit()"> </td>
    
    <form id="form_u" method="POST" action="/move"></form>
    <input type="hidden" name="move" value="u">
    <td id="u" onclick="$('#form_u').submit()"> </td>

    <form id="form_ur" method="POST" action="/move"></form>
    <input type="hidden" name="move" value="ur">
    <td id="ur" onclick="$('#form_ur').submit()"> </td>

</tr>

其中,第一排最左是ul,第一排中间是u,第一排最右是ur。
比如玩到了这个情况,只要第一排第三个是“X”我们就赢了:
https://s2.ax1x.com/2020/02/17/3ikBvR.png
所以我们抓包,把它替换掉,再点击放包就可以啦:
https://s2.ax1x.com/2020/02/17/3ikTqP.png
得到flag:
https://s2.ax1x.com/2020/02/17/3iAPaT.png