前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >C2工具之RedPeanut(红花生)

C2工具之RedPeanut(红花生)

作者头像
鸿鹄实验室
发布2021-04-15 10:25:29
1.1K0
发布2021-04-15 10:25:29
举报
文章被收录于专栏:鸿鹄实验室鸿鹄实验室

工具介绍:

RedPeanut是在.Net Core 2中开发的小型RAT及其在.Net 3.5 / 4.0中的代理。RedPeanut代码执行基于DonutCS生成的shellcode 。因此,它是混合的,尽管它是在.Net中开发的,但它并不完全依赖Assembly.Load。

C2 Channel

隧道加载过程如下:

  • The stager requires an agent id, the message is encrypted with RC4 with the shared serverkey
  • The server decrypt the message, compile and sends the agent, generate and send KEY and IV for future communications AES encryption, the message is encrypted RC4
  • The stager decrypt the message and load the agent via Assembly.Load
  • The agent sends a checkin message to the server, the message is encrypted with AES

Profiles

配置c2的内容文件,包含以下内容:

  • General
    • Delay (between requests)
    • ContentUri (url of dynamic content eg. dll hta etc.)
    • UserAgent
    • Spawn (the process to create to perform critical tasks)
    • HtmlCovered (Enable covered channel)
    • TargetClass (Class to search for image recover)
  • Http Get
    • ApiPath (comma separated list of url es /news-list.jsp,/antani.php etc.)
    • Server
      • Prepend
      • Append
      • Headers (name and value pair for http headers)
    • Client
      • Headers
  • Http Post
    • ApiPath (comma separated list of url es /news-list.jsp,/antani.php etc.)
    • Param (the name of the post request payload parameter)
    • Mask (format for interpreting the key value pair eg {0}={1}) (need more work...)
    • Server
      • Prepend
      • Append
      • Headers (name and value pair for http headers)
    • Client
      • Headers

Domain Fronting

包含的功能:

  • GhostPack
  • SharpGPOAbuse
  • SharpCOM
  • EvilClippy
  • DotNetToJS
  • SharpWeb
  • Modified version of PsExec
  • SharpSploit
  • TikiTorch

PowerShellExecuter

PowerShellExecuter 模块可以允许我们自动bypass AMSI、Logging bypass 等

加载方式

  • Exe
  • Dll
  • PowerShell
  • Hta (vbs,powershell)
  • InstallUtil
  • MSBuild
  • MacroVba

本地模块

  • EvilClippy

客户端模块

  • Upload
  • DownLoad
  • SharpWeb
  • SharpWmi
  • SharpUp
  • UACBypass Token Duplication
  • SharpDPAPIVaults
  • SharpDPAPITriage
  • SharpDPAPIRdg
  • SharpDPAPIMasterKeys
  • SharpDPAPIMachineVaults
  • SharpDPAPIMachineTriage
  • SharpDPAPIMachineMasterKeys
  • SharpDPAPIMachineCredentials
  • SharpDPAPICredentials
  • SharpDPAPIBackupKey
  • Seatbelt
  • SafetyKatz
  • RubeusTriage
  • RubeusTgtDeleg
  • RubeusS4U
  • RubeusRenew
  • RubeusPurge
  • RubeusPtt
  • RubeusMonitor
  • RubeusKlist
  • RubeusKerberoast
  • RubeusHash
  • RubeusHarvest
  • RubeusDump
  • RubeusDescribe
  • RubeusCreateNetOnly
  • RubeusChangePw
  • RubeusASREPRoast
  • RubeusAskTgt
  • SharpCOM
  • SharpGPOAddUserRights
  • SharpGPOAddStartupScript
  • SharpGPOAddLocalAdmin
  • SharpGPOAddImmediateTask
  • PowerShellExecuter
  • LatteralMSBuild
  • SharpPsExec
  • SharpAdidnsdump
  • PPIDAgent
  • SpawnAsAgent
  • SpawnShellcode
  • SpawnAsShellcode
  • SharpMiniDump

权限维持

  • Autorun
  • Startup
  • WMI
  • CRL

除此之外,还包含BlockDlls、Direct Sysstem Call and Dynamic Dll Loading等功能。

工具安装

linux下面执行如下命令:

代码语言:javascript
复制
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.asc.gpg
mv microsoft.asc.gpg /etc/apt/trusted.gpg.d/
wget -q https://packages.microsoft.com/config/debian/9/prod.list
mv prod.list /etc/apt/sources.list.d/microsoft-prod.list
chown root:root /etc/apt/trusted.gpg.d/microsoft.asc.gpg
chown root:root /etc/apt/sources.list.d/microsoft-prod.list

apt-get install apt-transport-https
apt-get update
apt-get install dotnet-sdk-2.1

git clone --recursive https://github.com/b4rtik/RedPeanut.git
apt-get install -y libgdiplus

然后windows下执行如下命令:

代码语言:javascript
复制
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community>sn.exe -k 4096 key.snk

然后复制key.snk 到 Workspace/KeyFile

执行:

代码语言:javascript
复制
dotnet run

然后输入密码,得到下面的结果即成功

使用方法:

我们可以使用list命令查看其内容

主要模块有launcher、c2、list、exit。

我们看一下主要C2模块

主要为agents、listener、opinion、back。用法肯定也是很简单了,设置监听、操作agents。

然后设置即可

然后返回到launcher中

然后选择你喜欢的,并设置

生成exe后,执行,得到会话

windows defender联网扫描,无反应,360扫描被杀

会话操作

进入会话后,使用opinion查看基本操作:

比如查看目录、查看用户:

主要的内容还是其集成的csharp模块,比如credential

拿safetykatz为例:

执行后生成exe文件,然后在目标机器内存执行,文件不落地

其余的模块用法也就一模一样了,这里就不再继续演示了。

总结:

作为一个新出的c2工具,总体来说还是不错的,在针对国外杀软方面做的比较好,每一种launcher都自带amsi的bypass(可提取出来自用),但是对国内杀软就不那么友好了。还有就是里面的一些模块,开发的可能不是很好,执行完总是会没反映。但是其通信方式以及自定义上线、内存加载等都是其优点。这就是对该工具的简单评测了。

本文参与 腾讯云自媒体分享计划,分享自微信公众号。
原始发表:2020-07-18,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 鸿鹄实验室 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档