curl -X POST -d "username=test&password=test" -H "X-Forwarded-For: 2.2.2.1" url
得到flag
ez_xor
题目说了xor,暴力穷举试试
Complete Python script to brute-force single-byte XOR and stop at the flag
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
hex_str = "5f-55-58-5e-42-71-7a-6d-7f-48-4e-5c-78-6a-7d-08-0f-0d-44" data = bytes(int(x, 16) for x in hex_str.split('-'))
for key in range(256): res = bytes(b ^ key for b in data) try: text = res.decode('ascii') except UnicodeDecodeError: continue \# Check for flag format and stop when found if text.startswith('flag{') and text.endswith('}'): print(f"Key found: {key} (0x{key:02x})") print(f"Flag: {text}") break```
N = 12194420073815392880989031611545296854145241675320130314821394843436947373331080911787176737202940676809674543138807024739454432089096794532016797246441325729856528664071322968428804098069997196490382286126389331179054971927655320978298979794245379000336635795490242027519669217784433367021578247340154647762800402140321022659272383087544476178802025951768015423972182045405466448431557625201012332239774962902750073900383993300146193300485117217319794356652729502100167668439007925004769118070105324664379141623816256895933959211381114172778535296409639317535751005960540737044457986793503218555306862743329296169569 e = 65537 c = 4504811333111877209539001665516391567038109992884271089537302226304395434343112574404626060854962818378560852067621253927330725244984869198505556722509058098660083054715146670767687120587049288861063202617507262871279819211231233198070574538845161629806932541832207041112786336441975087351873537350203469642198999219863581040927505152110051313011073115724502567261524181865883874517555848163026240201856207626237859665607255740790404039098444452158216907752375078054615802613066229766343714317550472079224694798552886759103668349270682843916307652213810947814618810706997339302734827571635179684652559512873381672063
\# Fermat factorization from math import isqrt from gmpy2 import is_square
a = isqrt(N) if a * a < N: a += 1
while True: b2 = a*a - N if is_square(b2): b = isqrt(b2) p = a - b q = a + b break a += 1
assert p * q == N
phi = (p - 1) * (q - 1) d = inverse(e, phi) m = pow(c, d, N) print(long_to_bytes(m)) flag = long_to_bytes(m).decode() modified_flag = flag.replace('1', '2') print(modified_flag)```