403Webshell
Server IP : 104.21.38.3  /  Your IP : 172.68.242.43
Web Server : Apache
System : Linux krdc-ubuntu-s-2vcpu-4gb-amd-blr1-01.localdomain 5.15.0-142-generic #152-Ubuntu SMP Mon May 19 10:54:31 UTC 2025 x86_64
User : www ( 1000)
PHP Version : 7.4.33
Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /lib/python3/dist-packages/jeepney/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/jeepney/bus.py
import os
import re

_escape_pat = re.compile(r'%([0-9A-Fa-f]{2})')
def unescape(v):
    def repl(match):
        n = int(match.group(1), base=16)
        return chr(n)
    return _escape_pat.sub(repl, v)

def parse_addresses(s):
    for addr in s.split(';'):
        transport, info = addr.split(':', 1)
        kv = {}
        for x in info.split(','):
            k, v = x.split('=', 1)
            kv[k] = unescape(v)
        yield (transport, kv)

SUPPORTED_TRANSPORTS = ('unix',)

def get_connectable_addresses(addr):
    unsupported_transports = set()
    found = False
    for transport, kv in parse_addresses(addr):
        if transport not in SUPPORTED_TRANSPORTS:
            unsupported_transports.add(transport)

        elif transport == 'unix':
            if 'abstract' in kv:
                yield '\0' + kv['abstract']
                found = True
            elif 'path' in kv:
                yield kv['path']
                found = True

    if not found:
        raise RuntimeError("DBus transports ({}) not supported. Supported: {}"
                           .format(unsupported_transports, SUPPORTED_TRANSPORTS))

def find_session_bus():
    addr = os.environ['DBUS_SESSION_BUS_ADDRESS']
    return next(get_connectable_addresses(addr))
    # TODO: fallbacks to X, filesystem

def find_system_bus():
    addr = os.environ.get('DBUS_SYSTEM_BUS_ADDRESS', '') \
        or 'unix:path=/var/run/dbus/system_bus_socket'
    return next(get_connectable_addresses(addr))

def get_bus(addr):
    if addr == 'SESSION':
        return find_session_bus()
    elif addr == 'SYSTEM':
        return find_system_bus()
    else:
        return next(get_connectable_addresses(addr))


if __name__ == '__main__':
    print('System bus at:', find_system_bus())
    print('Session bus at:', find_session_bus())

Youez - 2016 - github.com/yon3zu
LinuXploit