基本概述
Mikrotik系列路由器也成RouterOS軟路由,RouterOS是基于Linux核心的網絡作業系統,其預裝在MikroTik生産的路由器、無線裝置以及RouterBOARD上。同時,它也可以安裝在x86平台的個人電腦上,用于将電腦轉化為路由器,并實作防火牆、虛拟專用網絡伺服器、強制門戶網關等功能[4]。MikroTik也提供用于虛拟機和雲服務的RouterOS鏡像,其被稱為雲托管路由器(Cloud Hosted Router)。
網際網路基于對Mikrotik路由器的攻擊從未停止,基于路由安全考慮,需要對ros安全加強。
安全建議
在企業中使用,往往有在路由器上配置公網IP,并提供對外通路的接口,是以,為了安全起見:
1、禁止外網Ping路由器外網IP
2、修改管理者預設賬号(admin)
3、設定高強度管理者密碼
4、限制允許登入的IP網段
5、如有開啟8291端口,使用winbox服務,需要禁止使用mac位址登入winbox,并對外關閉8291
端口掃描
通過使用nmap掃描ros外網IP開放端口,其中open為開放服務:
PORT STATE SERVICE VERSION
25/tcp filtered http smtp
53/tcp open domain Mikrotik Routeros named or openDns Updater #dns端口,上網必要
80/tcp filtered
135/tcp filtered msrpc
137/tcp filtered netbios-ns
138/tcp filtered netbios-dgm
139/tcp filtered netbios-ssn
443/tcp filtered https
445/tcp filtered microsoft-ds
593/tcp filtered http-rpc-epmap
1723/tcp open pptp #pptp
2000/tcp open bandwidth-test krotik #帶寬測試用于測試MikroTik路由器的吞吐量,/tool bandwidth-server set enabled=no(測試時開啟即可)
4343/tcp open ss1/unical1? #TCP 端口 4343 使用傳輸控制協定
4444/tcp filtered krb524
8080/tcp filtered http-proxy
8291/tcp open http unknown #winbox通信協定端口,限制内網運維IP可以通路
安全加強設定
禁止外網Ping
設定Action為drop,Chain為input(内網設定為output),Protocol為icmp
關閉sstp pptp vpn服務
/interface pptp-server server set enabled=no
/interface sstp-server server set enabled=no
禁用Telnet,FTP,WWW,API,API-SSL
/ip service disable telnet,ftp,www,api,api-ssl
禁用通過mac位址使用winbox服務
/tool mac-server mac-winbox set allowed-interface-list=none
禁止SSH登入,隻有在allow-addresses清單的IP才允許SSH登入,其它一概禁止
/ ip firewall filter
add chain=input protocol=tcp dst-port=21-22src-address-list=!allow-addressescomment="SSH &FTP"disabled=no
action=drop
定義allow_login IP位址
General
Chain:input
Protocol:TCP
DST Prot:8291
Advanced:
src address list:!allow_login (表示非allow_login清單位址)
action:
action:drop(動作拒絕)
log: 勾選log (自定義log prefix名稱)
參考:
https://wiki.mikrotik.com/wiki/Manual:Securing_Your_Router
https://zh.wikipedia.org/zh-hans/MikroTik
https://www.sklinux.com/posts/secrity/mikrotik%E8%B7%AF%E7%94%B1%E5%AE%89%E5%85%A8%E9%98%B2%E8%8C%83%E8%AE%BE%E7%BD%AE/