21st.dev Magic MCP — AI-powered UI component generation via natural language. Access to 21st.dev component library, SVGL brand logos, and real-time preview. Generate React/Tailwind components with /ui command.
日本語の概要は準備中です。原文の説明を表示しています。
AES-GCM ve ChaCha20-Poly1305 nonce yeniden kullanımı saldırısı — GF(2^128) polinom kök bulma ile Hash Key kurtarma ve MAC sahteciliği.
インストールする前に、エージェントに与えられる指示の中身を確認できます。
Aşağıdaki işaretlerden herhangi birini görürsen bu skill'i tetikle:
AES.new(key, AES.MODE_GCM, nonce=sabit_nonce) gibi statik/sıfır nonce kullanımıGCM modu iki bileşenden oluşur:
C = P XOR E(key, nonce || counter)Tag = GHASH(H, AAD, C) XOR E(key, nonce || 0)Hash Key: H = E(key, 0^128) — nonce bağımsız, sadece key'e bağlı.
Nonce reuse senaryosu: İki mesaj aynı nonce ile şifrelenirse:
C1 = P1 XOR KeyStreamC2 = P2 XOR KeyStreamC1 XOR C2 = P1 XOR P2 → plaintext XOR'u sızarAuthentication tag formülü (basitleştirilmiş, k blok için):
T = H^(k+1)·AAD ⊕ H^k·C1 ⊕ ... ⊕ H^1·Ck ⊕ E(key, nonce||0)
İki tag'ın farkı alınınca masking key (E(key, nonce||0)) iptal olur:
T1 - T2 = GHASH(H, aad1, c1) - GHASH(H, aad2, c2)
Bu, H üzerinde tek değişkenli polinom denklemidir. GF(2^128) üzerinde kökler çözülürse H elde edilir ve sahte tag üretilebilir.
Poly1305 anahtarı (r, s) nonce'dan türetilir. Aynı nonce → aynı (r, s) → aynı polinomik yapı. Saldırı özdeştir.
f(H) = GHASH(c1) - GHASH(c2) - (T1 - T2) = 0poly.roots()mask = T1 XOR GHASH(H, aad1, c1)forged_T = GHASH(H, aad_new, c_new) XOR mask# sage ile çalıştır: sage solve.py
from Crypto.Cipher import AES
from pwn import * # sunucu bağlantısı için
def bytes_to_gf(b, F):
"""16 baytı GF(2^128) elemanına çevir."""
val = int.from_bytes(b, 'big')
return F.fetch_int(val)
def gf_to_bytes(elem):
"""GF(2^128) elemanını 16 bayta çevir."""
return int(elem).to_bytes(16, 'big')
def ghash_poly(ciphertext_blocks, aad_blocks, F):
"""GHASH hesabını polinom olarak döndür (H sembolik)."""
H = F.gen()
blocks = aad_blocks + ciphertext_blocks
# uzunluk bloğu ekle (AAD ve CT bit uzunlukları)
len_block = (len(aad_blocks) * 16 * 8).to_bytes(8, 'big') + \
(len(ciphertext_blocks) * 16 * 8).to_bytes(8, 'big')
blocks.append(len_block)
result = F(0)
for b in blocks:
result = (result + bytes_to_gf(b.ljust(16, b'\x00'), F)) * H
return result
# GF(2^128) kurulumu
R.<x> = GF(2)[]
F.<a> = GF(2^128, modulus=x^128 + x^7 + x^2 + x + 1)
# Sunucudan iki mesaj al (aynı nonce ile şifrelenmiş)
# Bunları kendi senaryona göre doldur:
nonce1 = bytes.fromhex("deadbeef000000000000000000000000") # örnek
c1 = bytes.fromhex("...") # ciphertext 1
t1 = bytes.fromhex("...") # tag 1
c2 = bytes.fromhex("...") # ciphertext 2
t2 = bytes.fromhex("...") # tag 2
aad1 = b""
aad2 = b""
# Blokları parçala (16 byte)
def split_blocks(data):
return [data[i:i+16] for i in range(0, len(data), 16)]
c1_blocks = split_blocks(c1)
c2_blocks = split_blocks(c2)
# Polinom: GHASH(c1) - GHASH(c2) - (T1 - T2) = 0 mod H
P.<H> = PolynomialRing(GF(2^128))
def build_ghash_poly(ct_blocks, aad_blocks, tag_bytes):
"""GHASH polinomunu sembolik H ile kur."""
tag_int = F.fetch_int(int.from_bytes(tag_bytes, 'big'))
# Bloklar üzerinde polinom terimi hesapla
all_blocks = aad_blocks + ct_blocks
len_block_int = int.from_bytes(
(len(aad_blocks)*128).to_bytes(8,'big') + (len(ct_blocks)*128).to_bytes(8,'big'),
'big'
)
all_blocks_int = [F.fetch_int(int.from_bytes(b.ljust(16,b'\x00'),'big')) for b in all_blocks]
all_blocks_int.append(F.fetch_int(len_block_int))
poly = P(0)
for i, val in enumerate(all_blocks_int):
# H^(n+1-i) terimi
degree = len(all_blocks_int) - i
# SageMath'te GF(2^128)[H] üzerinde çalışıyoruz
poly += P({degree: val})
poly += P({0: tag_int}) # mask terimi (tag dahil)
return poly
p1 = build_ghash_poly(c1_blocks, [], t1)
p2 = build_ghash_poly(c2_blocks, [], t2)
diff_poly = p1 - p2
# Kökleri bul
roots = diff_poly.roots()
print(f"[*] Bulunan H adayları: {len(roots)}")
for root, mult in roots:
H_val = root
print(f"[+] H = {H_val}")
# Masking key hesapla: mask = T1 XOR GHASH(H, aad1, c1)
# (Basit durum — AAD yok)
g1 = F(0)
for block in c1_blocks:
g1 = (g1 + F.fetch_int(int.from_bytes(block.ljust(16,b'\x00'),'big'))) * H_val
len_b = F.fetch_int(int.from_bytes(b'\x00'*8 + (len(c1)*8).to_bytes(8,'big'), 'big'))
g1 = (g1 + len_b) * H_val
mask = int(g1) ^^ int(F.fetch_int(int.from_bytes(t1, 'big')))
print(f"[+] Mask (E(key,nonce||0)) = {hex(mask)}")
# Sahte mesaj için tag üret
forged_msg = b"admin=true" # challenge'a göre değiştir
forged_blocks = split_blocks(forged_msg.ljust(16, b'\x00'))
gf = F(0)
for block in forged_blocks:
gf = (gf + F.fetch_int(int.from_bytes(block, 'big'))) * H_val
len_b2 = F.fetch_int(int.from_bytes(b'\x00'*8 + (len(forged_msg)*8).to_bytes(8,'big'), 'big'))
gf = (gf + len_b2) * H_val
forged_tag = int(gf) ^^ mask
print(f"[+] Sahte Tag: {hex(forged_tag)}")
# Aynı keystream: C1 XOR C2 = P1 XOR P2
# Eğer P1 kısmen biliniyorsa P2'yi kurtarabilirsin
def xor_bytes(a, b):
return bytes(x ^ y for x, y in zip(a, b))
c1 = bytes.fromhex("...") # ciphertext 1
c2 = bytes.fromhex("...") # ciphertext 2
p1_known = b"HTTP/1.1 200 OK" # bilinen plaintext başlangıcı
# P2'nin başlangıcını kurtarma
p1_xor_p2 = xor_bytes(c1, c2)
p2_partial = xor_bytes(p1_xor_p2[:len(p1_known)], p1_known)
print(f"P2 başlangıcı: {p2_partial}")
ChaCha20-Poly1305'te nonce reuse. İki farklı mesajın aynı nonce ile şifrelendiği tespit edilmiş. GF(2^128) üzerinde Poly1305 tag fark polinomunun kökleri SageMath ile çözülerek H ve r anahtarları kurtarılmış, sahte MAC üretilmiş.
pctf{n0nc3_r3us3_p0lyn0m14l_f0rg3ry}AES-GCM nonce sıfır olarak sabitlenmiş. İki şifreli metin + tag çifti veriliyor. Hash Key H polinom interpolasyon ile çıkarılıp forged packet üretiliyor.
crypto{f0rb1dd3n_fru1t_gcm_byp4ss}Signal uygulamasının Electron-safeStorage v10 AES-GCM anahtarı DPAPI ile şifreli. Volatility3 ile DPAPI master key çözülüp, AES-GCM decrypt yapılmış.
H^(n+1) derecesindedir, H^n değil. Sayım kapalı aralık.x^128 + x^7 + x^2 + x + 1 kullanılmalı. Yanlış modül kök vermez.int.from_bytes(b, 'big') — 'little' DEĞİL.\x00 ile doldur.t.ljust(16, b'\x00') ile normalize et.まだレビューはありません。使ってみた感想をお寄せください。
概要と使いどころ
21st.dev Magic MCP — AI-powered UI component generation via natural language. Access to 21st.dev component library, SVGL brand logos, and real-time preview. Generate React/Tailwind components with /ui command.
日本語の概要は準備中です。原文の説明を表示しています。
AES CBC/ECB modlarına karşı kriptografik bütünlük saldırıları — bit flipping, IV manipulation, ECB cut-and-paste, CBC-MAC length extension, IV reuse
日本語の概要は準備中です。原文の説明を表示しています。
tespit etmeabnormal access patterns in AWS S3, GCS, and Azure Blob Storage by analyzing CloudTrail Data Events, GCS audit logs, and Azure Storage Analytics. Identifies after-hours bulk downloads, access from new IP addresses, unusual API calls (GetObject spikes), and potential data exfiltration using statistical baselines and time-series anomaly Tespit.
日本語の概要は準備中です。原文の説明を表示しています。
Perform static and symbolic analysis of Solidity smart contracts using Slither and Mythril to tespit etmereentrancy, integer overflow, access control, and other vulnerability classes before Dağıt:ment to Ethereum mainnet.
日本語の概要は準備中です。原文の説明を表示しています。
Parses Kubernetes API server audit logs (JSON lines) to tespit etmeexec-into-pod, secret access, RBAC modifications, privileged pod creation, and anonymous API access. Builds threat Tespit rules from audit event patterns. Use investigating yaparken Kubernetes cluster compromise or building k8s-specific SIEM Tespit rules.
日本語の概要は準備中です。原文の説明を表示しています。
Parse Office 365 Unified Audit Logs via Microsoft Graph API to tespit etmeemail forwarding rule creation, inbox delegation, suspicious OAuth app grants, and other indicators of account compromise.
日本語の概要は準備中です。原文の説明を表示しています。