728x90 ์ ์ฒด ๊ธ720 Dreamhack - ์๊ฒ์, command-injection-1 https://dreamhack.io/wargame/challenges/44/ command-injection-1 ํน์ Host์ ping ํจํท์ ๋ณด๋ด๋ ์๋น์ค์ ๋๋ค. Command Injection์ ํตํด ํ๋๊ทธ๋ฅผ ํ๋ํ์ธ์. ํ๋๊ทธ๋ flag.py์ ์์ต๋๋ค. Reference Introduction of Webhacking dreamhack.io Ping ํ์ด์ง๋ก ๋ค์ด๊ฐ๋ฉด ์์ดํผ๋ฅผ ์ ๋ ฅํ๋ ํผ์ด ๋ณด์ ๋๋ค. 127.0.0.1์ ๋ฃ๊ณ submit์ ์์ผ๋ณด๋, Ping์ ๊ฒฐ๊ณผ๊ฐ ์ถ๋ ฅ์ด ๋์ด ๋์ต๋๋ค. ์์ดํผ๋ฅผ ์ ๋ฌํ์ฌ ์์คํ ๋ช ๋ น์ด๋ฅผ ์คํ์ํค๋ ๋ชจ์์ ๋๋ค. ping ๋ง๊ณ ๋ ๋ค๋ฅธ ๋ช ๋ น์ด๋ฅผ ์คํ์์ผ๋ณด๊ธฐ ์ํด์ ;(์ธ๋ฏธ์ฝ๋ก )์ ์ฝ์ ์์ผ์ฃผ์์ต๋๋ค. ํ์ง๋ง ์์ฒญํ ํ์๊ณผ ์ผ์น์ํค๋ผ๋ ๊ฒฝ๊ณ ๋ฌธ์ด ๋จ๊ฒ ๋๋๋ฐ, ์ด๋ .. 2021. 11. 24. ์๋๋ก์ด๋ ์คํ๋์ค - The minCompileSdk (31) specified in adependency's... ์ค๋ฅ ํด๊ฒฐ build.gradle๋ก ๋ค์ด๊ฐ์ compileSdkVersion์ 31๋ก ์์ ์ถ์ฒ: https://ardmos.tistory.com/entry/The-minCompileSdk-31-specified-in-adependencys-AAR-metadata [์ค๋ฅ ํด๊ฒฐ] The minCompileSdk (31) specified in adependency's AAR metadata ... ์ด์ ์๋ก ๋ง๋ ํ๋ก์ ํธ๋ฅผ ๋น๋ํ๋ ค๋ ๋์ค The minCompileSdk (31) specified in a dependency's AAR metadata ... ๋ผ๋ ๋ด์ฉ์ ์ค๋ฅ๊ฐ ๋ฐ์ํ๋ค. - ํด๊ฒฐ ๋ฐฉ๋ฒ! bulid.gradle (Module) ํ์ผ์ compileSdk์ targ.. ardmos.tistory.com 2021. 11. 24. Dreamhack - ์๊ฒ์, image-storage https://dreamhack.io/wargame/challenges/38/ image-storage php๋ก ์์ฑ๋ ํ์ผ ์ ์ฅ ์๋น์ค์ ๋๋ค. ํ์ผ ์ ๋ก๋ ์ทจ์ฝ์ ์ ์ด์ฉํด ํ๋๊ทธ๋ฅผ ํ๋ํ์ธ์. ํ๋๊ทธ๋ /flag.txt์ ์์ต๋๋ค. Reference Server-side Basic dreamhack.io php๋ก ์์ฑ๋ ํ์ผ ์ ์ฅ ์๋น์ค์ ๋๋ค. upload ํ์ด์ง๋ก ๊ฐ๋ฉด ํ์ผ์ ์ ๋ก๋ํ ์ ์๋ ํ์ด์ง๊ฐ ์ถ๋ ฅ์ด ๋๋๋ฐ * ์ด๊ณณ์์๋ ์ ๋ก๋ํ ํ์ผ์ ๋ํ ์ด๋ ํ ๊ฒ์ฆ์ด ์ด๋ฃจ์ด์ง์ง ์๊ณ ์์ต๋๋ค. ์ฆ, .exe, .php, .bat ๊ฐ์ ๋ฏผ๊ฐํ ํ์ฅ์๋ฅผ ๊ฐ์ง ํ์ผ๋ค๋ ๋ง์๋๋ก ์ ๋ก๋๊ฐ ๊ฐ๋ฅํฉ๋๋ค. ์ ์ด๊ณณ์ ๊ฐ๋จํ ์น์์ ์ ๋ก๋ ํ์์ต๋๋ค. ์น์์ด๋? ์๋ฒ ์ฌ์ด๋ ์คํฌ๋ฆฝํธ ์ธ์ด๋ก ์์ฑ๋(php, jsp, .. 2021. 11. 24. Dreamhack - ์๊ฒ์, file-download-1 https://dreamhack.io/wargame/challenges/37/ file-download-1 File Download ์ทจ์ฝ์ ์ด ์กด์ฌํ๋ ์น ์๋น์ค์ ๋๋ค. flag.py๋ฅผ ๋ค์ด๋ก๋ ๋ฐ์ผ๋ฉด ํ๋๊ทธ๋ฅผ ํ๋ํ ์ ์์ต๋๋ค. Reference Introduction of Webhacking dreamhack.io /read?name=../flag.py ๋ฅผ ์ ๋ ฅํด์ ์์ ๋๋ ํ ๋ฆฌ์ flag.py๋ฅผ ์ฝ์ด ๋ค์ด๋ฉด ๋๋ค. 2021. 11. 24. ์๋๋ก์ด๋ ์คํ๋์ค - fragment ์กฐ์ํ๊ธฐ ์กํฐ๋นํฐ์ ๊ธฐ๋ณธ ๋ ์ด์์์ LinearLayout์ผ๋ก ๋ณ๊ฒฝ ๊ธฐ๋ณธ horizontal๋ฅผ vertical์ผ๋ก ๋ณ๊ฒฝ LinearLayout ์์์ ๋ ๊ฐ ๋ฃ์ด์ฃผ๊ธฐ ๊ฐ๊ฐ fragment ๋ทฐ์ด, fragment ์ ํ ์ญํ ์ ํ ๊ฑฐ์ ์ฒซ ๋ฒ์งธ ์์ LinearLayout์ id๋ฅผ Container๋ก ์์ ๋ ๋ฒ์งธ์ ์์ LinearLayout์ button๋ค์ ๋ฃ์ด์ค ๊ทธ๋ฐ๋ฐ ๋ฏธ๋ฆฌ๋ณด๊ธฐ์ button๋ค์ด ๋ณด์ด์ง ์๋ ๊ฒ์ ๋ณผ ์ ์๋๋ฐ, ์ด๋ Container๊ฐ ๋ถ๋ชจ์ ํฌ๊ธฐ๋งํผ ์ค์ ์ด ๋์ด์์ด์ ๋ฒํผ์ ๋ ์ด์์์ด ๋ฐ๋ ค๋ ๊ฒ์ Container์ layout_weight ์์ฑ ๊ฐ์ผ๋ก 1์ ์ค๋ค. ๋ฒํผ ๋ ์ด์์์ layout_height๋ฅผ wrap_content๋ก ๋ณ๊ฒฝํด์ค๋ค. ๊ทธ๋ผ ๋ฒํผ๋ค์ด ์ ๋๋ก ๋์ค๋ ๊ฒ์ ๋ณผ ์ ์๋ค.. 2021. 11. 23. ์๋๋ก์ด๋ ์คํ๋์ค - ๋ฉ๋ด๋ฐ ๋ฐ ๋ฉ๋ด ์์ดํ ์กฐ์ํ๊ธฐ ํ๋ก์ ํธ ํ์ผ์์ res ํด๋์ menu ํด๋๋ฅผ ์์ฑํ๊ณ , menu.xml ์์ฑ item์ ์ง์ด๋ฃ๊ณ id ๊ฐ์ ์ค์ package com.app.dbcontrol; import androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; import android.view.Menu; import android.view.MenuItem; import android.widget.Toast; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceS.. 2021. 11. 23. ์๋๋ก์ด๋ ์คํ๋์ค - ๋ง์ง๋ง ํ๋ก์ ํธ ์๋ ์ด๊ธฐ ํด์ Settings๋ก ์ด๋ ๊ฒ์์ฐฝ์ reopen ์ ๋ ฅํ์ Reopen last project on startup ์ฒดํฌ ํด์ ์ฐธ์กฐ: https://fiftiesstudy.tistory.com/126 ํํธ012_๋ง์ง๋ง ํ๋ก์ ํธ ์๋ ์ด๊ธฐ ํด์ ์๋๋ก์ด๋ ์คํ๋์ค๋ ์คํํ๋ฉด ๋ง์ง๋ง์ ์์ ํ ํ๋ก์ ํธ๋ฅผ ์๋์ผ๋ก ์ฌ๋ ๊ธฐ๋ฅ์ด ๊ธฐ๋ณธ์ผ๋ก ์ค์ ๋์ด ์๋ค. ์ด๊ฒ์ ํด์ ํ๋ ค๋ฉด File > Settings์์ ์ค์ ํ๋ฉด ๋๋ค. ๊ฒ์์ฐฝ์ reopen(๋ค์์ด๊ธฐ)๋ฅผ fiftiesstudy.tistory.com 2021. 11. 23. ์๊ณ ๋ฆฌ์ฆ - ํ์ด์ฌ for ๋ฐ๋ณต๋ฌธ์ผ๋ก ๋ฆฌ์คํธ ์์ฑํ๊ธฐ ํ์ด์ฌ์์๋ ๋จ ํ ์ค๋ง์ผ๋ก ํ๋ก๊ทธ๋๋จธ๊ฐ ์ํ๋ ๋ฆฌ์คํธ๋ฅผ ์์ฑํ๋ ๊ฒ ๊ฐ๋ฅํ๋ค. 0~n๊น์ง์ ๋ฐฐ์ด์ ์์ฑํ๊ฑฐ๋, [ str(_) for _ in range(10) ] 0~n๊น์ง์ ์ ์ ๊ฐ์ ๋ฌธ์ํํ๋ก ๋ฐฐ์ด์ ์ ์ฅ์ ํ๊ฑฐ๋, [ _ for _ in range(10) ] 2์ฐจ์ ๋ฐฐ์ด๋ก ๋ง๋๋ ๊ฒ๋ ๊ฐ๋ฅํ๋ค. [ [_ for _ in range(10)] for _ in range(2) ] 2021. 11. 22. ์๊ณ ๋ฆฌ์ฆ - ํผ๋ณด๋์น ์์ด ํผ๋ณด๋์น์์ด์ 0, 1, 1, 2, 3, 5 ,8... ์ด๋ฐ ์์๋ก ์์ ์์ ๋ค์ ์๊ฐ ์๋ก ๋ํ ๊ฐ์ ์์ด ํํ๋ก ๋ํ๋ธ ๊ฒ. (Fn = Fn-1 + fn-2) ํผ๋ณด๋์น์์ด์ ๊ตฌํํ๋ ๋ฐฉ๋ฒ์ ๋ํ์ ์ผ๋ก ์ฌ๊ท ํจ์์ ๋ฐ๋ณต๋ฌธ์ ์ด์ฉํ๋ ๋ฐฉ๋ฒ๋ค์ด ์๋ค. ์ฐ์ ์ฌ๊ทํจ์๋ก ํผ๋ณด๋์น์์ด์ ๊ตฌํํ๋ ๋ฐฉ๋ฒ int fibo(int n){ if( n 2021. 11. 22. ํ๋ก๊ทธ๋๋จธ์ค - ํผ๋ณด๋์น ์, ํ์ด์ฌ & C++ https://programmers.co.kr/learn/courses/30/lessons/12945 ์ฝ๋ฉํ ์คํธ ์ฐ์ต - ํผ๋ณด๋์น ์ ํผ๋ณด๋์น ์๋ F(0) = 0, F(1) = 1์ผ ๋, 1 ์ด์์ n์ ๋ํ์ฌ F(n) = F(n-1) + F(n-2) ๊ฐ ์ ์ฉ๋๋ ์ ์ ๋๋ค. ์๋ฅผ๋ค์ด F(2) = F(0) + F(1) = 0 + 1 = 1 F(3) = F(1) + F(2) = 1 + 1 = 2 F(4) = F(2) + F(3) = 1 + 2 = 3 F(5) = F(3) + F(4) = programmers.co.kr def solution(n): fibo = [0, 1, 1] for i in range(3, n + 1): fibo.append( ( fibo[i-1] + fibo[i-2] ) % 1234.. 2021. 11. 22. Dreamhack - ์๊ฒ์, XSS-1 https://dreamhack.io/wargame/challenges/28/ xss-1 ์ฌ๋ฌ ๊ธฐ๋ฅ๊ณผ ์ ๋ ฅ๋ฐ์ URL์ ํ์ธํ๋ ๋ด์ด ๊ตฌํ๋ ์๋น์ค์ ๋๋ค. XSS ์ทจ์ฝ์ ์ ์ด์ฉํด ํ๋๊ทธ๋ฅผ ํ๋ํ์ธ์. ํ๋๊ทธ๋ flag.txt, FLAG ๋ณ์์ ์์ต๋๋ค. Reference Client-side Basic dreamhack.io /flag๋ก ์ง์ ํด ์๋์ ์คํฌ๋ฆฝํธ๋ฅผ ๋ฃ์ด์ฃผ์ด์ ์คํํ์๋ค. XHR ์์ฒญ์ผ๋ก ์๋ฒ ์๊ธฐ ์์ ์ ์ฟ ํค๋ฅผ ๋ฉ๋ชจํ๋ ์คํฌ๋ฆฝํธ์ด๋ค. /memo๋ก ๋ค์ด๊ฐ ์ฃผ๋ฉด? ํ๋๊ทธ ๊ฐ์ด ๋์จ๋ค. XHR ์์ฒญ๋ง๊ณ ๋, location.href๋ฅผ ์ด์ฉํด๋ ์ฟ ํค๊ฐ ๋ด๊ธด GET ์์ฒญ์ ๋ณด๋ผ ์๊ฐ ์๋ค. 2021. 11. 22. ๋คํธ์ํฌ ํดํน - medua, ๋ฌด์ฐจ๋ณ ๋์ ๊ณต๊ฒฉ ๋๊ตฌ https://www.kali.org/tools/medusa/ medusa | Kali Linux Tools www.kali.org ์๋ hydra๊ณผ ๊ฐ์ ๋์ ๊ณต๊ฒฉ ๋๊ตฌ์ด๋ค. ์ฌ์ฉ ๋ฐฉ๋ฒ) medusa -h ํธ์คํธ -u ์ ์ -P ์ฌ์ (passwords.txt) -M ๋ชจ๋(ssh|ftp) ssh ์๋ฒ๋ฅผ ๋์์ผ๋ก ์จ๋ดค๋๋ฐ ์ ๋๋ค. example) medusa -h 192.168.0.5 -u root -p qwer1234 -M ssh medusa -h 192.168.0.5 -u root -P passwords.txt -M ftp 2021. 11. 22. ์ด์ 1 ยทยทยท 53 54 55 56 57 58 59 60 ๋ค์ 728x90