!C99Shell v. 1.0 pre-release build #16!

Software: Apache/2.0.54 (Fedora). PHP/5.0.4 

uname -a: Linux mina-info.me 2.6.17-1.2142_FC4smp #1 SMP Tue Jul 11 22:57:02 EDT 2006 i686 

uid=48(apache) gid=48(apache) groups=48(apache)
context=system_u:system_r:httpd_sys_script_t
 

Safe-mode: OFF (not secure)

/usr/share/doc/squid-2.5.STABLE13/   drwxr-xr-x
Free 3.78 GB of 27.03 GB (14%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     rredir.c (2.68 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
/* $Id: rredir.c,v 1.4 2001/01/07 10:57:13 hno Exp $ */

/*
* From:    richard@hekkihek.hacom.nl (Richard Huveneers)
* To:      squid-users@nlanr.net
* Subject: Save 15% on your bandwidth...
* Date:    12 Sep 1996 21:21:55 GMT
* ===========================================================================
*
* I have downloaded the multi-megabyte files from Netscape and Microsoft
* that our users like to download from every mirror in the world,
* defeating the usual caching.
*
* I put these files in a separate directory and installed a basic
* redirector for Squid that checks if the file (so hostname and pathname
* are disregarded) is present in this directory.
*
* After a few days of testing (the redirector looks very stable) it looks
* like this is saving us approx. 15% on our cache flow. Also, our own WWW
* server has become more popular than ever :)
*
* I'm sure this code will be useful to others too, so I've attached it at
* the end of this message. Improvements, extensions etc. are welcome.
*
* I'm going on holidays now, so I won't be able to respond to e-mail
* quickly.
*
* Enjoy, Richard.
*/

/*
* rredir - redirect to local directory
*
* version 0.1, 7 sep 1996
* - initial version (Richard Huveneers <Richard.Huveneers@hekkihek.hacom.nl>)
*/

#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <ctype.h>

#define ACCESS_LOCAL_DIR        "/var/lib/httpd/htdocs/local/rredir"
#define REDIRECT_TO_URL         "http://www.hacom.nl/local/rredir"
#define BUFFER_SIZE             (16*1024)

int
main()
{
    char buf[BUFFER_SIZE];
    char *s, *t;
    int tlu = 0;

    /* make standard output line buffered */
    if (setvbuf(stdout, NULL, _IOLBF, 0) != 0)
    return 1;

    /* speed up the access() calls below */
    if (chdir(ACCESS_LOCAL_DIR) == -1)
    return 1;

    /* scan standard input */
    while (fgets(buf, BUFFER_SIZE, stdin) != NULL) {
    /* check for too long urls */
    if (strchr(buf, '\n') == NULL) {
        tlu = 1;
        continue;
    }
    if (tlu)
        goto dont_redirect;

    /* determine end of url */
    if ((s = strchr(buf, ' ')) == NULL)
        goto dont_redirect;
    *s = '\0';

    /* determine first character of filename */
    if ((s = strrchr(buf, '/')) == NULL)
        goto dont_redirect;
    s++;

    /* security: do not redirect to hidden files, the current
     * directory or the parent directory */
    if (*s == '.' || *s == '\0')
        goto dont_redirect;

    /* map filename to lower case */
    for (t = s; *t != '\0'; t++)
        *t = (char) tolower((int) *t);

    /* check for a local copy of this file */
    if (access(s, R_OK) == 0) {
        (void) printf("%s/%s\n", REDIRECT_TO_URL, s);
        continue;
    }
      dont_redirect:
    tlu = 0;
    (void) printf("\n");
    }

    return 0;
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 1.0 pre-release build #16 powered by Captain Crunch Security Team | http://ccteam.ru | Generation time: 0.0031 ]--