Description

Find the flag being held on this server to get ahead of the competition http://mercury.picoctf.net:47967/

Solution

看HTML發現有兩種請求方式

GET 和 POST

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<div class="col-md-6">
<div class="panel panel-primary" style="margin-top:50px">
<div class="panel-heading">
<h3 class="panel-title" style="color:red">Red</h3>
</div>
<div class="panel-body">
<form action="index.php" method="GET">
<input type="submit" value="Choose Red"/>
</form>
</div>
</div>
</div>
<div class="col-md-6">
<div class="panel panel-primary" style="margin-top:50px">
<div class="panel-heading">
<h3 class="panel-title" style="color:blue">Blue</h3>
</div>
<div class="panel-body">
<form action="index.php" method="POST">
<input type="submit" value="Choose Blue"/>
</form>
</div>
</div>
</div>

嘗試使用HEAD請求

1
2
3
4
5
6
7
import requests

url = "http://mercury.picoctf.net:47967/index.php"

response = requests.request("HEAD", url, headers={}, data={})

print(response.headers)

找到flag

1
{'flag': 'picoCTF{r3j3ct_th3_du4l1ty_cca66bd3}', 'Content-type': 'text/html; charset=UTF-8'}