!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.27 GB of 127.8 GB (40.9%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     foomatic-extract-text (4.46 KB)      -rwxr-xr-x
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
#!/usr/bin/perl -w   # -*- perl -*-

use Foomatic::Defaults;
use Foomatic::DB;
use strict;

sub write_po{
    my ($out, $messages) = @_;
    foreach (sort(keys %$messages)) {
    if ($_ eq '') {
        next;
    }
    my $translation = $messages->{$_};
    print $out "msgid \"$_\"\nmsgstr \"$translation\"\n\n";
    }
}

sub write_message_files {
    my ($messages) = @_;

    foreach (keys %$messages) {
    print "LANGUAGE: $_\n";
    open my $out, ">:encoding(utf-8)", "$_.po" or die;
    write_po($out, $messages->{$_});
    }
}

sub extract_ppd_old{
    my $file = $_[0];
    my %messages;


    if ($file =~ /ppd\.gz$/) {
    open(FILE, "zcat $file |") or die "Can't open file: $file";
    } else {
    open(FILE, $file);
    } 

    while (<FILE>){
    if ( /\*(\w+) (\w+)\/([^:]+): \"([^\"]*)\"/ ) {
        print $_, "'$1' '$2' '$3' '$4'\n\n"
    }
    #print
    }
    close FILE;
}


sub extract_from_db{
    my $messages = $_[0];

    my $db = Foomatic::DB->new();

    my @files = $db->_get_xml_filelist("source/opt");
    foreach my $file (@files){
    if ( $file =~ /[Mm]odel|^18$|^57$/ ) { 
        next; 
    }
    my $xml = $db->_get_object_xml("source/opt/$file");
    while ($xml =~ /\<[^\<\/]*longname\>.*?\<en\>(.*?)\<\/en\>/sg) {
        my $message = Foomatic::DB::unhtmlify($1); # xml unquoting
        $messages->{$message} = '';
    }
    }
}

sub extract_ppd{
    my ($db, $messages) = @_;
    my $args = $db->{"dat"}{"args_byname"};

    for my $option (keys %$args){
    $messages->{$args->{$option}{"comment"}} = "";
    #foreach (keys %{$args->{$option}}) {
    #    print $_, "\n";
    #}
    if ($args->{$option}{"type"} eq "bool"){
        $messages->{$args->{$option}{"comment_true"}} = '';
        $messages->{$args->{$option}{"comment_false"}} = '';
    } elsif ($args->{$option}{"type"} eq "enum") {
        for my $val (@{$args->{$option}{"vals"}}){
        $messages->{$val->{"comment"}} = '';
        }
    }
    }
    return;
    # old code:
    $a = $db->{"dat"}{"args_byname"}{"MediaType"}{"vals"}[0];
    print "$a\n\n";
    if (0){
        foreach my $val (@$a){
            print "$val\n";
        }
        return;
    }
    foreach my $name (keys %$a) {
    print "$name:\n";
    print $a->{$name}, "\n\n";
    if ($name != "compiled-at"){
        foreach (keys %{$db->{"dat"}{$name}}) {
        print $_, "\n";
        }
        print "\n";
    }
    }
}

sub get_translated_messages{
    my ($ppd_en, $ppd_lang, $translation) = @_;

    my $args_en = $ppd_en->{"dat"}{"args_byname"};
    my $args_lang = $ppd_lang->{"dat"}{"args_byname"};

    for my $option (keys %$args_en){
    $translation->{$args_en->{$option}{"comment"}} = 
        $args_lang->{$option}{"comment"};

    if ($args_en->{$option}{"type"} eq "bool"){
        $translation->{$args_en->{$option}{"comment_true"}} = 
        $args_lang->{$option}{"comment_true"}; 
        $translation->{$args_en->{$option}{"comment_false"}} =  
        $args_lang->{$option}{"comment_false"};
    } elsif ($args_en->{$option}{"type"} eq "enum") {
        for my $val (@{$args_en->{$option}{"vals"}}){
        my $value = $val->{"value"};
        for my $val_lang (@{$args_lang->{$option}{"vals"}}){
            if ($val_lang->{"value"} eq $value) {
            $translation->{$val->{"comment"}} = 
                $val_lang->{"comment"};
            };
        }
        }
    }
    }
}

sub extract_ppds{
    my ($path, $messages) = @_;
    my $ppds = { };
    my %language_names = ('English' => 'en',
              'French' => 'fr',
              'German' => 'de',
              'Italian' => 'it',
              'Japanese' => 'jp',
              'Portugse' => 'pt',
              'Portuguese' => 'pt',
              'Spanish' => 'es');

    # read ppds
    open(PPDS, "find $path -name \*.ppd\*|");
    while (<PPDS>){
    print substr($_, 0, -1), "\n";
    my $db = Foomatic::DB->new();
    $db->getdatfromppd(substr($_, 0, -1));
    my $makemodel = $db->{'dat'}{'makemodel'};
    $ppds->{$makemodel} = [] unless exists $ppds->{$makemodel};
    push @{$ppds->{$makemodel}}, $db;
    }
    foreach my $makemodel (keys %$ppds) {
    my $en_ppd;
    foreach my $ppd (@{$ppds->{$makemodel}}) {
        if ($ppd->{'dat'}{'language'} eq 'English') {
        $en_ppd = $ppd;
        last;
        }
    }
    foreach my $ppd (@{$ppds->{$makemodel}}) {
        my $lang = $ppd->{'dat'}{'language'};
        if (exists $language_names{$lang}) {
        $lang = $language_names{$lang};
        }
        $messages->{$lang} = {} unless exists $messages->{$lang};
        if ($lang ne 'en') {
        get_translated_messages($en_ppd, $ppd, $messages->{$lang});
        } else {
        extract_ppd($ppd, $messages->{$lang});
        }
    }
    }
}

sub main{
    my $messages = { };
    $messages->{'en'} = { }; 
    extract_from_db($messages->{'en'});
    extract_ppds("$libdir/db/source/PPD/", $messages);
    write_message_files($messages);
}

main();

:: 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.0062 ]--