import asyncio, re, aiohttp

BASE = "http://129.153.62.97:8040"


async def main():
    tout = aiohttp.ClientTimeout(total=20)
    async with aiohttp.ClientSession(timeout=tout, headers={"User-Agent": "Mozilla/5.0"}) as s:
        async with s.get(BASE + "/", ssl=False) as r:
            html = await r.text()
        print("index", r.status, len(html))
        srcs = re.findall(r'src="([^"]+\.js[^"]*)"', html)
        print("scripts:", srcs[:6])
        for src in srcs[:4]:
            url = src if src.startswith("http") else BASE + "/" + src.lstrip("/")
            try:
                async with s.get(url, ssl=False) as r2:
                    js = await r2.text()
                hits = []
                for pat in ("/identity/accounts/register", "createAccount", "Create account", "Registration not allowed", "signupAllowed", "disableUserRegistration"):
                    if pat in js:
                        hits.append(pat)
                print(f"  {src[:50]} -> {r2.status} len={len(js)} hits={hits}")
            except Exception as e:
                print(f"  {src[:50]} -> ERR {type(e).__name__}")

asyncio.run(main())
