Log Evasion logo

Log Evasion

OrganizationPopular
wgpsec
log-evasion

日志分析与日志逃逸方法论。理解蓝队如何通过日志追踪攻击行为(SIEM/Event Log/Syslog),以及红队如何规避日志记录或精准清除痕迹。当需要设计无痕操作或分析日志监控覆盖范围时使用

Overview

Publisherwgpsec
RepositoryAboutSecurity
Skill namelog-evasion
Stars
1.8K
Forks
247
Bundled files
2
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 2 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by wgpsec on GitHub. Read the source before you install it.

Installation

Install the Log Evasion AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/wgpsec/AboutSecurity/tree/master/skills/dfir/log-evasion
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/wgpsec/AboutSecurity.git /tmp/AboutSecurity
mkdir -p .claude/skills
cp -r /tmp/AboutSecurity/skills/dfir/log-evasion .claude/skills/log-evasion
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Log Evasion in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Log Evasion on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Log Evasion is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

日志分析与日志逃逸

核心原则:最好的反日志策略是不产生日志,而非事后删除

⛔ 深入参考


Part A: 蓝队视角 — 日志检测关键点

Windows 关键 Event ID

Event ID日志源含义红队动作触发
4624Security登录成功PTH/PTT/RDP
4625Security登录失败密码喷洒
4648Security显式凭据登录runas/PsExec
4672Security特权分配特权提升
4688Security新进程创建工具执行
4698Security计划任务创建持久化
4720Security用户创建后门账户
5140Security网络共享访问横向移动
5156Security网络连接C2 通信
7045System服务安装持久化/PsExec
1102Security日志清除⛔ 反取证暴露!
4104PowerShell脚本块日志PS 攻击工具
4103PowerShell模块日志PS 命令执行
1Sysmon进程创建(含hash)所有工具执行
3Sysmon网络连接C2 通信
8SysmonCreateRemoteThread进程注入
10Sysmon进程访问LSASS dump
11Sysmon文件创建工具落盘

Linux 关键日志

日志位置记录内容
auth.log/secure/var/log/SSH 登录、sudo、su
wtmp/var/log/登录/注销记录
btmp/var/log/失败登录
lastlog/var/log/最后登录时间
audit.log/var/log/audit/auditd 规则匹配
syslog/messages/var/log/系统事件
journal/var/log/journal/systemd 日志
.bash_history~/命令历史

SIEM 常见检测规则(需要绕过的)

Sigma 规则示例(蓝队部署):
├─ 进程注入: Sysmon EventID 8 (CreateRemoteThread to lsass)
├─ 凭据 Dump: EventID 10 (OpenProcess to lsass)
├─ 横向移动: EventID 4648 + 4624 LogonType 3
├─ 持久化: EventID 7045 (新服务) / 4698 (新计划任务)
├─ 日志清除: EventID 1102 / 104 → 高优先级告警!
└─ PowerShell: EventID 4104 含 "IEX" / "Invoke-" / "-enc"

Part B: 红队视角 — 日志逃逸

策略 1: 阻止日志产生(最优)

Windows:
├─ 禁用 ETW Provider → 阻止 PowerShell/AMS 日志
│   patch ntdll!EtwEventWrite → ret
│   或 NtTraceEvent hook
├─ 关闭 ScriptBlock Logging
│   reg: HKLM\SOFTWARE\Policies\Microsoft\Windows\PowerShell\ScriptBlockLogging → 0
├─ 使用 .NET 避免 PowerShell 日志
│   C# 直接调用 .NET → 不走 PS 引擎 → 无 4104
├─ Thread detach from ETW
│   patch 当前线程的 ETW context → 不再产生事件
└─ Sysmon 绕过
    unload sysmon driver / patch 事件回调

Linux:
├─ 操作前: unset HISTFILE; export HISTSIZE=0; export HISTFILESIZE=0
├─ 或: set +o history
├─ 使用空格前缀命令(bash HISTCONTROL=ignorespace)
├─ kill -9 auditd(需 root,会产生停止日志)
└─ auditctl -e 0(关闭审计,更隐蔽)

策略 2: 绕过日志(不触发检测规则)

