Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Why is this PHP code vulnerable?

Can someone tell me why the line
Code
$timearray = ($unixtime == 0) ? getdate() : getdate(`$unixtime`);
is vulnerable?

PHP Code

<?php
function unixToDosTIme($unixtime = 0)
{
 
       $timearray = ($unixtime == 0) ? getdate() : getdate(`$unixtime`);
 
       if($timearray['year'] < 1980){
 
          $timearray['year'] = 1980;
 
          $timearray['mon'] =  1; 
 
          $timearray['mday'] =  1; 
 
          $timearray['hours'] =  0;  
           $timearray
['minutes'] =  0;
 
          $timearray['seconds'] =  0;
 
       }
 
       print($timearray['year']);
 
       
        return
(($timearray['year'] - 1980) << 25)
 
               | ($timearray['mon'] << 21)
 
               | ($timearray['mday'] << 16)
 
               | ($timearray['hours'] << 11)
 
               | ($timearray['minutes'] << 5)
 
               | ($timearray['seconds'] >> 1);
} 
      

print sprintf("Dos time is %d\n", unixToDosTIme($_GET['time']));


?>
I'm not really seeing why this is Vulnerable but i'm not a PHP Expert....Where are you seeing that it is Vulnerable?
A bit more information could help shine light on why exactly it is.
[Image: 6HBGYX9.gif]


Possibly Related Threads...
Thread / Author Replies Views Last Post
by nullassemblyJun 3, 2017 11:57 AM 6 413 Jun 3, 2017 11:57 AM
Last Post: cyber_hunter
by phe0nix404Apr 9, 2016 07:03 AM 15 547 Apr 9, 2016 07:03 AM
Last Post: phe0nix404
by SIM-2902786Nov 25, 2015 11:00 AM 4 203 Nov 25, 2015 11:00 AM
Last Post: Viktory