<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[静怡家园]]></title> 
<link>http://www.zhanghaijun.com/index.php</link> 
<description><![CDATA[书山有路勤为径，学海无涯苦作舟！]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[静怡家园]]></copyright>
<item>
<link>http://www.zhanghaijun.com/post//</link>
<title><![CDATA[linux下arp攻击的解决方案]]></title> 
<author>碟舞飞扬 &lt;webmaster@zhanghaijun.com&gt;</author>
<category><![CDATA[Linux技术]]></category>
<pubDate>Wed, 05 Jan 2011 02:08:21 +0000</pubDate> 
<guid>http://www.zhanghaijun.com/post//</guid> 
<description>
<![CDATA[ 
	准备工作：<br/>所需软件：Libnet&nbsp;&nbsp; 官方网站：http://libnet.sourceforge.net/<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 下载地址：http://sourceforge.net/project/showfiles.php?group_id=4223<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; arpoison官方网站：http://www.arpoison.net/ <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 下载地址：http://www.arpoison.net/arpoison-0.6.tar.gz<br/>安装方法(FC下成功,其他发行版可参考)：<br/>先安装libnet<br/>tar -xvzf libnet.tar.gz<br/>cd libnet<br/>./configure<br/>make<br/>make install<br/>安装arpoison<br/>tar -xvzf arpoison-0.6.tar.gz<br/>cd arpoison<br/>gcc arpoison.c /usr/lib/libnet.a -o arpoison <br/>mv arpoison /usr/sbin<br/><br/>用法: <br/>Usage: -i device -d dest_IP -s src_IP -t target_MAC -r src_MAC [-a] [-w time between packets] [-n number to send]<br/>示例：arpoison -i eth0 -d 172.16.18.254 -s 172.16.18.19 -t ff:ff:ff:ff:ff:ff -r 00:11:09:E8:78:DD&nbsp;&nbsp;<br/><br/>-i eth0 指定发送arp包的网卡接口eth0 <br/>-d 172.16.18.254 指定目的ip为172.16.18.254 <br/>-s 172.16.18.19&nbsp;&nbsp;指定源ip为172.16.18.19 <br/>-t ff:ff:ff:ff:ff:ff 指定目的mac地址为ff:ff:ff:ff:ff:ff(arp广播地址) <br/>-r 00:11:09:E8:C8:ED&nbsp;&nbsp;指定源mac地址为00:11:09:E8:C8:ED<br/><br/>wireshark截图如下： <br/><a href="http://www.zhanghaijun.com/attachment/month_1101/y20111510726.png" target="_blank"><img src="http://www.zhanghaijun.com/attachment/month_1101/y20111510726.png" class="insertimage" alt="点击在新窗口中浏览此图片" title="点击在新窗口中浏览此图片" border="0"/></a><br/><br/>写了一个小脚本，根据注释，相信聪明智慧的各位可以搞定linux下的arp攻击了：<br/><div class="code"><br/>#!bash<br/>#arpDefend.sh<br/>#######<br/>#yk103#<br/>#######<br/>#网关mac地址<br/>GATEWAY_MAC=00:D0:F8:FF:4A:23<br/>#目的mac地址<br/>DEST_MAC=ff:ff:ff:ff:ff:ff<br/>#目的ip地址<br/>DEST_IP=172.16.18.254<br/>#本地网卡接口<br/>INTERFACE=eth0<br/>#$INTERFACE的mac地址<br/>MY_MAC=00:11:09:E8:78:DD<br/>#$INTERFACE的ip地址<br/>MY_IP=172.16.18.19<br/>#在本机建立静态ip/mac入口 <br/>$DEST_IP--$GATEWAY_MAC <br/>arp -s $DEST_IP $GATEWAY_MAC <br/>#发送arp reply ,使$DEST_IP更新$MY_IP的mac地址为$MY_MAC<br/>arpoison -i $INTERFACE -d $DEST_IP -s $MY_IP -t $DEST_MAC -r $MY_MAC 1&gt;/dev/null &amp;<br/></div><br/>结束语：<br/>arpoison需要root权限运行<br/>arpoison需要libnet的支持<br/>arpoison很好的解决了arp攻击的问题<br/>Tags - <a href="http://www.zhanghaijun.com/tags/linux/" rel="tag">linux</a> , <a href="http://www.zhanghaijun.com/tags/arp/" rel="tag">arp</a>
]]>
</description>
</item><item>
<link>http://www.zhanghaijun.com/post//#blogcomment</link>
<title><![CDATA[[评论] linux下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.zhanghaijun.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>