SharpStrike:基于C#实现的后渗透漏洞利用研究工具

VSole2021-09-18 17:18:22

关于SharpStrike

SharpStrike是一款基于C#开发的后渗透工具,该工具可以使用CIM或WMI来查询远程系统。除此之外,该工具还可以使用研究人员提供的凭证信息或使用当前的用户会话。

注意:SharpStrike中的某些命令将使用PowerShell结合WMI以实现其功能。

SharpStrike可以帮助广大研究人员收集关于目标远程系统的数据、执行命令以及提取数据等等。该工具允许使用WMI或CIM来跟远程系统进行连接,而CIM的使用则需要我们获取到目标系统的管理员权限。

解决方案架构

SharpStrike由三个主组件构成:

服务层:提供核心功能并由UI层使用(cs、ExecuteWMI.cs、ExecuteCIM.cs);

模型:包含整个项目所有共享的数据类型;

用户接口:GUI/命令行终端;

工具安装

我们可以选择直接使用该项目【Releases页面】所提供的预构建版本,不过这个版本是在调式模式下构建的。

手动构建

首先,我们需要使用下列命令将该项目源码克隆至本地:

git clone https://github.com/iomoath/SharpStrike.git

接下来,在Visual Studio中加载项目中的SharpStrike.sln文件。

选择顶部菜单中的“构建”项,然后构建解决方案。

此时将会生成两个版本的SharpStrike,即带有GUI界面的WinForms和命令行终端应用程序,每一个版本都实现的是相同的功能。

工具使用

命令行终端版本

SharpStrike.exe --help
SharpStrike.exe --show-commands
SharpStrike.exe --show-examples
SharpStrike.exe -c ls_domain_admins
SharpStrike.exe -c ls_domain_users_list
SharpStrike.exe -c cat -f "c:\users\user\desktop\file.txt" -s [remote IP address]
SharpStrike.exe -c cat -f "c:\users\user\desktop\file.txt" -s [remote IP address] -u [username] -d [domain] -p [password] -c
SharpStrike.exe -c command_exec -e "quser" -s [remote IP address] -u [username] -d [domain] -p [password]

GUI版本

show-commands
show-examples
ls_domain_admins
ls_domain_users_list
cat -f "c:\users\user\desktop\file.txt" -s [remote IP address]
cat -f "c:\users\user\desktop\file.txt" -s [remote IP address] -u [username] -d [domain] -p [password]
command_exec -e "quser" [remote IP address] -u [username] -d [domain] -p [password]

功能介绍

文件操作

cat                          -  Reads the contents of a file
copy                         -  Copies a file from one location to another
download**                   -  Download a file from the targeted machine
ls                           -  File/Directory listing of a specific directory
search                       -  Search for a file on a user
upload**                     -  Upload a file to the targeted machine

横向活动

command_exec**               -  Run a command line command and receive the output. Run with nops flag to disable PowerShell
disable_wdigest              -  Sets the registry value for UseLogonCredential to zero
enable_wdigest               -  Adds registry value UseLogonCredential
disable_winrm**              -  Disables WinRM on the targeted system
enable_winrm**               -  Enables WinRM on the targeted system
reg_mod                      -  Modify the registry on the targeted machine
reg_create                   -  Create the registry value on the targeted machine
reg_delete                   -  Delete the registry on the targeted machine
remote_posh**                -  Run a PowerShell script on a remote machine and receive the output
sched_job                    -  Not implimented due to the Win32_ScheduledJobs accessing an outdated API
service_mod                  -  Create, delete, or modify system services
ls_domain_users***           - List domain users
ls_domain_users_list***      - List domain users sAMAccountName
ls_domain_users_email***     - List domain users email address
ls_domain_groups***          - List domain user groups
ls_domain_admins***          - List domain admin users
ls_user_groups***            - List domain user with their associated groups
ls_computers***              - List computers on current domain

进程操作

process_kill                 -  Kill a process via name or process id on the targeted machine
process_start                -  Start a process on the targeted machine
ps                           -  Process listing

系统操作

active_users                 -  List domain users with active processes on the targeted system
basic_info                   -  Used to enumerate basic metadata about the targeted system
drive_list                   -  List local and network drives
share_list                   -  List network shares
ifconfig                     -  Receive IP info from NICs with active network connections
installed_programs           -  Receive a list of the installed programs on the targeted machine
logoff                       -  Log users off the targeted machine
reboot (or restart)          -  Reboot the targeted machine
power_off (or shutdown)      -  Power off the targeted machine
vacant_system                -  Determine if a user is away from the system
edr_query                    -  Query the local or remote system for EDR vendors

日志操作

logon_events                 -  Identify users that have logged onto a system


* All PowerShell can be disabled by using the --nops flag, although some commands will not execute (upload/download, enable/disable WinRM)
** Denotes PowerShell usage (either using a PowerShell Runspace or through Win32_Process::Create method)
*** Denotes LDAP usage - "root\directory\ldap" namespace

工具使用演示

GUI版本使用

命令行终端版本使用

【GIF】

项目地址

SharpStrike:【点击阅读原文获取】

参考资料

https://fortynorthsecurity.com/blog/cimplant-part-1-detections/

https://www.fireeye.com/blog/threat-research/2017/03/wmimplant_a_wmi_ba.html

https://c99.sh/sharpstrike-post-exploitation-tool-cim-wmi-inside/

domaindesktop
本作品采用《CC 协议》,转载必须注明作者和本文链接
域密码喷洒实现
2021-12-30 06:49:03
域密码喷洒实现
证书服务发布的部分证书可用于kerberos认证,并且可以再返回的PAC中获取NTMLhash。
金票可以使用krbtgt的NTLM hash创建作为任何用户的有效TGT。
DarkBit勒索软件分析
2023-05-15 09:10:03
json内容包括:文件大小限制:最小为25MB,最大为6GB,不同大小的文件被分成不同的部分,每个部分的大小也不相同。如 1000MB 到 4000MB 的大小的文件,被分为3部分,每部分大小不超过 10000 字节。DarkBit 会单独加密这些较小的部分中的每一个,而不是一次加密整个文件。文件扩展名限制:排除特定的文件扩展名。利用 Go_Parser 解析 runtime 库,把生成map文件导入到 x64dbg 检测处理器是否为
systeminfo | findstr /B /C:"OS Name" /C:"OS Version". systeminfo | findstr /B /C:"OS 名称" /C:"OS 版本" #中文操作系统。schtasks /query /fo LIST /v #query显示所有计划任务。
很早就想专门写一篇关于内网的文章,一直没有腾出空来,万万没想到,写下这篇文章的时候,竟然是我来某实验室实习的时间段:)
Detectionlab安装及使用
2022-04-14 14:39:16
雷神众测拥有对此文章的修改和解释权。如欲转载或传播此文章,必须保证此文章的完整性,包括版权声明等全部内容。未经雷神众测允许,不得任意修改或者增减此文章内容,不得以任何方式将其用于商业目的。
本机信息收集 查询网络配置信息 ipconfig /all 查询本机的服务信息 wmic service list brief
原理黄金票据的原理就是用krbtgt的hash来伪造TGT的内容。第四步主要是来验证客户端的身份。所谓的黄金票据其实就是kerberos认证的第二个阶段中的tgs的ticket也就是TGT。
VSole
网络安全专家