ShellBanner
System:Linux MiraNet 3.0.0-14-generic-pae #23-Ubuntu SMP Mon Nov 21 22:07:10 UTC 2011 i686
Software:Apache. PHP/5.3.6-13ubuntu3.10
ID:uid=65534(nobody) gid=65534(nogroup) groups=65534(nogroup)
Safe Mode:OFF
Open_Basedir:OFF
Freespace:27.29 GB of 70.42 GB (38.76%)
MySQL: ON MSSQL: OFF Oracle: OFF PostgreSQL: OFF Curl: OFF Sockets: ON Fetch: OFF Wget: ON Perl: ON
Disabled Functions: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,

/ http/ smf/ Sources/ - drwxrwxrwx

Directory:
Viewing file:     ViewQuery.php (5.88 KB)      -r--r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
/**********************************************************************************
* ViewQuery.php                                                                   *
***********************************************************************************
* SMF: Simple Machines Forum                                                      *
* Open-Source Project Inspired by Zef Hemel (zef@zefhemel.com)                    *
* =============================================================================== *
* Software Version:           SMF 1.1                                             *
* Software by:                Simple Machines (http://www.simplemachines.org)     *
* Copyright 2006 by:          Simple Machines LLC (http://www.simplemachines.org) *
*           2001-2006 by:     Lewis Media (http://www.lewismedia.com)             *
* Support, News, Updates at:  http://www.simplemachines.org                       *
***********************************************************************************
* This program is free software; you may redistribute it and/or modify it under   *
* the terms of the provided license as published by Simple Machines LLC.          *
*                                                                                 *
* This program is distributed in the hope that it is and will be useful, but      *
* WITHOUT ANY WARRANTIES; without even any implied warranty of MERCHANTABILITY    *
* or FITNESS FOR A PARTICULAR PURPOSE.                                            *
*                                                                                 *
* See the "license.txt" file for details of the Simple Machines license.          *
* The latest version can always be found at http://www.simplemachines.org.        *
**********************************************************************************/
if (!defined('SMF'))
    die(
'Hacking attempt...');

/*    This file is concerned with viewing queries, and is used for debugging.
    It contains only one function:

    void ViewQuery()
        - toggles the session variable 'view_queries'.
        - views a list of queries and analyzes them.
        - requires the admin_forum permission.
        - is accessed via ?action=viewquery.
        - strings in this function have not been internationalized.
*/

// See the queries....
function ViewQuery()
{
    global 
$scripturl$user_info$settings$context$db_connection$modSettings;

    
// Don't allow except for administrators.
    
isAllowedTo('admin_forum');

    
// If we're just hiding/showing, do it now.
    
if (isset($_REQUEST['sa']) && $_REQUEST['sa'] == 'hide')
    {
        
$_SESSION['view_queries'] = $_SESSION['view_queries'] == 1;

        if (
strpos($_SESSION['old_url'], 'action=viewquery') !== false)
            
redirectexit();
        else
            
redirectexit($_SESSION['old_url']);
    }

    if (isset(
$modSettings['integrate_egg_nog']) && function_exists($modSettings['integrate_egg_nog']))
        
call_user_func($modSettings['integrate_egg_nog']);

    
$query_id = isset($_REQUEST['qq']) ? (int) $_REQUEST['qq'] - : -1;

    echo 
'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
    <head>
        <title>'
$context['forum_name'], '</title>
        <link rel="stylesheet" type="text/css" href="'
$settings['theme_url'], '/style.css" />
        <style type="text/css">
            body
            {
                margin: 1ex;
            }
            body, td, th, .normaltext
            {
                font-size: x-small;
            }
            .smalltext
            {
                font-size: xx-small;
            }
        </style>
    </head>
    <body>'
;

    foreach (
$_SESSION['debug'] as $q => $query_data)
    {
        
// Fix the indentation....
        
$query_data['q'] = ltrim(str_replace("\r"''$query_data['q']), "\n");
        
$query explode("\n"$query_data['q']);
        
$min_indent 0;
        foreach (
$query as $line)
        {
            
preg_match('/^(\t*)/'$line$temp);
            if (
strlen($temp[0]) < $min_indent || $min_indent == 0)
                
$min_indent strlen($temp[0]);
        }
        foreach (
$query as $l => $dummy)
            
$query[$l] = substr($dummy$min_indent);
        
$query_data['q'] = implode("\n"$query);

        
$is_select_query substr(trim($query_data['q']), 06) == 'SELECT';
        if (
$is_select_query)
            
$select $query_data['q'];
        elseif (
preg_match('~^INSERT(?: IGNORE)? INTO \w+(?:\s+\([^)]+\))?\s+(SELECT .+)$~s'trim($query_data['q']), $matches) != 0)
        {
            
$is_select_query true;
            
$select $matches[1];
        }
        elseif (
preg_match('~^CREATE TEMPORARY TABLE .+?(SELECT .+)$~s'trim($query_data['q']), $matches) != 0)
        {
            
$is_select_query true;
            
$select $matches[1];
        }

        echo 
'
        <div id="qq'
$q'" style="margin-bottom: 2ex;">
            <a'
$is_select_query ' href="' $scripturl '?action=viewquery;qq=' . ($q 1) . '#qq' $q '"' ''' style="font-weight: bold; color: black; text-decoration: none;">
                '
nl2br(str_replace("\t"'&nbsp;&nbsp;&nbsp;'htmlspecialchars($query_data['q']))), '
            </a><br />'
;
        if (!empty(
$query_data['f']) && !empty($query_data['l']))
            echo 
'
            in <i>'
$query_data['f'], '</i> line <i>'$query_data['l'], '</i>, ';
        echo 
'
            which took '
round($query_data['t'], 8), ' seconds.
        </div>'
;

        
// Explain the query.
        
if ($query_id == $q && $is_select_query)
        {
            
$result db_query("
                EXPLAIN " 
$selectfalsefalse);
            if (
$result === false)
            {
                echo 
'
        <table border="1" cellpadding="4" cellspacing="0" style="empty-cells: show; font-family: serif; margin-bottom: 2ex;">
            <tr><td>'
mysql_error($db_connection), '</td></tr>
        </table>'
;
                continue;
            }

            echo 
'
        <table border="1" rules="all" cellpadding="4" cellspacing="0" style="empty-cells: show; font-family: serif; margin-bottom: 2ex;">'
;

            
$row mysql_fetch_assoc($result);

            echo 
'
            <tr>
                <th>' 
implode('</th>
                <th>'
array_keys($row)) . '</th>
            </tr>'
;

            
mysql_data_seek($result0);
            while (
$row mysql_fetch_assoc($result))
            {
                echo 
'
            <tr>
                <td>' 
implode('</td>
                <td>'
$row) . '</td>
            </tr>'
;
            }
            
mysql_free_result($result);

            echo 
'
        </table>'
;
        }
    }

    echo 
'
    </body>
</html>'
;

    
obExit(false);
}

?>
Command:
Quick Commands:
Upload:
[OK] Max size: 100MB
PHP Filesystem: <@ Ú
Search File:
regexp
Create File:
Overwrite [OK]
View File:
Mass Defacement:
[+] Main Directory: [+] Defacement Url:
LmfaoX Shell - Private Build [BETA] - v0.1 -; Generated: 0.1651 seconds