!C99Shell v. 2.0 [PHP 7 Update] [25.02.2019]!

Software: nginx/1.23.4. PHP/5.6.40-65+ubuntu20.04.1+deb.sury.org+1 

uname -a: Linux foro-restaurado-2 5.15.0-1040-oracle #46-Ubuntu SMP Fri Jul 14 21:47:21 UTC 2023
aarch64
 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/home/scripts/pba/phc-read-only/src/lib/   drwxrwxr-x
Free 83.21 GB of 96.73 GB (86.02%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     base64.cpp (2.21 KB)      -rw-rw-r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
/*
 * phc -- the open source PHP compiler
 * See doc/license/README.license for licensing information
 *
 * Base64 encoder/decoder. See RFC2045.
 */

#include "lib/String.h"
#include <iostream>
#include <sstream>

using namespace std;

static char enc_table[] = 
    "ABCDEFGHIJKLMNOPQ"
    "RSTUVWXYZabcdefgh"
    "ijklmnopqrstuvwxy"
    "z0123456789+/";

// Reverse of the enc_table
// Return 0xFF for padding bytes
unsigned char decode(unsigned char c)
{
    if(c >= 'A' && c <= 'Z') 
        return c - 'A';

    if(c >= 'a' && c <= 'z')
        return c - 'a' + 26;

    if(c >= '0' && c <= '9')
        return c - '0' + 26 + 26;

    if(c == '+')
        return 26 + 26 + 10;
    
    if(c == '/')
        return 26 + 26 + 10 + 1;

    if(c == '=')
        return 0xFF;

    assert(false);
    return 0;
}

#define TRIPLE_TO_QUAD \
    a = (x & 0xFC) >> 2; \
    b = ((x & 0x03) << 4) | ((y & 0xF0) >> 4); \
    c = ((y & 0x0F) << 2) | ((z & 0xC0) >> 6); \
    d = z & 0x3F;

#define QUAD_TO_TRIPLE \
    x = (a << 2) | ((b & 0x30) >> 4); \
    y = ((b & 0x0F) << 4) | ((c & 0x3C) >> 2); \
    z = ((c & 0x03) << 6) | d;

String* base64_encode(String* str)
{
    String::const_iterator i = str->begin();
    ostringstream os;
    unsigned char x, y, z;
    unsigned char a, b, c, d;

    while(i != str->end())
    {
        x = *i++;
        if(i == str->end())
        {
            // Two padding bytes
            y = 0;
            z = 0;
            TRIPLE_TO_QUAD;
            os << enc_table[a];
            os << enc_table[b];
            os << '=';
            os << '=';
            break;
        }

        y = *i++;
        if(i == str->end())
        {
            // One padding byte
            z = 0;
            TRIPLE_TO_QUAD;
            os << enc_table[a];
            os << enc_table[b];
            os << enc_table[c];
            os << '=';
            break;
        }

        z = *i++;
        TRIPLE_TO_QUAD;

        os << enc_table[a];
        os << enc_table[b];
        os << enc_table[c];
        os << enc_table[d];
    }

    return new String(os.str());
}

String* base64_decode(String* str)
{
    String::const_iterator i = str->begin();
    ostringstream os;
    unsigned char x, y, z;
    unsigned char a, b, c, d;

    while(i != str->end())
    {
        a = decode(*i++);
        b = decode(*i++);
        c = decode(*i++);
        d = decode(*i++);

        if(c == 0xFF)
        {
            // Two padding bytes
            QUAD_TO_TRIPLE;
            os << x;
            break;
        }
        
        if(d == 0xFF)
        {
            // One padding byte
            QUAD_TO_TRIPLE;
            os << x << y;
            break;
        }

        QUAD_TO_TRIPLE;
        os << x << y << z;
    }

    return new String(os.str());
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.0 [PHP 7 Update] [25.02.2019] maintained by HackingTool | HackingTool | Generation time: 0.0043 ]--