找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 7577|回复: 9

给饱受ARP欺骗病毒之苦的管理员一个解脱

[复制链接]
发表于 2008-3-18 13:03:29 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

×
基本原理:在各VLAN找台公用机运行ARP病毒“探针”,发现问题后自动把中毒机器的MAC地址写入服务器的共享目录;网管员机器利用脚本配合计划任务定时检查服务器的共享目录,如果发现有病毒记录则立刻在网管员机器弹出窗口报警。
    探针端程序arpvirus.bat如下:
@echo off
rem ping一次网关,使ARP缓存中有网关MAC记录
ping 192.168.108.254 -n 1
rem 网关MAC为00-0f-e2-45-8d-8D,根据你的实际修改
arp -a | find "00-0f-e2-45-8d-8D"

rem errorlevel为1表示未找到正确的网关MAC,即中毒
if errorlevel==1 goto bindarp
:end
exit

:bindarp
rem 中毒机器MAC暂时写入arpvirus.txt
arp -a | find ".254" >> arpvirus.txt

rem 清除假网关MAC,静态绑定正确的网关
arp -d
ipconfig /all>ipconfig.txt
for /f "tokens=13" %%I in ('find "Default Gateway" ipconfig.txt') do set GatewayIP=%%I
ping %GatewayIP% -n 1
arp -a|find "%GatewayIP%">arp.txt
for /f "tokens=1,2" %%I in ('find "%GatewayIP%" arp.txt') do if %%I==%GatewayIP% arp -s %%I %%J
for /f "tokens=15" %%i in ('find "IP Address" ipconfig.txt') do set ip=%%i
for /f "tokens=12" %%i in ('find "Physical Address" ipconfig.txt') do set mac=%%i
arp -s %ip% %mac%
del ipconfig.txt
del arp.txt

rem 把arpvirus.txt添加到\\server2\share\arpvirus.txt,用户名和密码都是aa
net use h: \\server2\share /user:aa "aa"
type arpvirus.txt >>h:arpvirus.txt
del arpvirus.txt
net use h: /d
exit
   探针端计划任务设置略,请注意要让任务每隔15分钟运行一遍。

    网管员端程序arpcheck.bat如下:
@echo off
rem 以指定用户和密码连接到服务器共享目录
net use j: \\server2\share /user:aa "aa"
rem 如果存在有arpvirus.txt表示有机器中毒,启动notepad.exe并打开
if exist j:arpvirus.txt start notepad.exe j:arpvirus.txt
rem 删除病毒记录
if exist j:arpvirus.txt del j:arpvirus.txt
net use j: /d
exit
    注:版权所有,欢迎转载,但要注明作者与出处。
routeros
 楼主| 发表于 2008-3-20 10:59:23 | 显示全部楼层
没人顶?让了这么久沙发就是没人坐?
其实这两段批处理结合计划任务还是很管用的,可以实现ARP欺骗第一时间报警.我也在用.
routeros
回复

使用道具 举报

发表于 2008-3-26 11:41:40 | 显示全部楼层
谢谢分享
routeros
回复

使用道具 举报

发表于 2008-3-26 15:59:29 | 显示全部楼层
网吧专用软件路由
MSS3.59VPN
软件种子下载
http://msspj.ys168.com
注册费用 150元/套
先注册后付款

大家可以下载试用一下,如果效果好就装,不好删除!

注册联系QQ:710062554 电话:13944151726
routeros
回复

使用道具 举报

发表于 2008-3-26 19:55:21 | 显示全部楼层
这么好的东西怎么没有人顶呢,我来了,顶啊,顶上天
routeros
回复

使用道具 举报

发表于 2008-4-5 14:54:58 | 显示全部楼层
疑问?(菜鸟疑问,请不要抛砖)

如果ARP表为
192.168.108.3               00-0f-e2-45-8d-8D (ip为内网某一IP)
192.168.108.254          xx-xx-xx-xx-xx-xx (MAC为非网关MAC)

你的方法行得通吗?
routeros
回复

使用道具 举报

 楼主| 发表于 2008-4-7 15:57:18 | 显示全部楼层
