RouterOS封禁模块
wget https://raw.githubusercontent.com/SecAegis/SecAutoBan/main/device/block/router_os/router_os.pypip3 install SecAutoBan RouterOS-api登录RouterOS管理后台,开启IP-Services-api
导航至:IP-Firewall-Address Lists。添加一条Address,其中Name为sec_auto_ban,IP填写一个不存在的即可。
导航至:IP-Firewall-Filter Rules添加两条规则,分别丢弃来源和目的IP是Address Lists中的IP。
丢弃来源IP:
丢弃目的IP:
server_ip=127.0.0.1 server_port=80 sk=sk-xxx ros_host=10.0.0.1 ros_port=8728 ros_username=admin ros_password=xxx ros_plaintext_login=true ros_list_name=sec_auto_ban python3 router_os.py| 变量名 | 样例 | 描述 |
|---|---|---|
| server_ip | 127.0.0.1 | 平台IP |
| server_port | 80 | 平台端口 |
| sk | sk-xxx | 连接密钥 |
| ros_host | 10.0.0.1 | 与RouterOS连接的IP |
| ros_port | 8728 | 默认端口8728,如自定义请修改 |
| ros_username | admin | RouterOS用户名 |
| ros_password | xxx | RouterOS密码 |
| ros_plaintext_login | true | 适用于 RouterOS 6.43 及更高版本 |
| ros_list_name | sec_auto_ban | 与Address Lists name保持一致,正常情况无需修改 |




