首页 > 其他分享 >SNRS Day 3 (Layer 2 Security & IOS IPS)

SNRS Day 3 (Layer 2 Security & IOS IPS)

时间:2024-08-18 20:16:33浏览次数:6  
标签:Layer IPS ip vlan IOS ips mac dhcp config

缓解二层攻击

二层攻击类型

cam表溢出

mac地址欺骗

arp欺骗

dhcp饿死

交换机工作原理

pc1和pc2要通信,pc1需要pc2个mac地址,开始没有mac地址,就会发送arp的请求,如果pc2的ip地址是2,它会询问2的mac地址是多少,这个包发送到交换机,首先交换机会记录下pc1的源mac地址,由于是一个arp的广播请求,交换机会把这个包广播到所有接口,当pc2收到这个包,就会发送一个单播回复pc1,这个包到达交换机,交换机会记录下这个pc2的mac地址,这个表项就是mac地址表.

cam表溢出解决方法

端口安全

switch(config-if)#switchport port-security

switch(config-if)#switchport prot-secuirty [mac_addr]

switch(config-if)#switchport prot-secuirty maximum (1-132)

switch(config-if)#switchport prot-security violation shutdown [protect | restrict | shtudown]

shutdown:触犯行为会shutdown接口,

protect:触犯行为端口状态不做更改,但是后续的包会drop掉,

restrict:触犯行为端口状态不做更改,但是后续的包会drop掉,会产生告警.

shutdown行为恢复方式

1.手工在接口shutdown no shutdown.

2.自动errdisable recovery cause psecure-violation.修改时间errdisable recovery interval 5(默认是5分钟恢复接口)

mac地址欺骗

pc3发送一个arp包,源mac地址是b,交换机就会从pc3的接口学到b,就会把原来pc2的mac地址b冲掉,当pc1发送去往pc2的数据,交换机查询mac地址表就会把包交给pc3.

解决方法还是端口安全

catos配置端口安全

switch>(enable)

set prot security <mod/port> enable [mac_addr]

switch>(enable)

set port security <mod/port>mac_addr

switch>(enable)

set port security <mod/port> violation [shutdown | restrict]

cisco ios

switch(config-if)#

prot security max-mac-count {1-132}

switch(config-if)#

port security action {shutdown | trap}

switch(config-if)#

arp timeout seconds

switchport port-security mac-address sticky(动态学习mac并且写到配置里面)

arp 欺骗

pc1和pc2通信,pc1不知道pc2的mac地址会发送一个arp的广播,所有接口都能收到,pc3的地址是3,pc1询问的是2的mac地址,pc2就会给pc1回复,pc1就会有一个ip和mac的对应arp表,pc3回应也回应一个2的mac地址是c给pc1,这个回应要晚于pc2的回应,当pc1又收到一次arp的回应,告诉他2的mac是c,它就会把当前的对应冲掉,这也就是arp欺骗.

dhcp饿死

一个pc接入网络设置成dhcp client,就会广播寻找dhcp server,当server收到请求就会回应,攻击者不断的发送dhcp请求,使用mac地址欺骗获得更多ip地址,直到dhcp服务器所分配的ip地址池分配完,其他正常的pc再来请求ip地址就分配不到ip地址,然后伪装一个非法的dhcp server,然后分配ip地址给其他pc地址,攻击其他pc.

解决方法dhcp snooping

swithc(config)#

ip dhcp snooping(开启dhcp snooping)

swithc(config)#

ip dhcp snoping vlan vlan_id {vlan_id}(基于某个vlan启动dhcp snoopin)

swithc(config-if)#

ip dhcp snooping trust(设置dhcp信任接口)

swithc(config-if)#

ip dhcp snooping limit rate rate(限制接口下dhcp请求包的速率)

cisco identity-based networking services 基于身份的网络服务

802.1x

二层的认证技术

802.1x认证支持

mac地址认证

默认授权策略

多组dhcp池

802.1x两种方式

point-to-point

wireless lan(无线)

supplicant(认证客户端)

authenticator(中间设备路由器)

authentication server(aaa服务器)

eap扩展认证协议

eap over wired(有线) or wireless(无线)

802.1x工作

当一个用户接入到网络(eap over wired),eap就开始工作了,要求客户端提供相应的信息如用户名密码,客户端通过eap over wired把用户名密码发送到交换机,交换机把包发送给radius服务器.radius服务器根据客户端提供的信息用户名和密码决定客户端的认证是否成功,如果有授权一并通过eap over wired发送给交换机,交换机根据这个结果给予客户端什么样服务,根据授权信息作出相应动作.

