Yuri Slobodyanyuk Blog on Information Security 2024年09月12日
Prevent brute force attack on VTY in Cisco IOS
index_new5.html
../../../zaker_core/zaker_tpl_static/wap/tpl_guoji1.html

 

Cisco IOS 12.3引入多种功能加强远程访问安全,包括配置ACL限制访问、设置登录失败后的多种防护措施等。

🎯配置ACL包含允许通过VTY访问路由器的管理IP。可选择仅允许ssh协议的VTY访问,并将ACL应用于VTY。还可指定一个VTY线路供特殊远程访问IP使用,以防所有VTY线路被占用。

🚫在50秒内5次登录失败后,300秒内阻止登录,并在该事件发生时应用特定ACL到VTY线路,以豁免管理IP被阻止。时间块过期后,该ACL从VTY中移除,之前的ACL重新应用。

📈设置登录失败的日志记录速率限制,以防止日志被失败尝试信息填满。同时设置登录尝试的延迟时间,延迟时间以秒为单位。

Cisco starting IOS 12.3 introduced a simple but powerful feature to guard against brute force password guessing attack on remote access. The usual template followed when configuring VTY access is:

    Configure ACL containing management IPs to be allowed to access the router through VTY

    (Optional) Restrict VTY access protocol to ssh only (transport input ssh)

    Apply this ACl to VTY : (config-line)# access-class <ACL> inn

    (Optional) Single out one VTY line for a special remote access IP to be used if all VTY lines are currently in use: (config)# line vty 4

Now I enhanced this template with the following features:- Blocks login for 300 seconds after 5 failed logins within  50 seconds time intervallogin block-for 300 attempts 5 within 50
- apply specified ACl to VTY line when above event occurs, it is meant to exempt your managemnt IP form being blocked. After timed block expires this ACL gets removed from VTY and previous ACL that was applied before the event is reapplied back

login quiet-mode access-class anti-DOS

ip access-list standard anti-DOSpermit 193.193.193.33 remark Deny VTY access to anyone else if brute-force logins take up all VTY lines

The delay login above is in seconds.
Then in logs you will see the following failed attempts:

*May  2 02:04:14.105: %SEC_LOGIN-4-LOGIN_FAILED: Login failed [user: ] [Source: 62.141.52.141] [localport: 22] [Reason: Login Authentication Failed] at 05:04:14  Sat May 2 2009*May  2 02:04:22.112: %SEC_LOGIN-1-QUIET_MODE_ON: Still timeleft for watching failures is 22 secs, [user: ] [Source: 62.141.52.141] [localport: 22] [Reason: Login Authentication Failed] [ACL: anti-DOS] at 05:04:22  Sat May 2 2009*May  2 02:09:22.091: %SEC_LOGIN-5-QUIET_MODE_OFF: Quiet Mode is OFF, because block period timed out at 05:09:22  Sat May 2 2009

Follow me on https://www.linkedin.com/in/yurislobodyanyuk/ not to miss what I publish on Linkedin, Github, blog, and more.

Fish AI Reader

Fish AI Reader

AI辅助创作,多种专业模板,深度分析,高质量内容生成。从观点提取到深度思考,FishAI为您提供全方位的创作支持。新版本引入自定义参数,让您的创作更加个性化和精准。

FishAI

FishAI

鱼阅,AI 时代的下一个智能信息助手,助你摆脱信息焦虑

联系邮箱 441953276@qq.com

相关标签

Cisco IOS 12.3 远程访问安全 登录防护 ACL
相关文章