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

Software: Apache/2.2.3 (CentOS). PHP/5.1.6 

uname -a: Linux mx-ll-110-164-51-230.static.3bb.co.th 2.6.18-194.el5PAE #1 SMP Fri Apr 2 15:37:44
EDT 2010 i686
 

uid=48(apache) gid=48(apache) groups=48(apache) 

Safe-mode: OFF (not secure)

/usr/sbin/   drwxr-xr-x
Free 52.29 GB of 127.8 GB (40.91%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     foomatic-printermap-to-gimp-print-xml (4.97 KB)      -rwxr-xr-x
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
#!/usr/bin/perl

# This script updates the printer list of the driver XML file of
# Gimp-Print (db/source/driver/gimp-print.xml in foomatic-db package)
# according to the file src/foomatic/foomatic-printermap of the source
# tarball of Gimp-Print 4.2.x or later.
#
# Remarks:
#
# - Manually added printer entries will not be removed. They drop out
#   to the beginning of the printer list during the update. The same
#   happens to printers which are removed from the new foomatic-printermap
#
# - All printers of foomatic-printermap are put to the end of the list,
#   the order of foomatic-printermap is preserved.
#
# - The user will be informed by screen messages if the new
#   foomatic-printermap contains new printers which were neither in the
#   previous foomatic-printermap nor under the manually added printers.
#
# - A printer which was added manually before and is in foomatic-printermap
#   now will be removed from the list of manually added printers and added
#   to the list of printers from foomatic-printermap.

#use strict;

# Read out the program name with which we were called, but discard the path
$0 =~ m!/([^/]+)\s*$!;
my $progname = $1;
my $debug = 0;

my ($opt_f, $opt_g, $opt_h);
use Getopt::Std;
getopts("f:g:h") or $opt_h = 1;
if ($opt_h) {
    print "
foomatic-printermap-to-gimp-print-xml [ -f  ] \
                              [ -g  ]
 -f : File src/foomatic/foomatic-printermap of
                    Gimp-Print source tarball (4.2.x or later). Default
                    is foomatic-printermap in the current directory

 -g : File gimp-print.xml whose printer list should be
                    updated. Default is the gimp-print.xml of the
                    Foomatic database currently in use.

This program updates the printer list of the driver XML file of
Gimp-Print (db/source/driver/gimp-print.xml in foomatic-db package)
according to the file src/foomatic/foomatic-printermap of the source
tarball of Gimp-Print 4.2.x or later.

";
    exit 0;
}

# Determine gimp-print.xml file
my $gimpprintxmlfile = $opt_g;
if (!$gimpprintxmlfile) {
    use Foomatic::Defaults;
    $gimpprintxmlfile = "$libdir/db/source/driver/gimp-print.xml";
}

# Determine foomatic-printermap file
my $foomaticprintermapfile = $opt_f;
if (!$foomaticprintermapfile) {
   $foomaticprintermapfile = "./foomatic-printermap";
}

# Read list of printer IDs from Gimp-Print's foomatic-printermap
open PM, "< $foomaticprintermapfile" or
    die "Cannot read $foomaticprintermapfile!\n";
my @printermap = ;
close PM;

(s/^\s*\S+\s+\S+\s+(\S+)\s*$/$1/) foreach @printermap;

#print $#printermap;

# Read gimp-print.xml
open GPX, "< $gimpprintxmlfile" or
    die "Cannot read $gimpprintxmlfile!\n";
my $gimpprintxml = join("", );
close GPX;

# Remove printer list
#$gimpprintxml =~ s!(<\s*printers\s*>).*(\n\s*<\s*/\s*printers\s*>)!$1$2!s;

# Mark beginning of printer list from foomatic-printermap before deleting
# these printer entries
$gimpprintxml =~ s:\n  :XXXXXXXXXX:s;

# Remove only those printers which are in foomatic-printermap. We
# re-add them in the next step, this way we have all printers of
# foomatic-printermap together and in the order of
# foomatic-printermap, and we have all manually added printers in the
# beginning of the list, before the printers of foomatic-printermap
# are listed.
print STDERR "Removing old printer entries ";
foreach my $printer (@printermap) {
    print STDERR ".";
    $gimpprintxml =~ s:\s*<\!\-\-[^<>]*?\-\->\s*\s*\s*$printer\s*.*?::s or
	$gimpprintxml =~ s:\s*\s*\s*$printer\s*.*?::s or 
	print STDERR "\n\nNew printer: $printer\n\n";
}
print STDERR "\n\n";

# Insert comment to mark the part of the list set up manually
$gimpprintxml =~ s:(\n\s*<\s*printers\s*>)\n\s*:$1:s;
$gimpprintxml =~ s:(\n\s*<\s*printers\s*>):$1\n  :s;

# Insert comment to mark the part of the list generated from
# foomatic-printermap
$gimpprintxml =~ s:\n  ::s;
$gimpprintxml =~ s:\n  ::s;
$gimpprintxml =~ s:XXXXXXXXXX:\n  :s;
$gimpprintxml =~ s:(\n\s*<\s*/\s*printers\s*>):\n  $1:s;

# Insert printers of foomatic-printermap to the end of the list
print STDERR "Inserting printer entries of foomatic-printermap ";
foreach my $printer (@printermap) {
    print STDERR ".";
    $gimpprintxml =~ s:(\n\s*<\s*/\s*printers\s*>):\n  \n   $printer\n  $1:s;
}
print STDERR "\n\n";

open GPX, "> $gimpprintxmlfile" or
    die "Cannot write $gimpprintxmlfile!\n";
print GPX $gimpprintxml;
close GPX;

exit 0;

bool(false)

:: Command execute ::

Enter:
 
Select:
 

:: Shadow's tricks :D ::

Useful Commands
 
Warning. Kernel may be alerted using higher levels
Kernel Info:

:: Preddy's tricks :D ::

Php Safe-Mode Bypass (Read Files)

File:

eg: /etc/passwd

Php Safe-Mode Bypass (List Directories):

Dir:

eg: /etc/

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

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

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

--[ c999shell v. 1.0 pre-release build #16 Modded by Shadow & Preddy | RootShell Security Group | r57 c99 shell | Generation time: 0.0059 ]--