Skip to content

Instantly share code, notes, and snippets.

View n-WN's full-sized avatar
:shipit:
~DevSecOps~ AI

Zoee n-WN

:shipit:
~DevSecOps~ AI
View GitHub Profile
@n-WN
n-WN / kitty.conf
Created March 16, 2026 08:31
kitty terminal config backup
# Kitty 最小边框配置
# hide_window_decorations 控制窗口装饰
# titlebar-only: 只隐藏标题栏文字,保留控制按钮和可拖动区域
# yes: 完全隐藏所有装饰(无法拖动)
# no: 显示完整标题栏
# Kitty 远程控制
allow_remote_control yes
listen_on unix:/tmp/kitty-rc
hide_window_decorations titlebar-only
@n-WN
n-WN / test.py
Created March 14, 2026 08:24
AliCTF 2026 Final - RSA factorization via genus-2 Jacobian GCD leak
#!/usr/bin/env python3
import argparse
import time
from math import gcd, isqrt
"""Attack the special RSA where q = ((p - 1)^2 + 4x^2) / 8 and p = x^2 + 2y^2.
The key observation behind the attack is that the explicit divisor
D = (X^2 + 3X + 2, w(X + 1)), w^2 = -30
@n-WN
n-WN / exploit.py
Created March 14, 2026 08:24
AliCTF 2026 Final - Kitten Sign exploit (RSA + ECDSA + SM2 triple signature forgery)
#!/usr/bin/env python3
"""
Kitten Sign - Full Exploit
AliyunCTF 2026 Final
Attack chain:
1. Collect encrypt samples, recover RSA modulus & SM2 public key
2. Factor RSA via genus-2 Jacobian (call test.py)
3. Precompute BKZ-25 lattice basis (call sage subprocess)
4. Invalid-curve oracle: forge decrypt commands to recover SM2 private key via CRT
@n-WN
n-WN / firefox_decrypt_logins.py
Created March 12, 2026 13:21
Firefox Saved Passwords Decryptor — PBES2/PBKDF2/AES-256-CBC (key4.db + logins.json)
#!/usr/bin/env python3
"""
Firefox Saved Passwords Decryptor
Decrypt saved logins from Firefox profile backup (logins.json + key4.db).
Supports Firefox profiles using PBES2 + PBKDF2-HMAC-SHA256 + AES-256-CBC.
Requirements:
pip install pycryptodome pyasn1
@n-WN
n-WN / griffin_fullsolve_onefile.py
Created February 4, 2026 08:59
alictf 2026 crypto-Griffin
#!/usr/bin/env python3
from __future__ import annotations
import argparse
import ast
import base64
import dataclasses
import gzip
import hashlib
import json
@n-WN
n-WN / GIST_README.md
Created December 31, 2025 02:50
Sage version comparison and package recovery tools

Sage Version Comparison Tool

Analysis and recovery tools for comparing Sage package versions across different releases.

Files

  1. analyze_sage.py - Python analyzer script to compare package versions
  2. sage_install_recovery.sh - Shell script to recover/reinstall removed packages

Quick Start

@n-WN
n-WN / README.md
Last active December 23, 2025 23:10
Codex 分析 (codex-cli 0.77.0)

Codex 分析 (codex-cli 0.77.0)

Codex 上下文如何管理


1. 上下文存储与提取机制

  • 存储实体 会话内的完整上下文由 ContextManager 维护,其核心数据结构为 items: Vec<ResponseItem>
  • 提取逻辑
@n-WN
n-WN / README.md
Created December 23, 2025 09:57
Claude Code: 对 Agent 暴露 LSP 的实现链路分析 (v2.0.76)

Claude Code: 对 Agent 暴露 LSP 的实现链路分析 (v2.0.76)


一、 配置入口与加载机制

  • 插件侧配置 (Schema: wWA) 支持通过 .lsp.jsonmanifest.lspServers 进行定义。核心字段包含 commandargsextensionToLanguageenvinitializationOptionsworkspaceFolder
  • 传输层协议 代码中声明支持 stdiosocket 两种 transport 模式,但当前版本实现中仅观察到 stdio 分支的具体处理逻辑。 (参考: external/claude-code-pkg/package/cli.js:1148)
@n-WN
n-WN / kitty-session-analysis.md
Created December 23, 2025 09:51
Kitty 会话/恢复/自动保存:调研与实现思路

Kitty 会话/恢复/自动保存:调研与实现思路

目标:回答「kitty 终端的日志在哪、如何恢复此前会话」并进一步调研社区/官方方案,给出可实现的“自动保存 + 恢复工作现场”的设计。

结论(先说人话)

  • Kitty 默认不会把终端输出持久化为“日志文件”;窗口关闭后 scrollback 也会丢失(除非你自己导出/录制)。
  • Kitty 的 session 本质是“重建布局 + 重跑命令”:能恢复 tabs/windows/layout/cwd/要启动的程序,但不能做到 tmux-resurrect 那种“进程不断、断线重连”
  • 避免误关导致任务中断:官方建议用 confirm_os_window_close(见 issue #5448 回复)。
@n-WN
n-WN / IPv6-Blackhole.md
Last active December 7, 2025 18:05
Kimi CLI Connectivity Investigation: IPv6 Blackhole And Session IPv4 Fallback Strategy

Kimi CLI Connectivity Investigation: IPv6 Blackhole And Session IPv4 Fallback Strategy

Date: 2025-12-07

Host: macOS 15.5 (arm64)

Repo: MoonshotAI/kimi-cli (local working copy)

Current HEAD: b2af75a (refactor: enable Pyright strict type checking for kimi_cli/ui/shell (#427))