zoukankan      html  css  js  c++  java
  • Cobalt Strike系列教程第七章:提权与横向移动

     

    Cobalt Strike系列教程分享如约而至,新关注的小伙伴可以先回顾一下前面的内容:

     

    Cobalt Strike系列教程第一章:简介与安装

    Cobalt Strike系列教程第二章:Beacon详解

    Cobalt Strike系列教程第三章:菜单栏与视图

    Cobalt Strike系列教程第四章:文件/进程管理与键盘记录

    Cobalt Strike系列教程第五章:截图与浏览器代理

    Cobalt Strike系列教程第六章:安装扩展

    今天我们将继续分享Cobalt Strike系列教程的其他章节内容,希望对大家的学习有所帮助,快速提升实用技能。

    提权

    1、右键菜单提权

    选择beacon,右键,执行-->提权。

     

    笔者由于加载了插件,所以比官方多了几种提权方式。

     

    ms14-058/ms15-051/ms16-016/ms16-032

    这些都是大家耳熟能详的Windows本地提权漏洞,在此插件中都已经集成。

    UAC-DLL

    这是一种绕过UAC的攻击,它试图将本地管理员运行的有效负载从低权限提升到高权限。此攻击使用UAC漏洞将ArtifactKit生成的DLL复制到特权位置。此攻击适用于Windows7和Windows8及更高版本的未修补版本。

    uac-token-duplication

    这是另一种绕过UAC的攻击,将其从低权限提升到高权限(作为本地管理员)。这种攻击使用一个UAC漏洞,允许非提升进程使用从提升进程中窃取的token启动任意进程。此漏洞要求攻击删除分配给提升token的多个权限。此攻击适用于Windows7及更高版本。如果AlwaysNotify处于其最高设置,则此攻击要求提升的进程已在当前桌面会话中运行(作为同一用户),此漏洞使用PowerShell生成会话。

    Uac-eventvwr

    这种提权方法是利用时间查看器eventvwr,通过注册表之后,执行Eventvwr.exe会自动加载我们的A.exe(exp),这个时候它的权限就是高了,成功绕过UAV。

     

    Uac-wscript

    这种绕过uac提权的方法最初是在Empire框架中现身的,该方法只针对Windows7有效。

     

    2、自用EXP提权

    这种方式就是比较常规的方法,自己上传最新的EXP进行提权,至于文件上传和执行的方法,之前已经讲过,请查看公众号相关文章。


    最近测试CVE-2019-0803的提权效果不错,影响版本非常广。

    Microsoft Windows Server 2019 0
    Microsoft Windows Server 2016 0
    Microsoft Windows Server 2012 R2 0
    Microsoft Windows Server 2012 0
    Microsoft Windows Server 2008 R2 for x64-based Systems SP1
    Microsoft Windows Server 2008 R2 for Itanium-based Systems SP1
    Microsoft Windows Server 2008 for x64-based Systems SP2
    Microsoft Windows Server 2008 for Itanium-based Systems SP2
    Microsoft Windows Server 2008 for 32-bit Systems SP2
    Microsoft Windows Server 1803 0
    Microsoft Windows Server 1709 0
    Microsoft Windows RT 8.1
    Microsoft Windows 8.1 for x64-based Systems 0
    Microsoft Windows 8.1 for 32-bit Systems 0
    Microsoft Windows 7 for x64-based Systems SP1
    Microsoft Windows 7 for 32-bit Systems SP1
    Microsoft Windows 10 Version 1809 for x64-based Systems 0
    Microsoft Windows 10 Version 1809 for ARM64-based Systems 0
    Microsoft Windows 10 Version 1809 for 32-bit Systems 0
    Microsoft Windows 10 Version 1803 for x64-based Systems 0
    Microsoft Windows 10 Version 1803 for ARM64-based Systems 0
    Microsoft Windows 10 Version 1803 for 32-bit Systems 0
    Microsoft Windows 10 version 1709 for x64-based Systems 0
    Microsoft Windows 10 Version 1709 for ARM64-based Systems 0
    Microsoft Windows 10 version 1709 for 32-bit Systems 0
    Microsoft Windows 10 version 1703 for x64-based Systems 0
    Microsoft Windows 10 version 1703 for 32-bit Systems 0
    Microsoft Windows 10 Version 1607 for x64-based Systems 0
    Microsoft Windows 10 Version 1607 for 32-bit Systems 0
    Microsoft Windows 10 for x64-based Systems 0
    Microsoft Windows 10 for 32-bit Systems 0

    用法:CVE-2019-0803.exe cmd cmdline,可能需要多执行几次才可以成功。

     


    3、Powershell提权

    在此需要使用beacon中的命令-powershell-import。

    beacon> help powershell-import
    Use: powershell-import [/path/to/local/script.ps1]
    
    Import a powershell script which is combined with future
    calls to the powershell command. You may only use one
    imported script at a time.

    使用 powershell-import 本地导入我们的脚本。

    powershell执行,PowerUp.ps1 这个模块是个提权辅助模块。


    下载链接:https://github.com/HarmJ0y/PowerUp

    横向移动

    1、横向渗透概念

    横向渗透攻击技术是复杂网络攻击中广泛使用的一种技术,特别是在高级持续威胁(Advanced Persistent Threats,APT)中更加热衷于使用这种攻击方法。攻击者可以利用这些技术,以被攻陷的系统为跳板,访问其他主机,获取包括邮箱、共享文件夹或者凭证信息在内的敏感资源。

    攻击者可以利用这些敏感信息,进一步控制其他系统、提升权限或窃取更多有价值的凭证。借助此类攻击,攻击者最终可能获取域控的访问权限,完全控制基于Windows系统的基础设施或与业务相关的关键账户。

    在提权后,我们可以用mimikatz dump目标机的凭证,并进行内网横向移动。

     

    2、P**ec横向移动

    在执行端口扫描后,目标视图中,选择一个目标,右键-->登录--p**ec,即可选择凭证进行横向移动。

     

     

    如果该机使用了和之前的目标机一样的凭证,则会成功返回一个system beacon。

     

     

    3、窃取token

    在进程列表中,寻找以域管理员身份运行的进程,并选定进行steal token,如果成功,则会返回域管权限的beacon。

     

     

    4、其他手段横向移动

    ①使用各种系统漏洞:比如说用ms17-010,ms08-067批量检测一下内网。

    之前发过cobaltstrike中ms17-10的利用脚本,貌似是从Empire框架上拔下来的。如图,该脚本集成了扫描与漏洞利用,可谓是非常方便。

    ②弱口令检测

    内网中ssh弱口令,各种数据库的弱口令可谓是层出不穷。Mysql可以mof提权,sqlserver可以xp_cmdshell,redis写shell,oracle也有方法执行系统命令。

    ③中间件漏洞

    这个就非常常见了,比如weblogic各种rce漏洞等等。

    ④Web端漏洞

    挖掘Web端漏洞。

    以上是今天的内容,大家看懂了吗?后面我们将持续更新Cobalt Strike系列的知识点,希望大家及时关注。

  • 相关阅读:
    c# 暴力破解中文编码方式
    vs调试 不能进入断点
    shell-的bash内部命令变量介绍与shift等
    shell-的特殊变量-难点理论
    shell-的特殊变量-进程状态变量$$ $! $? $_详解
    shell-的特殊变量-位置变量$0 $n $* $# $@详解
    shell-的变量-局部变量
    shell-的变量-全局变量
    shell-脚本开发基本规范及习惯
    shell-脚本的执行
  • 原文地址:https://www.cnblogs.com/ichunqiu/p/12134247.html
Copyright © 2011-2022 走看看