绕过 Sysmon:
├─ 进程注入: 避免 CreateRemoteThread → 用 APC/Callback/Early Bird
├─ LSASS 访问: 避免直接 OpenProcess → 用 Handle 复制/MiniDump
├─ 网络: 使用 raw socket → Sysmon EID 3 可能不捕获
└─ 文件: 使用已存在文件名/路径 → 不触发新文件规则

绕过 PowerShell 日志:
├─ 降级攻击: powershell -version 2(无 ScriptBlock 日志)
├─ 使用 C#/.NET: 直接反射调用 → 无 PS 日志
├─ AMSI bypass → 阻止脚本内容被记录
└─ 使用 WMI/COM → 不走 PowerShell 引擎

绕过 4688 进程创建:
├─ 进程名伪装: 复制合法程序名执行
├─ 使用 LOLBins: rundll32/mshta/certutil → 合法进程
├─ 父进程欺骗: 设置 PPID 为正常进程
└─ 命令行混淆: 环境变量展开、特殊字符

策略 3: 精准清除(已产生日志时的补救)

⛔ NEVER 清空整个日志 → EventID 1102 会立即告警!
⛔ ALWAYS 精准删除特定条目

Windows 精准清除:
├─ 方式 1: 停止 EventLog 服务 → 修改 .evtx 文件 → 重启服务
│   net stop eventlog(需 SYSTEM)
│   修改 evtx 二进制结构删除特定记录
│   net start eventlog
├─ 方式 2: Danderspritz eventlogedit(NSA 工具)
│   精准删除指定 EventID 的记录,修复文件校验
├─ 方式 3: Invoke-Phant0m
│   杀掉 EventLog 服务的所有线程 → 服务在但不写日志
└─ 方式 4: MiniNT 注册表键
    HKLM\SYSTEM\CurrentControlSet\Control\MiniNT → 阻止日志写入

Linux 精准清除:
├─ auth.log: sed -i '/特定IP/d' /var/log/auth.log
├─ wtmp: utmpdump /var/log/wtmp > tmp.txt
│         编辑删除特定行
│         utmpdump -r < tmp.txt > /var/log/wtmp
├─ lastlog: 工具修改特定用户的 lastlog 记录
├─ audit.log: aureport 确认记录 → sed 删除
└─ journal: journalctl --vacuum-time=1s(⛔ 会清全部)

策略 4: 实时日志转发对抗

现代企业会实时转发日志到 SIEM → 本地删除无效!

应对方案:
├─ 从一开始就不产生日志(策略 1)→ 最优
├─ 绕过 Sysmon/ETW(策略 2)→ 不产生特定事件
├─ 使用 SSH 隧道/DNS 隧道 → 网络日志中混入合法流量
├─ 操作时间选择 → 凌晨/节假日 → SOC 响应慢
└─ 理解 SIEM 规则阈值 → 低于告警阈值操作
    例:密码喷洒锁定阈值 5次 → 每用户只尝试 2 次

对照表

蓝队监控触发条件红队对策
EventID 4624任何登录正常时段+合法用户名
EventID 4688新进程LOLBins / PPID spoofing
EventID 4104PS 脚本.NET / AMSI bypass / PS v2
Sysmon EID 1进程+hash修改已知白名单程序
Sysmon EID 8远程线程APC / Timer callback
Sysmon EID 10进程访问Handle duplicate
auditdsyscall审计关闭 auditd / 直接 syscall
网络日志连接记录域前置 / CDN / 合法服务

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Log Evasion AI skill do?

日志分析与日志逃逸方法论。理解蓝队如何通过日志追踪攻击行为(SIEM/Event Log/Syslog),以及红队如何规避日志记录或精准清除痕迹。当需要设计无痕操作或分析日志监控覆盖范围时使用

Why use Log Evasion on TypingMind?

Because you install it once and use it with any model. Log Evasion is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Log Evasion in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/wgpsec/AboutSecurity/tree/master/skills/dfir/log-evasion. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Log Evasion?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Log Evasion?

As many as you like. As long as a model supports skills, you can use Log Evasion with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Log Evasion AI skill free?

It is published on GitHub by wgpsec. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