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 / 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 / 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 / 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 / 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 / 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 / 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 / statusline-command.sh
Last active March 21, 2026 16:37
Claude Code custom statusline — shows rate limits, corrected cost, git branch, session duration
#!/bin/bash
# Claude Code custom statusline
# Shows: user@host:path branch [model] ctx% $cost duration 5h/7d quota Sonnet flag
#
# Setup:
# 1. Save this file to ~/.claude/statusline-command.sh
# 2. Add to ~/.claude/settings.json:
# {
# "statusLine": {
# "type": "command",