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:25.78 GB of 70.42 GB (36.62%)
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,

/ usr/ src/ httpd-2.4.6/ test/ - drwxr-xr-x

Directory:
Viewing file:     cls.c (4.5 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
/* Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (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.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include <ctype.h>
#include <dirent.h>
#include <stdio.h>
#include <string.h>
#include <time.h>

/*
 * Compare a string to a mask
 * Mask characters:
 *   @ - uppercase letter
 *   # - lowercase letter
 *   & - hex digit
 *   # - digit
 *   * - swallow remaining characters
 *  <x> - exact match for any other character
 */
static int checkmask(const char *data, const char *mask)
{
    int i, ch, d;

    for (i = 0; mask[i] != '\0' && mask[i] != '*'; i++) {
        ch = mask[i];
        d = data[i];
        if (ch == '@') {
            if (!isupper(d))
                return 0;
        }
        else if (ch == '$') {
            if (!islower(d))
                return 0;
        }
        else if (ch == '#') {
            if (!isdigit(d))
                return 0;
        }
        else if (ch == '&') {
            if (!isxdigit(d))
                return 0;
        }
        else if (ch != d)
            return 0;
    }

    if (mask[i] == '*')
        return 1;
    else
        return (data[i] == '\0');
}

/*
 * Converts 8 hex digits to a time integer
 */
static int hex2sec(const char *x)
{
    int i, ch;
    unsigned int j;

    for (i = 0, j = 0; i < 8; i++) {
        ch = x[i];
        j <<= 4;
        if (isdigit(ch))
            j |= ch - '0';
        else if (isupper(ch))
            j |= ch - ('A' - 10);
        else
            j |= ch - ('a' - 10);
    }
    if (j == 0xffffffff)
        return -1;  /* so that it works with 8-byte ints */
    else
        return j;
}

int main(int argc, char **argv)
{
    int i, ver;
    DIR *d;
    struct dirent *e;
    const char *s;
    FILE *fp;
    char path[FILENAME_MAX + 1];
    char line[1035];
    time_t date, lmod, expire;
    unsigned int len;
    struct tm ts;
    char sdate[30], slmod[30], sexpire[30];
    const char time_format[] = "%e %b %Y %R";

    if (argc != 2) {
        printf("Usage: cls directory\n");
        exit(0);
    }

    d = opendir(argv[1]);
    if (d == NULL) {
        perror("opendir");
        exit(1);
    }

    for (;;) {
        e = readdir(d);
        if (e == NULL)
            break;
        s = e->d_name;
        if (s[0] == '.' || s[0] == '#')
            continue;
        sprintf(path, "%s/%s", argv[1], s);
        fp = fopen(path, "r");
        if (fp == NULL) {
            perror("fopen");
            continue;
        }
        if (fgets(line, 1034, fp) == NULL) {
            perror("fgets");
            fclose(fp);
            continue;
        }
        if (!checkmask(line, "&&&&&&&& &&&&&&&& &&&&&&&& &&&&&&&& &&&&&&&&\n")) {
            fprintf(stderr, "Bad cache file\n");
            fclose(fp);
            continue;
        }
        date = hex2sec(line);
        lmod = hex2sec(line + 9);
        expire = hex2sec(line + 18);
        ver = hex2sec(line + 27);
        len = hex2sec(line + 35);
        if (fgets(line, 1034, fp) == NULL) {
            perror("fgets");
            fclose(fp);
            continue;
        }
        fclose(fp);
        i = strlen(line);
        if (strncmp(line, "X-URL: ", 7) != 0 || line[i - 1] != '\n') {
            fprintf(stderr, "Bad cache file\n");
            continue;
        }
        line[i - 1] = '\0';
        if (date != -1) {
            ts = *gmtime(&date);
            strftime(sdate, 30, time_format, &ts);
        }
        else
            strcpy(sdate, "-");

        if (lmod != -1) {
            ts = *gmtime(&lmod);
            strftime(slmod, 30, time_format, &ts);
        }
        else
            strcpy(slmod, "-");

        if (expire != -1) {
            ts = *gmtime(&expire);
            strftime(sexpire, 30, time_format, &ts);
        }
        else
            strcpy(sexpire, "-");

        printf("%s: %d; %s  %s  %s\n", line + 7, ver, sdate, slmod, sexpire);
    }

    closedir(d);
    return 0;
}
Command:
Quick Commands:
Upload:
[Read-Only] Max size: 100MB
PHP Filesystem: <@ Ú
Search File:
regexp
Create File:
Overwrite [Read-Only]
View File:
Mass Defacement:
[+] Main Directory: [+] Defacement Url:
LmfaoX Shell - Private Build [BETA] - v0.1 -; Generated: 0.1825 seconds