Mlecms 反射型xss && 后台任意文件下载

应该算0day吧,自己分析出来的,有点鸡肋,不过小cms分析确实比较简单。

 

xss地址:search.php?word=a><img+src=1+οnerrοr=alert`1`>a&type=1

 

对于word的参数,他的过滤是这样的

		$trim_str = ' .,;[]|+-=_`~!@#$%^&*()<>?{}';
		empty($this->type) && $this->type = 1;
		$this->type = $this->type < 1 ? 1 : ($this->type > 4 ? 4 : $this->type);			
		$this->word = trim(preg_replace('/[\'\"\\\\\/]/','',$this->word),$trim_str);
		$this->tag = trim(preg_replace('/[\'\"\\\\\/]/','',$this->tag),$trim_str);

  先过滤'"\/ 然后在过滤这些.,;[]|+-=_`~!@#$%^&*()<>?{}   发现是用trim() 函数来过滤的,他也就过滤头部和尾部,所以我们只要头部和尾部不为.,;[]|+-=_`~!@#$%^&*()<>?{}就行,所以我们的poc是: a><img+src=1+οnerrοr=alert`1`>a ,

 

后台任意文件下载。

漏洞位于 /down.php  第69行

	$do == 0 && $d['mode'] == 0 && is_file($d['format_url'][$do][1]) ? download::read($d['format_url'][$do][1]) : msgbox('',$d['format_url'][$do][1]); 

  

调用read()函数读取url,跟进read()函数

	public static function read($file){
		ob_end_clean();
		header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
		header('Content-Description: File Transfer');
		header('Content-Type: application/octet-stream');
		@header('Content-Length: '.filesize($file));
		header('Content-Disposition: attachment; filename='.basename($file));
		@readfile($file);
		exit();
	}

  

没有啥过滤,直接读取返回。

$d['format_url'][$do][1]而这个url的值是存放在数据库中的值,这个值是后台创建的,或者修改。 

修改完成以后在前台下载就行。

 

这个文件下载漏洞需要管理员的权限,下载包含webkey的文件,就能getshell了。 

 

readfile() 不知道能不能用 php://的方法来getshell,暂时没找到,留着以后更! 

转载于:https://www.cnblogs.com/yangxiaodi/p/6952204.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值