eap

eap扩展认证协议

ppp的扩展规定额外认证

一个灵活协议使用支持任意认证信息

通常加另一个协议802.1x或者radius及tacacs+等待

支持多种认证类型

eap-md5:简单密码hash(chap over eap)

eap-tals(based on x.509 certificates)

leap(eap-cisco wireless)

peap(protected eap)

cisco leap专门用于无线

eap-tls传输层安全,使用了pki的证书,client和server都使用相应证书来做认证,

peap仅仅server需要证书,用于无线.

有线802.1x配置

实验:

switch:

aaa new-model

aaa authentication login FOR_CON line none

line con 0

login authen FOR_CON

line vty 0 4

login authen FOR_CON

radius-server host 170.1.1.241 key cisco

int vlan 1

ip add 170.1.1.11 255.255.255.0

no sh

test aaa group radius test802 cisco new-code

aaa authentication dot1x default group radius

dot1x system-auth-control(全局打开802.1x)

int f0/18(认证接口)

sw mode access

dot1x port-control auto(force-authorized不需要认证接口就是authorized,force-unauthorized不需要认证就是unauthorized)

show dot1x all

int f0/18

dot1x reauthentication (认证成功过段时间重认证)

dot1x host-mode(设置接口接单个pc还是多个)

dot1x timeout re-authperiod seconds(重认证的时间)

dot1x re-authenticate interface f0/18(手工重认证)

int f0/18

dot1x reauthentication

aaa authorizaiton network default group radius(网络授权划分vlan)

vlan 10

name office

vlan 11

name market

int f0/1

sw mode access

sw access vlan 10

dto1x re-authenticate interface f0/18(让f0/18重新认证)

acs设置在group里面064设置为vlan,065设置为802,在081设置为vlan name.

int f0/18

dot1x guest-vlan 11(认证不成功划分到guest vlan)

catalyst os端口安全

switch>

set port security mode/port enable [mac_addr]

switch>

set port security md/port mac_addr

switch>

set port security mod/port violation [shutdown | restrict]

cisco ios端口安全

switch(config-if)#

switchport port-security maximum value

switch(config-if)#

switchport port-security violation [protect | restrict | shutdown]

switch(config-if)#

arp timeout seconds

cisco ios dhcp snooping

switch(config)#

ip dhcp snooping

switch(config)#

ip dhcp snooping vlan vlan_id(vlan_id)

switch(config-if)#

ip dhcp snooping trust

动态arp 监控

switch(config)#

ip arp inspection vlan vlan_id(vlan_id)

swich(config)#

ip arp inspection validate [src-mac] [dst-mac] [ip]

switch(config-if)#

ip arp inspection trust

二层安全建议

网管使用安全协议,避免明文,比如说telnet snmp version 1把telnet换成ssh,把snmp的版本1换成版本3,使用列表限制管理主机,启用端口安全启用dhcp snooping,trunk接口只允许特定的vlan,vlan 1不要用.

把所有接口设置为不协商trunk模式,部署端口安全到所有接口,对arp的安全性有一定计划,使用vacl来组织一些dhcp的包或者dhcp snooping,限制dhcp包的速率,开启生成树协议攻击(bpdu guard,root guard),使用pvlan应用2层网络,在边境设备禁用cdp.

禁用所有未被使用的接口把它划分到未被使用的vlan,使用acl防止ip包转发,设置vtp的密码,启用二层安全技术802.1x.

cisco ios ips

内存使用和性能影响

更新signature coverage

signature分类

info 检测扫描工具

attack 检测一些dos访问攻击

atomic 对于单个包就可以分析是否是一个攻击

compound 多个包才能分析出来是否是一个攻击

response 选项

alarm 发告警到vms,syslog server,buffer转发这个包.

reset 发送数据包和会话参与者都重置如果是tcp包转发

drop drop数据包

配置

安装cisco ios ips到路由器

定义signature definition file文件地方

建立ips rule

对于signature的调整

应用ips rule到接口

配置logging 发送到哪里

验证配置

router(config)#ip ips sdf location disk2:attack-drop.sdf(指明sdf文件)

router(config)#ip ips name myips

router(config)#ip ips signature 1000 disable(关闭1000signature)

router(config-if)#ip ips myips in(接口调用ips)

router(config)#ip ips notify sdee

router(config)#ip ips notify log

router(config)#ip ips fail closed(当ips没有初始化好signature所有包是drop的)

router#show ip ips-configuration

router#show ip ips signatures [detailed]