第一个ARP表项,理论上这段脚本确实是存在这样的漏洞.即随意冒充一个IP的MAC而不是网关的MAC.脚本将检测不到VLAN中存在ARP欺骗.但首先是病毒会不会这样做,因为冒充一个不是网关的IP,流量没有经过自己就无法进行密码破解.
第二个ARP表项,这段脚本默认是保护IP为:x.x.x.254的网关,如果中了ARP欺骗病毒,中毒机器会临时充当网关,这时VLAN中的机器还是可以访问真正的网关的,只不过中间加了一层,因此我的脚本检测到中毒后立刻用arp -d删除虚假网关MAC,然后绑定正确的网关MAC,然后再向服务器共享目录写入中毒信息.
这段脚本并不能保护VLAN中的各客户机,但如果把ARP欺骗的源头找出来了,客户机保护与否意义不大.

[ 本帖最后由 芝麻 于 2008-4-7 18:37 编辑 ]
routeros
回复

使用道具 举报

发表于 2008-5-7 01:48:05 | 显示全部楼层

这帖子有道理

但凡有道理地帖子,那是一定要顶的,呵呵




We provide cheap wow power leveling and wow leveling.Also buy eve isk and wow leveling from here.Get to wow leveling work now.
routeros
回复

使用道具 举报

发表于 2008-5-22 22:43:47 | 显示全部楼层
Windows IP Configuration



        Host Name . . . . . . . . . . . . : computer01

        Primary Dns Suffix  . . . . . . . :

        Node Type . . . . . . . . . . . . : Unknown

        IP Routing Enabled. . . . . . . . : No

        WINS Proxy Enabled. . . . . . . . : No

        DNS Suffix Search List. . . . . . : domain



Ethernet adapter 本地连接:



        Connection-specific DNS Suffix  . : domain

        Description . . . . . . . . . . . : Realtek RTL8139/810x Family Fast Ethernet NIC

        Physical Address. . . . . . . . . : 00-E0-FF-FF-1A-CD

        Dhcp Enabled. . . . . . . . . . . : Yes

        Autoconfiguration Enabled . . . . : Yes

        IP Address. . . . . . . . . . . . : 192.168.1.103

        Subnet Mask . . . . . . . . . . . : 255.255.255.0

        IP Address. . . . . . . . . . . . : fe81::2e0:ffff:feff:1acd%4

        Default Gateway . . . . . . . . . : 192.168.1.1

        DHCP Server . . . . . . . . . . . : 192.168.1.1

        DNS Servers . . . . . . . . . . . : 218.85.157.99

                                            192.168.1.1

                                            202.101.98.55

                                            fec0:0:0:ffff::1%1

                                            fec0:0:0:ffff::2%1

                                            fec0:0:0:ffff::3%1

        Lease Obtained. . . . . . . . . . : 2008年5月22日 22:42:42

        Lease Expires . . . . . . . . . . : 2008年5月23日 0:42:42



Tunnel adapter Teredo Tunneling Pseudo-Interface:



        Connection-specific DNS Suffix  . :

        Description . . . . . . . . . . . : Teredo Tunneling Pseudo-Interface

        Physical Address. . . . . . . . . : FF-FF-FF-FF-FF-FF-FF-FF

        Dhcp Enabled. . . . . . . . . . . : No

        IP Address. . . . . . . . . . . . : fe81::ffff:ffff:fffd%5

        Default Gateway . . . . . . . . . :

        NetBIOS over Tcpip. . . . . . . . : Disabled



Tunnel adapter Automatic Tunneling Pseudo-Interface:



        Connection-specific DNS Suffix  . : domain

        Description . . . . . . . . . . . : Automatic Tunneling Pseudo-Interface

        Physical Address. . . . . . . . . : C0-A8-01-67

        Dhcp Enabled. . . . . . . . . . . : No

        IP Address. . . . . . . . . . . . : fe81::5efe:192.168.1.103%2

        Default Gateway . . . . . . . . . :

        DNS Servers . . . . . . . . . . . : fec0:0:0:ffff::1%1

                                            fec0:0:0:ffff::2%1

                                            fec0:0:0:ffff::3%1

        NetBIOS over Tcpip. . . . . . . . : Disabled





这个好像有点问题是:这样的结果是有三个GatewayIP
routeros
回复

使用道具 举报

 楼主| 发表于 2008-5-27 16:14:04 | 显示全部楼层
回楼上的:把"探针"端多余的网卡禁用,另外注意:发现病毒并采取措施后要把"探针"端的ARP缓存清空(因为已经静态绑定了正确的网关地址),否则再出现ARP欺骗病毒就监测不了了.
routeros
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|小黑屋|软路由 ( 渝ICP备15001194号-1|渝公网安备 50011602500124号 )

GMT+8, 2024-4-30 02:51 , Processed in 0.059056 second(s), 7 queries , Gzip On, Redis On.

Powered by Discuz! X3.5 Licensed

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表