!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:     edit_hostconfig.cgi (6.11 KB)      -rwxr-xr-x
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
#!/usr/bin/perl
# edit_hostconfig.cgi
#
# Edit the settings in the hostconfig file, or the
# StartupItems script or plist associated with the
# action described in the hostconfig file.
#
# Also create a new startup action with associated script and plist
# and manually modify hostconfig file.

require './init-lib.pl';
require './hostconfig-lib.pl';
use File::Basename;
$access{'bootup'} == 1 || &error($text{'edit_ecannot'});

$ty = $ARGV[0];
if ($ty == 0) {
    # Editing an existing action in /etc/hostconfig
    $action_to_edit = $ARGV[1];
    &ui_print_header(undef, $text{'edit_title'}, "");
    %startuphash = &hostconfig_gather(startscript);
    $startscript = $startuphash{"$action_to_edit"};
    if ( $startscript ne "") {
        $startupdir = dirname("$startscript");
        $plistedit = "$startupdir/$config{'plist'}";
        }
    else {
        $plistedit = "";
        }

    #create the action edit table
    $actionedit = &hostconfig_editaction("$action_to_edit", "$startscript");
    print "<form action=modifyhostconfig.cgi method=post name=hostmod>\n";
    print "<table width=\"100%\" border><tr $tb> <td><b>", &text('index_action'), "</b></td>\n";
    print "<td><b>", &text('index_setting'), "</b></td></tr>\n";
    print "<tr $cb><td valign=middle>$action_to_edit</td>\n";
    print "<td>$actionedit</td></tr></table>\n";
    print "<input type=submit value='$text{'save'}'></form>\n";
    
    
    #create the edit file forms
    if ($startscript ne "") {
        print &ui_hr();
        print &text('edit_hostconfig_startup',
            "<tt>$startscript</tt>"),"<br>\n";
        #    }
        print "<form action=save_startscript.cgi method=post>\n";
        print "<textarea name=startup rows=20 cols=80>";
        open(STARTSCRIPT, $startscript);
        while(<STARTSCRIPT>) { print; }
        close(STARTSCRIPT);
        print "</textarea><br>\n";
        print "<input type=hidden name=\"action\" value=\"$action_to_edit\">\n";
        print "<input type=submit value='$text{'save'}'></form>\n";
        }
    if ($plistedit ne "") {
        print &ui_hr();
        print &text('edit_hostconfig_plist',
            "<tt>$plistedit</tt>"),"<br>\n";
        #    }
        print "<form action=save_startscript.cgi method=post>\n";
        print "<textarea name=plist rows=20 cols=80>";
        open(PLIST, $plistedit);
        while(<PLIST>) { print; }
        close(PLIST);
        print "</textarea><br>\n";
        print "<input type=hidden name=\"action\" value=\"$action_to_edit\">\n";
#        print "$plistedit</textarea><br>\n";
        print "<input type=submit value='$text{'save'}'></form>\n";
        }
    }

if ($ty == 1) {
    &ui_print_header(undef, $text{'edit_hostconfig_new'}, "");
    print "<HR>\n";

    print "<P>\n", &text('edit_hostconfig_noquotes',
        "<tt>$text{'edit_start'}</tt>"),"\n";

    print "<P>\n", &text('edit_hostconfig_startitems',
        "<tt>$text{'edit_hostconfig_actionname'}</tt>",
        "<tt>$text{'edit_hostconfig_scriptname'}</tt>"),"\n";

    print "<P>\n", &text('edit_hostconfig_array',
        "<tt>Provides</tt>", "<tt>Requires</tt>", "<tt>Uses</tt>"),"\n";
    
    print "<P>\n $text{'edit_hostconfig_further'}\n";

    #print "<form method=post action=save_hostconfig_action.cgi enctype=multipart/form-data>\n";
    print "<form method=post action=save_hostconfig_action.cgi>\n";
    print "<table border>\n";
    print "<tr $tb><td><b>Action Details</b></td></tr>\n";
    print "<tr $cb><td><table cellpadding=3>\n";

    # create the form fields

    $textt=&hostconfig_createtext("Action Name","req");
    print "<tr>", &hostconfig_createtext("$text{'edit_hostconfig_actionname'}","req");
    print "<td><input size=20 name=action_name value=\"\"></td></tr>\n";
    
    print "<tr>", &hostconfig_createtext("$text{'edit_hostconfig_scriptname'}","req");
    print "<td><input size=20 name=script_name value=\"\"></td></tr>\n";

    print "<tr>", &hostconfig_createtext("$text{'edit_start'}","req");
    print "<td><font size=-1><textarea rows=5 cols=80 name=execute></textarea></font></td></tr>\n";

    print "<tr>", &hostconfig_createtext("$text{'index_desc'}","");
    print "<td><input size=60 name=description value=\"\"></td></tr>\n";

    print "<tr>", &hostconfig_createtext("Provides","");
    print "<td><input size=60 name=provides value=\"\"></td></tr>\n";

    print "<tr>", &hostconfig_createtext("Requires","");
    print "<td><input size=60 name=requires value=\"\"></td></tr>\n";

    print "<tr>", &hostconfig_createtext("Uses","");
    print "<td><input size=60 name=uses value=\"\"></td></tr>\n";

    print "<tr>", &hostconfig_createtext("OrderPreference","");
    print "<td><SELECT name=order><option value=First>First<option value=Early>Early<option value=None selected>None<option value=Late>Late<option value=Last>Last</select></td></tr>\n";

    print "<tr>", &hostconfig_createtext("Start Message","");
    print "<td><input size=60 name=start value=\"\"></td></tr>\n";

    print "<tr>", &hostconfig_createtext("Stop Message","");
    print "<td><input size=60 name=stop value=\"\"></td></tr>\n";

    print "<tr>", &hostconfig_createtext("Start at boot time?","");
    print "<td><input name=boot type=radio value=\"-YES-\"> Yes\n";
    print "<input name=boot type=radio value=\"-NO-\" checked> No</td></tr>\n";

    print "<tr><td><font size=-1 color=#ff0000>* required field</font></td><td> </td></tr>\n";
    print "</table>";
    print "</td></tr></table>\n";
    print "<input type=submit value=\"Create\"></form>\n";

    }

if ($ty == 2) {
    
    &ui_print_header(undef, $text{'edit_hostconfig_title'}, "");
    print &text('edit_hostconfig_hostconfig',
        "<tt>$config{'hostconfig'}</tt>"),"<br>\n";
    print "<form action=save_startscript.cgi method=post>\n";
    print "<textarea name=hostconfig rows=20 cols=80>";
    open(LOCAL, $config{'hostconfig'});
    while(<LOCAL>) { print; }
    close(LOCAL);
    print "</textarea><br>\n";
    print "<input type=submit value='$text{'save'}'></form>\n";
    print &ui_hr();

    #add reboot and shutdown messages to this page as well...
    print "<table cellpadding=5 width=100%>\n";
    if ($access{'reboot'}) {
        print "<form action=reboot.cgi>\n";
        print "<tr> <td><input type=submit ",
            "value=\"$text{'index_reboot'}\"></td>\n";
        print "</form>\n";
        print "<td>$text{'index_rebootmsg'}</td> </tr>\n";
        }

    if ($access{'shutdown'}) {
        print "<form action=shutdown.cgi>\n";
        print "<tr> <td><input type=submit ",
            "value=\"$text{'index_shutdown'}\"></td>\n";
        print "</form>\n";
        print "<td>$text{'index_shutdownmsg'}</td> </tr>\n";
        }
    print "</table>\n";
    }
    
&ui_print_footer("", $text{'index_return'});

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