<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[BIWEB开源PHP WMS系统创始人ArthurXF肖飞的blog]]></title> 
<link>http://www.bizeway.net/index.php</link> 
<description><![CDATA[网务通 - 网务公司发展之路]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[BIWEB开源PHP WMS系统创始人ArthurXF肖飞的blog]]></copyright>
<item>
<link>http://www.bizeway.net/read.php?</link>
<title><![CDATA[跟着ArthurXF学FreeBSD42——解决ARP欺骗问题]]></title> 
<author>ArthurXF &lt;arthurxf@gmail.com&gt;</author>
<category><![CDATA[FreeBSD]]></category>
<pubDate>Fri, 28 Mar 2008 06:57:24 +0000</pubDate> 
<guid>http://www.bizeway.net/read.php?</guid> 
<description>
<![CDATA[ 
	最近手头上管理的服务器有一台机器被网段中的其他服务器搞了arp欺骗，在网页上挂了木马。让机房赶快修理，竟然搞了两天还没搞好，最后推卸责任说是我们自己服务器有漏洞造成的。强烈鄙视一下不负责任的人！<br />看来还是要自力更生才行。大家准备了啊。<br /><br />1.不安装软件的方法。<br />首先要重启，确保你拿到的网关地址是正确的。<br />步骤如下：<br />ifconfig<br />显示类似如下内容<br />bge0: flags=8843&lt;UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST&gt; mtu 1500<br />options=1b&lt;RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING&gt;<br />inet 192.168.0.5 netmask 0xffffffc0 broadcast 192.168.0.1<br />ether 00:17:08:2a:13:88<br />media: Ethernet autoselect (100baseTX &lt;full-duplex&gt;)<br />status: active<br />plip0: flags=108810&lt;POINTOPOINT,SIMPLEX,MULTICAST,NEEDSGIANT&gt; mtu 1500<br />lo0: flags=8049&lt;UP,LOOPBACK,RUNNING,MULTICAST&gt; mtu 16384<br />inet 127.0.0.1 netmask 0xff000000<br />我们把网关的信息存到一个文件里。<br />echo 192.168.0.1 00:17:08:2a:13:88 &gt; /etc/ipmac<br />接着使用crontab -e编辑系统定时排程（计划任务）让它按照设定时间循环执行<br />*/5 * * * * /usr/sbin/arp -f /etc/ipmac <br />这样就每5分钟更新一次网关MAC地址，保证正确。<br />注意：这里有一个隐患，那就是如果网关设备更换，也就是网关的MAC地址变了就会发生网络不通的现象了。因此就要去机房修改ipmac文件，将新网关MAC改进去，所以我的建议是，先备份ipmac，但是不要马上定时更新，而是等发现有ARP病毒了，再更新，等病毒消除了，就停止更新。确保网络连接正常。<br /><br />2.安装防ARP的保护软件<br />cd /usr/ports/security/ipguard/<br />make install<br />安装完之后会建立/etc/ethers文件来保护本机，抵御arp欺骗、攻击。<br />启动ipguard.<br />cd /usr/local/etc/rc.d<br />mv ipguard.sh.sample ipguard.sh<br />/usr/local/etc/rc.d/ipguard.sh start<br /><br /><br />ipguard用法详解<br />ipguard - tool designed to protect LAN IP adress space by ARP spoofing.<br /><br />ipguard listens network for ARP packets. All permitted MAC/IP pairs<br />listed in 'ethers' file. If it recieves one with MAC/IP pair, which is<br />not listed in 'ethers' file, it will send ARP reply with configured<br />fake address. This will prevent not permitted host to work properly in<br />this ethernet segment. Especially Windows(TM) hosts.<br /><br /><a href="http://www.freebsd.org/cgi/man.cgi?query=ipguard&amp;apropos=0&amp;sektion=0&amp;manpath=FreeBSD+7.0-RELEASE+and+Ports&amp;format=html#end"><strong><span style="color: #2771b3">EXAMPLES</span></strong></a><br />Normal method, duplex, autoupdate /etc/ethers every 5 min and send 2<br />fake replies:<br /><strong>ipguard</strong> <strong>-x</strong> <strong>-u</strong> <strong>300</strong> <strong>-n</strong> <strong>2</strong> <strong>fxp0</strong><br /><br />Read-only mode and remember last 100 not listed in `ethers' MACs. Use-<br />ful for initial MAC/IP pairs collect:<br /><strong>ipguard</strong> <strong>-r</strong> <strong>-b</strong> <strong>100</strong> <strong>-f</strong> <strong>./empty_file</strong> <strong>rl0</strong><br /><br />Do not go to background and be more verbose, with test ethers file:<br /><strong>ipguard</strong> <strong>-dv</strong> <strong>-f</strong> <strong>/tmp/ethers</strong> <strong>my1</strong><br /><br /><a href="http://www.freebsd.org/cgi/man.cgi?query=ipguard&amp;apropos=0&amp;sektion=0&amp;manpath=FreeBSD+7.0-RELEASE+and+Ports&amp;format=html#end"><strong><span style="color: #2771b3">TIPS</span></strong></a><br />You must have read permission on /dev/bpf* if you want to start ipguard<br />in read-only mode and read/write permission for full functional if<br />you're not root.<br /><br />First MAC/IP pair in list always taken from listening interface, so you<br />can't occasionally block yourself.<br /><br /><a href="http://www.freebsd.org/cgi/man.cgi?query=ipguard&amp;apropos=0&amp;sektion=0&amp;manpath=FreeBSD+7.0-RELEASE+and+Ports&amp;format=html#end"><strong><span style="color: #2771b3">BUGS</span></strong></a><br />ipguard will not prevent changing MAC address along with IP by client.<br /><br />Linux send weird ARP packet when enters net. ipguard did'nt handle it.<br /><br />Signals like HUP or TERM works only on new received arp packet.<br /><br />ArthurXF从业10年的CTO,受上海非凡学院邀请,进行PHP,CSS,FREEBSD等网络技能授课培训,有意向参加的,请联系QQ：29011218，MSN：onenight11@hotmail.com <br/>Tags - <a href="tag.php?tag=freebsd" rel="tag">freebsd</a> , <a href="tag.php?tag=arp" rel="tag">arp</a>
]]>
</description>
</item><item>
<link>http://www.bizeway.net/read.php?&amp;guid=0#topreply</link>
<title><![CDATA[[评论] 跟着ArthurXF学FreeBSD42——解决ARP欺骗问题]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://www.bizeway.net/read.php?&amp;guid=0#topreply</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>