freeBuf
主站

分类

漏洞 工具 极客 Web安全 系统安全 网络安全 无线安全 设备/客户端安全 数据安全 安全管理 企业安全 工控安全

特色

头条 人物志 活动 视频 观点 招聘 报告 资讯 区块链安全 标准与合规 容器安全 公开课

官方公众号企业安全新浪微博

FreeBuf.COM网络安全行业门户,每日发布专业的安全资讯、技术剖析。

FreeBuf+小程序

FreeBuf+小程序

CheeseTools:研究横向渗透和代码执行的工具
2021-06-07 17:28:44

关于CheeseTools

CheeseTools这个项目基于MiscTool项目创建,可以帮助广大研究人员实现横向渗透和代码执行。

CheeseExec

该工具基于类PsExec功能来实现命令执行和横向渗透,并且必须以特权用户的身份才能运行。该工具主要使用了rasta-mouse CsExec,但是可以允许广大研究人员针对特定的服务或场景创建额外的控制策略:

搜索目标服务是否存在,如果不存在则尝试创建它;

搜索目标服务是否存在或是否终止运行,如果停止运行则尝试启动它,如果不存在则尝试创建并启动它;

搜索目标服务是否存在或是否正在运行,如果是则尝试终止其运行;

搜索目标服务是否存在或是否正在运行,如果是则尝试终止其运行并删除该服务;

命令使用样例

CheeseExec.exe <targetMachine> <serviceName> <binPath> <action>

CheesePS

CheesePS是一个命令执行和横向渗透框架,该工组件依赖System.Management.Automation.PowerShell并通过PowerShell来加载和运行任意代码。该工具能够绕过目标主机创建的常见安全限制,并在目标主机上创建和使用PowerShell运行空间,但是此操作必须使用特权用户身份执行。

这个工具最初是作为rasta_mouse CsPosh的增强组件而开发的,但是它本身已经发展成为一个框架,现在可以作为一个通用的PowerShell注入器使用。

工具运行模式

下图显示的是该工具的精确运行模式,可以描述该工具的工作流:

工具下载

广大研究人员可以使用下列命令将该项目源码克隆至本地:

git clone https://github.com/klezVirus/CheeseTools.git

工具使用

Usage:

  -t, --target=VALUE         Target machine

  -c, --code=VALUE           Code to execute

  -e, --encoded              Indicates that provided code is base64 encoded

  -a, --am-si-bypass=VALUE   Uses the given PowerShell script to bypass A-M-S-

                               I (fs, smb o http[s])

      --aX, --encrypted-am-si

                             Indicates that provided A.M.S.I. bypass is

                               encrypted

  -i, --import=VALUE         Imports additional PowerShell modules (fs, smb o

                               http[s])

      --iX, --encrypted-imports

                             Indicates that provided PowerShell modules are

                               encrypted

  -o, --outstring            Append Out-String to code

  -r, --redirect             Redirect stderr to stdout

  -d, --domain=VALUE         Domain for alternate credentials

  -u, --username=VALUE       Username for alternate credentials

  -p, --password=VALUE       Password for alternate credentials

  -X, --encrypt=VALUE        Encrypt a script with an hardcoded key

  -D, --decrypt=VALUE        Test decryption of a script with an hardcoded key

  -n, --skip-bypass=VALUE    Skip A.M.S.I (A), WLDP (W) or ALL (*) Bypass

                               techniques

  -l, --lockdown-escape      Try to enable PowerShell FullLanguage mode using

                               REGINI

  -w, --wldp-bypass=VALUE    Uses the given PowerShell script to bypass WLDP

                               (fs, smb o http[s])

      --wX, --encrypted-wldp Indicates that provided WLDP bypass is encrypted

  -x, --executable=VALUE     [Download and] Execute given executable

      --xX, --encrypted-executable

                             Indicates that provided Exe/DLL is encrypted

      --xCS, --executable-csharp

                             Indicates that the executable provided is C# -

                               (.NET)

  -R, --reflective-injection Uses Invoke-ReflectivePEInjection to load the

                               assmebly from memory (requires Invoke-

                               ReflectivePEInjection to be imported!)

  -P, --powershell-decrypt   Force use of PowerShell-based decryption

  -k, --encryption-key=VALUE Uses the provided key for encryption/decryption

      --ssl                  Force use of SSL

  -h, -?, --help             Show Help

工具优势

跟原生PowerShell相比,该工具有下列显著优势:

更干净、更直观的命令行;

自动化绕过(CLM、AMSI、WLDP);

避免从远程目标执行出站连接(所有内容都通过WS-Management传输);

支持传输中的完全加密;

CheeseDCOM

CheeseDCOM组件可以通过DCOM实现命令执行或横向渗透,但必须以特权用户身份执行该任务。该工具基于rasta-mouse CsDCOM实现,但还添加了额外的方法。当前支持的方法有:MMC20.Application、ShellWindows、ShellBrowserWindow、ExcelDDE、VisioAddonEx、OutlookShellEx、ExcelXLL、VisioExecLine、OfficeMacro。

Usage:

  -t, --target=VALUE         Target Machine

  -b, --binary=VALUE         Binary: powershell.exe

  -a, --args=VALUE           Arguments: -enc <blah>

  -m, --method=VALUE         Methods: MMC20Application, ShellWindows,

                               ShellBrowserWindow, ExcelDDE, VisioAddonEx,

                               OutlookShellEx, ExcelXLL, VisioExecLine,

                               OfficeMacro

  -r, --reg, --registry      Enable registry manipulation

  -h, -?, --help             Show Help

CheeseRDP

该组件可以通过RDI(反射型DLL注入)实现RDP凭证企鹅去,但必须以特权用户身份执行该任务。该组件基于RdpThief实现,但使用了纯C#进行封装,因此可以通过.NET环境运行:

Usage:

    CheeseRDP [actions]

Actions:

    wait: keep listening*for any new mstsc.exe process indefinitely (stop with ctrl-C)

    clean: delete the credentials dump file if present

    dump: dump the content of the file if present, parsing the credentials in a compact format

项目地址

CheeseTools:GitHub传送门


# 横向渗透 # 代码执行
本文为 独立观点,未经允许不得转载,授权请联系FreeBuf客服小蜜蜂,微信:freebee2022
被以下专辑收录,发现更多精彩内容
+ 收入我的专辑
+ 加入我的收藏
相关推荐
  • 0 文章数
  • 0 关注者
文章目录