PrivEscExample/._base000755 000766 000024 00000000336 12515243534 016520 0ustar00sarahkinirystaff000000 000000 Mac OS X  2¬ÞATTRÞ˜F˜Fcom.apple.quarantineq/0001;5535474c;Google\x20Chrome;F4927B07-585C-46DF-87A9-56BF432C027EPrivEscExample/base/000755 000766 000024 00000000000 12515243534 016353 5ustar00sarahkinirystaff000000 000000 PrivEscExample/base/._.DS_Store000644 000766 000024 00000000170 12515245115 020246 0ustar00sarahkinirystaff000000 000000 Mac OS X  2Fx ATTRxxPrivEscExample/base/.DS_Store000644 000766 000024 00000014004 12515245115 020032 0ustar00sarahkinirystaff000000 000000 Bud1 tendbwspfrontendbwspblobùbplist00Ù  ]ShowStatusBar[ShowSidebar[ShowPathbar[ShowToolbar[ShowTabView_ContainerShowSidebar\WindowBounds\SidebarWidth_PreviewPaneVisibility   _{{121, 420}, {770, 437}}À)5AMYp}Š¢£¤¥¦§¨ÃÅÆfrontenddsclbool  @€ @€ @€ @ E DSDB `€ @€ @€ @PrivEscExample/base/._frontend000755 000766 000024 00000000336 12515243542 020336 0ustar00sarahkinirystaff000000 000000 Mac OS X  2¬ÞATTRÞ˜F˜Fcom.apple.quarantineq/0001;5535474c;Google\x20Chrome;F4927B07-585C-46DF-87A9-56BF432C027EPrivEscExample/base/frontend/000755 000766 000024 00000000000 12515243542 020171 5ustar00sarahkinirystaff000000 000000 PrivEscExample/base/frontend/._.DS_Store000644 000766 000024 00000000170 12515243547 022074 0ustar00sarahkinirystaff000000 000000 Mac OS X  2Fx ATTRxxPrivEscExample/base/frontend/.DS_Store000644 000766 000024 00000014004 12515243547 021660 0ustar00sarahkinirystaff000000 000000 Bud1 blobúbplix3bwspblobúbplist00Ù  ]ShowStatusBar[ShowSidebar[ShowPathbar[ShowToolbar[ShowTabView_ContainerShowSidebar\WindowBounds\SidebarWidth_PreviewPaneVisibility   _{{1393, 253}, {770, 437}}À)5AMYp}Š¢£¤¥¦§¨ÄÆÇ  @€ @€ @€ @ E DSDB `€ @€ @€ @PrivEscExample/base/frontend/._x3000755 000766 000024 00000000336 12165641510 020666 0ustar00sarahkinirystaff000000 000000 Mac OS X  2¬ÞATTRÞ˜F˜Fcom.apple.quarantineq/0001;5535474c;Google\x20Chrome;F4927B07-585C-46DF-87A9-56BF432C027EPrivEscExample/base/frontend/x3/000755 000766 000024 00000000000 12165641510 020521 5ustar00sarahkinirystaff000000 000000 PrivEscExample/base/frontend/x3/._myexample.live.pl000755 000766 000024 00000000336 12165641510 024237 0ustar00sarahkinirystaff000000 000000 Mac OS X  2¬ÞATTRÞ˜F˜Fcom.apple.quarantineq/0001;5535474c;Google\x20Chrome;F4927B07-585C-46DF-87A9-56BF432C027EPrivEscExample/base/frontend/x3/myexample.live.pl000755 000766 000024 00000002573 12165641510 024027 0ustar00sarahkinirystaff000000 000000 #!/usr/local/cpanel/3rdparty/bin/perl BEGIN { unshift @INC, '/usr/local/cpanel'; } use Cpanel::LiveAPI (); use Data::Dumper (); use Cpanel::Wrap (); sub do_MyExample_stuff { my $thing_to_do = shift; my $string_to_mess_with = shift; my $result = Cpanel::Wrap::send_cpwrapd_request( 'namespace' => 'MyNamespace', 'module' => 'MyExample', 'function' => $thing_to_do, 'data' => $string_to_mess_with ); if ( $result->{'error'} ) { return "Error code $result->{'exit_code'} returned: $result->{'data'}"; } elsif ( ref( $result->{'data'} ) ) { return Data::Dumper::Dumper( $result->{'data'} ); } elsif ( defined( $result->{'data'} ) ) { return $result->{'data'}; } return 'cpwrapd request failed: ' . $result->{'statusmsg'}; } my $cpanel = Cpanel::LiveAPI->new(); print "Content-type: text/html\r\n\r\n"; print "
";

print "ECHO test:\n" . do_MyExample_stuff( "ECHO", "Hello, World!" ) . "\n\n";
print "MIRROR test:\n" . do_MyExample_stuff( "MIRROR", "Hello, World!" ) . "\n\n";
print "BOUNCY test:\n" . do_MyExample_stuff( "BOUNCY", "Hello, World!" ) . "\n\n";
print "HASHIFY test:\n" . do_MyExample_stuff( "HASHIFY", "Hello, World!" ) . "\n\n";
print "WRONG test:\n" . do_MyExample_stuff( "WRONG", "Hello, World!" ) . "\n\n";

print "test complete!\n";
$cpanel->end();

PrivEscExample/._bin000755 000766 000024 00000000336 12515245122 016351 0ustar00sarahkinirystaff000000 000000 Mac OS X        	2¬ÞATTRÞ˜F˜Fcom.apple.quarantineq/0001;5535474c;Google\x20Chrome;F4927B07-585C-46DF-87A9-56BF432C027EPrivEscExample/bin/000755 000766 000024 00000000000 12515245122 016204 5ustar00sarahkinirystaff000000 000000 PrivEscExample/bin/._.DS_Store000644 000766 000024 00000000170 12515245122 020102 0ustar00sarahkinirystaff000000 000000 Mac OS X        	2Fx        ATTRxxPrivEscExample/bin/.DS_Store000644 000766 000024 00000014004 12515245122 017666 0ustar00sarahkinirystaff000000 000000 Bud1%admindsclboolndsclbool @€ @€ @€ @E%DSDB`€ @€ @€ @PrivEscExample/bin/._admin000755 000766 000024 00000000336 12515245122 017441 0ustar00sarahkinirystaff000000 000000 Mac OS X        	2¬ÞATTRÞ˜F˜Fcom.apple.quarantineq/0001;5535474c;Google\x20Chrome;F4927B07-585C-46DF-87A9-56BF432C027EPrivEscExample/bin/admin/000755 000766 000024 00000000000 12515245122 017274 5ustar00sarahkinirystaff000000 000000 PrivEscExample/bin/admin/._.DS_Store000644 000766 000024 00000000170 12515245122 021172 0ustar00sarahkinirystaff000000 000000 Mac OS X        	2Fx        ATTRxxPrivEscExample/bin/admin/.DS_Store000644 000766 000024 00000014004 12515245122 020756 0ustar00sarahkinirystaff000000 000000 Bud1†mespacMyNamespacedsclbool @€ @€ @€ @E†DSDB `À @€ @€ @PrivEscExample/bin/admin/._MyNamespace000755 000766 000024 00000000336 12515245325 021650 0ustar00sarahkinirystaff000000 000000 Mac OS X        	2¬ÞATTRÞ˜F˜Fcom.apple.quarantineq/0001;5535474c;Google\x20Chrome;F4927B07-585C-46DF-87A9-56BF432C027EPrivEscExample/bin/admin/MyNamespace/000755 000766 000024 00000000000 12515245325 021503 5ustar00sarahkinirystaff000000 000000 PrivEscExample/bin/admin/MyNamespace/._MyExample000755 000766 000024 00000000336 12515245325 023551 0ustar00sarahkinirystaff000000 000000 Mac OS X        	2¬ÞATTRÞ˜F˜Fcom.apple.quarantineq/0041;5535474c;Google\x20Chrome;F4927B07-585C-46DF-87A9-56BF432C027EPrivEscExample/bin/admin/MyNamespace/MyExample000755 000766 000024 00000002500 12515245325 023327 0ustar00sarahkinirystaff000000 000000 #!/usr/local/cpanel/3rdparty/bin/perl

use strict;
use Cpanel::AdminBin::Serializer ();
use Cpanel::Logger               ();
use Cpanel::PwCache              ();

my $stdin = ;
chomp $stdin;
my ( $uid, $function, $data ) = split( / /, $stdin, 3 );

# sanitize the input; in this case, only alphanumeric, underscore, space, period, and exclamation are allowed
$data =~ s/^[\w \.\!]//g;

# make a note in the logs!
my $user   = ( Cpanel::PwCache::getpwuid($uid) )[0];
my $logger = Cpanel::Logger->new();
$logger->warn("Myexample called by user $user with function: $function");

if ( $function eq 'ECHO' ) {
    print $data;
    exit(0);
}

elsif ( $function eq 'MIRROR' ) {
    print scalar reverse($data);
    exit(0);
}

elsif ( $function eq 'BOUNCY' ) {
    print _bouncy($data);
    exit(0);
}

elsif ( $function eq 'HASHIFY' ) {
    print ".\n" . Cpanel::AdminBin::Serializer::Dump( { 'ourdata' => $data } );
    exit(0);
}

else {
    print "Invalid function specified to MyExample adminbin function";
    exit(1);
}

1;

sub _bouncy {
    my $data_in  = shift;
    my $data_out = q{};
    for my $i ( 0 .. length($data_in) - 1 ) {
        if ( $i % 2 ) {
            $data_out .= substr( $data_in, $i, 1 );
        }
        else {
            $data_out .= uc( substr( $data_in, $i, 1 ) );
        }
    }
    return $data_out;
}

PrivEscExample/bin/admin/MyNamespace/._MyExample.conf000644 000766 000024 00000000336 12165641626 024477 0ustar00sarahkinirystaff000000 000000 Mac OS X        	2¬ÞATTRÞ˜F˜Fcom.apple.quarantineq/0001;5535474c;Google\x20Chrome;F4927B07-585C-46DF-87A9-56BF432C027EPrivEscExample/bin/admin/MyNamespace/MyExample.conf000644 000766 000024 00000000014 12165641626 024253 0ustar00sarahkinirystaff000000 000000 mode=simple