router#show ip ips interface

router#clear ip ips configuration

router#clear ip ips statistics

router#clear ip sdee {events | subscriptions}

ios_ips:

ip ips sdf builtin(不定义使用内建)

ip ips name ips(后面可以跟list满足列表去查ips)

ip ips signature 1000 disable

int e0/0

ip ips ips in

ip add 56.1.1.5 255.255.255.0

no sh

switch:

int range f0/15 , f0/16

sw mo access

spanning-tree portfast

sw access vlan 56

security device event exchange protocol(sdee)事件查看器

ip ips notify log(默认发送到log服务器,可以改为sdee)

标签:Layer,IPS,ip,vlan,IOS,ips,mac,dhcp,config
From: https://www.cnblogs.com/smoke520/p/18366026

相关文章

  • SNRS Day 4-2 (IOS IDS)
    iosidstopology:同上技术特点:iosids是一个在线式(in-line)的入侵检测sensor,对于所有穿越router的包,都一一扫描看是否match其中任何一个signature.当发现可疑的行为,可以采取以下的行动:1.alarm:发告警到syslog服务器或ciscosecureidsdirector2.drop:drop掉这个包3......
  • OI-tips 离散化
    离散化离散化,一个很简单却很常用的小技巧。引入给你\(n\)个数,输出每种数出现的个数,满足\(n\le10^6\),\(a_i\le2\times10^9\)。是不是看上去很简单,直接开一个数组记录个数不就行了。不过值域的范围是\(2\times10^9\),显然正常开数组的话我们是开不下的,而发现\(n\)是......
  • 026、Vue3+TypeScript基础,使用async和await来异步读取axios的网络图片
    01、App.vue代码如下:<template><divclass="app"><h2>App.Vue</h2><Person/></div></template><scriptlang="ts"setupname="App">//JS或TSimportPersonfrom'./......
  • Configuring the Cisco IOS XE DHCP Relay Agent
    CiscoroutersrunningCiscoIOSXEsoftwareincludeDynamicHostConfigurationProtocol(DHCP)serverandrelayagentsoftware.ADHCPrelayagentisanyhostthatforwardsDHCPpacketsbetweenclientsandservers.Thismoduledescribestheconceptsandt......
  • Axios
    1.Axios1.1异步请求发展史1.1.1传统的Ajax传统的Ajax请求是基于XMLHttpRequest(XHR)对象。可以直接使用。但 是使用起来配置较为麻烦,实际开发中使用非常少,在MVC时代通常使用的 是JQuery-Ajax。相对于传统的Ajax现在使用更多的是Fetch请求。1.1.2JQuery-AjaxJQuery-Ajax在前......
  • 「OC」探索CALayer:基础知识与实用技巧简要介绍
    「OC」探索CALayer:基础知识与实用技巧简要介绍文章目录「OC」探索CALayer:基础知识与实用技巧简要介绍前言认识CALayerCALayer的相关属性UIView和CALayer区别联系创建UIView和CALayer的原因开始创建CALayer视图层级CALayers和Sublayersposition与anchorPoint(锚点)CGIm......
  • Vue3环境中xgplayer实现监控视频播放
    EasyPlayer.vue<template> <div> <divclass="easy-player"> <divclass="ant-modal-mask"></div> <divclass="modal-content"> <divclass="box-title":title="prop......
  • 适配iOS18 Widget Extension控制中心新功能:ControlWidgetToggle和ControlWidgetButton
    热烈欢迎,请直接点击!!!进入博主AppStore主页,下载使用各个作品!!!注:博主将坚持每月上线一个新app!!支持原创,博客园原文链接:https://www.cnblogs.com/strengthen/p/18362397文末可以有demo下载。首先查看WWDC2024的官方视频:WWDC2024将App控件扩展到系统级别:https://developer.apple......
  • 企业微信调用扫一扫接口安卓手机正常,iOS失败的解决办法
    ​1.在使用企业微信自建应用调用扫一扫接口的时候,安卓手机调用摄像头、扫码结果都可以正常使用,但是苹果手机的摄像头都调用不了,将返回参数打印出来也都是成功的。一直以为是代码哪里有错,才出现系统不兼容的问题,网上也找了好多解决方案,都没有效果,后来才找到问题所在。​​2.这......
  • Axios请求使用params参数导致后端获取数据嵌套
    问题重述:首先看前端的axios请求这里我使用params参数将data数据传给后端letdata=JSON.stringify(this.posts);axios.post("/blog_war_exploded/insertPost",{params:{data:data......