XenServer 查找 ARP 源

出现 ARP 攻击时,首先查找攻击源 mac:

tcpdump -i xenbr0 arp -n | grep "192.168.33.1" | grep is-at
# or
arping -I xenbr0 192.168.33.1

一般间歇性 ARP 攻击不会长时间发送 ARP reply,需要耐心等待异常 arp 包

mac 地址建议配合:http://mac.51240.com/ 确认

当找到 arp 攻击源 mac 时,可使用以下方式查找到对应 VM:

# brctl showmacs xenbr0
port no mac addr                is local?       ageing timer
 56     42:eb:xx:xx:xx:d8       no                 3.66
 56     42:eb:xx:xx:xx:ab       no                82.07
 56     42:eb:xx:xx:xx:26       no               219.04
 56     42:eb:xx:xx:xx:05       no                46.97

# * 根据 port 提取出所有可能的 mac 地址

查找 mac 地址对应网卡:

# yum install bridge-utils --enablerepo=base
...

# bridge fdb show
42:eb:xx:xx:xx:d8 dev vif4.0 master xenbr0
7e:07:xx:xx:xx:8f dev vif7.0 master xenbr0

# xe vif-list MAC=42:eb:xx:xx:xx:d8 params=vm-name-label
vm-name-label ( RO)    : vps123456

# or

# xe vm-list dom-id=4
uuid ( RO)           : 7dcf0000-0000-0000-0000-0000469f4615
     name-label ( RW): vps123456
    power-state ( RO): running

# or

# ps -ef | grep 42:eb:xx:xx:xx:d8 | grep -v grep
65590    30208     1  0 May19 ?        01:42:07 qemu-dm-4 --syslog -d 4 -m 4096 -boot dc -serial pty -vcpus 2 -videoram 4 -vncunused -vnc 127.0.0.1:1 -usb -usbdevice tablet -net nic,vlan=0,macaddr=42:eb:xx:xx:xx:d8,model=rtl8139 -net tap,vlan=0,bridge=xenbr0,ifname=tap4.0 -acpi -monitor null

文中 xenbr0 为 XenServer 自动创建,若公网为 eth0 则为 xenbr0,以此类推

可使用 brctl show 命令查看对应关系

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据