Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsCommunityBlog
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Kctf Windows Smc Chain

ASecurity

KCTF 2026 第八题“亥子合辰·塔影迷楼”两级 SMC、反调试、Feistel 与 GF(2^127-39) 多项式求根的可复用解题流程。

271 stars
0 votes
0 copies
0 views
Added 9/23/2026
developmentpython

Security Analysis

A100/100

Scanned 9/23/2026

Install to Claude Code

$npx -y skills add manyuegong33/r0crawl_skills --skill kctf-windows-smc-chain --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Kctf Windows Smc Chain?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Kctf Windows Smc Chain
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/manyuegong33-kctf-windows-smc-chain/badge)](https://www.skillsdirectory.com/skills/manyuegong33-kctf-windows-smc-chain)

More formats (shields.io, HTML) on the badges page.

Download with Pro
Files
SKILL.md
---
name: kctf-windows-smc-chain
description: KCTF 2026 第八题“亥子合辰·塔影迷楼”两级 SMC、反调试、Feistel 与 GF(2^127-39) 多项式求根的可复用解题流程。
---

# 题型与结论

目标文件为 PE32+ x64。入口并不直接执行 checker,而是在内存镜像上完成两级运行时解密;解密后的 checker 把 16 个可打印字符编码为有限域元素,经过五次多项式和两路 20 轮 Feistel,逆向后在有限域求根。最终输入/Flag:

```text
kanxue@2o26o8!@#
```

## 1. 从 PE 中静态还原 SMC

`.tgt` 给出参数:`stage1_rva=0x1800`、`stage1_len=0x510`,`stage2_rva=0x1d10`、`stage2_len=0x4962`。可用 section 映射的 `bytearray`,不必修复导入表。

Stage 1:对 `img[0x1800:0x1d10]` 每字节 XOR `0x5a`。

对 Stage 1 明文计算两组 FNV-1a:

```python
MASK=(1<<64)-1; PRIME=0x100000001b3
h1=0xcbf29ce484222325; h2=0x9e3779b97f4a7c15
for b in stage1:
    h1=((h1^b)*PRIME)&MASK
    h2=((h2^b)*PRIME)&MASK
```

本样本结果:`h1=0x73fb4f498aab364f`,`h2=0xb157c7e044b966df`。

Stage 2 每字节:

```python
G=0x9e3779b97f4a7c15; C=0xff51afd7ed558ccd
for i in range(0x4962):
    t=((i*G)&MASK)^h1^h2
    t=(t^(t>>33))*C & MASK
    img[0x1d10+i] ^= t>>56
```

得到有效 x64 checker(约 `0x140004380`)。动态下软件断点可能破坏第二阶段密钥流;优先离线解密或用 Unicorn 模拟。

## 2. Checker 逆向

输入约束:长度 16、ASCII 33..126,且 `sum(input)==0x500`。Base-94 Horner 编码:

```python
N=0
for b in inp: N=(N*94 + b-0x21) % P
P=(1<<127)-39
```

运行时常量由 Stage 2 两个 hash 派生;两路 Feistel 各 20 轮。实现逆轮时按相反顺序恢复 `(L,R)`,并确认两路逆推结果相同。文章给出的公共目标:

```text
Y = 0x4be831b0ad3a2d361489375bba3fb8de
```

于是构造:

```text
f(X)=X^5+FE0*X^4+FE1*X^3+FE2*X^2+FE3*X+(FE4-Y) mod P
```

在 GF(P) 上计算 `gcd(f, x^P-x)`,再用 Cantor–Zassenhaus(或五次小多项式的随机 gcd 切分)求一次因式。根连续 `%94` 展开,逐字节 `+0x21`,检查长度/可打印性/ASCII 和。

## 3. 反调试处理

checker 汇总 PEB.BeingDebugged、NtGlobalFlag、硬件断点、ProcessDebugPort/Object 及多次 `rdtsc` 差值并混入 PRNG;调试器会导致常量/S-box 脏化。离线解密无需处理;若必须动态执行,应 hook `rdtsc`、syscall,并令累加器 `rbx=0`,Class `0x1e` 返回 `STATUS_PORT_NOT_SET` 且 buffer=0。

## 验证清单

- 两阶段解密长度和 RVA 正确;Stage2 开头应为正常 x64 序言。
- 两路 Feistel 逆推出的 `Y` 完全一致。
- 根 `<94^16`,还原字符串全为可打印字符且 ASCII 和为 `0x500`。
- 原始 EXE 运行时输入 `kanxue@2o26o8!@#` 通过。

Attribution

manyuegong33manyuegong33
View sourceMore from manyuegong33 →
SSkills DirectorySkills Directory

Your tool, in front of Claude Code builders.

3 founder slots · $299/mo · GSC-verified traffic · sponsors can never buy grades.

See placements

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Your tool, in front of Claude Code builders.

3 founder slots · $299/mo · GSC-verified traffic · sponsors can never buy grades.

See placements

Related Skills

Browser Extension Developer

Use this skill when developing or maintaining browser extension code in the `browser/` directory, including Chrome/Firefox/Edge compatibility, content scripts, background scripts, or i18n updates.

284072 votes

Seo Optimizer

SEO optimization with keyword analysis, readability assessment, technical validation, content quality. Use for search rankings, blog posts, content audits, or encountering keyword density, readability scores, meta tags, schema markup errors.

2192 votes

Google Official Seo Guide

Official Google SEO guide covering search optimization, best practices, Search Console, crawling, indexing, and improving website search visibility based on official Google documentation

1862 votes

Tanstack Start

Build a full-stack TanStack Start app on Cloudflare Workers from scratch — SSR, file-based routing, server functions, D1+Drizzle, better-auth, Tailwind v4+shadcn/ui. Use whenever the user mentions TanStack Start, asks to scaffold a full-stack Cloudflare app with SSR, wants an SSR dashboard, or asks for a React 19 + Cloudflare Workers app with file-based routing and server functions — even if they don't name TanStack Start specifically. No template repo — Claude generates every file fresh per ...

9881 votes

Pentest

PTES-aligned adversarial security audit for backend, frontend, and mobile applications. Produces a CVSS-scored Hacker Report with verified PoCs and phased remediation.

5491 votes
View all in development →