404

[ Avaa Bypassed ]




Upload:

Command:

elspacio@18.189.188.199: ~ $
3

�^l$�@s�ddlZddlZddlmZmZddlmZmZddlm	Z	m
Z
ddlmZm
Z
ddlmZmZmZGdd	�d	ejejej�ZdS)
�N�)�mixins�query)�CriteriaDescriptor�CriteriaSetDescriptor)�RuleUseError�RuleNotConditional)�IoctlSet�
TERuletype)�match_regex�match_indirect_regex�match_regex_or_setcs�eZdZdZeed�Zedd�ZdZ	dZ
edd�ZdZdZ
edd�ZdZed	d
�ZdZdZdZdZedd
��Zejdd
��Z�fdd�Zdd�Z�ZS)�TERuleQueryae

    Query the Type Enforcement rules.

    Parameter:
    policy            The policy to query.

    Keyword Parameters/Class attributes:
    ruletype          The list of rule type(s) to match.
    source            The name of the source type/attribute to match.
    source_indirect   If true, members of an attribute will be
                      matched rather than the attribute itself.
                      Default is true.
    source_regex      If true, regular expression matching will
                      be used on the source type/attribute.
                      Obeys the source_indirect option.
                      Default is false.
    target            The name of the target type/attribute to match.
    target_indirect   If true, members of an attribute will be
                      matched rather than the attribute itself.
                      Default is true.
    target_regex      If true, regular expression matching will
                      be used on the target type/attribute.
                      Obeys target_indirect option.
                      Default is false.
    tclass            The object class(es) to match.
    tclass_regex      If true, use a regular expression for
                      matching the rule's object class.
                      Default is false.
    perms             The set of permission(s) to match.
    perms_equal       If true, the permission set of the rule
                      must exactly match the permissions
                      criteria.  If false, any set intersection
                      will match.
                      Default is false.
    perms_regex       If true, regular expression matching will be used
                      on the permission names instead of set logic.
                      Default is false.
    perms_subset      If true, the rule matches if the permissions criteria
                      is a subset of the rule's permission set.
                      Default is false.
    default           The name of the default type to match.
    default_regex     If true, regular expression matching will be
                      used on the default type.
                      Default is false.
    boolean           The set of boolean(s) to match.
    boolean_regex     If true, regular expression matching will be
                      used on the booleans.
                      Default is false.
    boolean_equal     If true, the booleans in the conditional
                      expression of the rule must exactly match the
                      criteria.  If false, any set intersection
                      will match.  Default is false.
    )�
enum_class�source_regexZlookup_type_or_attrFT�target_regex�
default_regex�
boolean_regexZlookup_booleanNcCs|jS)N)�_xperms)�self�r�#/usr/lib64/python3.6/terulequery.py�xpermsdszTERuleQuery.xpermscCs�|r�t�}x�|D]�\}}d|ko*dkns>tdj|���d|koPdknsdtdj|���||krv||}}|jdd�t||d�D��qWt|�|_nd|_dS)Nri��z{0:#07x} is not a valid ioctl.css|]
}|VqdS)Nr)�.0�irrr�	<genexpr>wsz%TERuleQuery.xperms.<locals>.<genexpr>r)�set�
ValueError�format�update�ranger	r)r�valueZpending_xpermsZlowZhighrrrrhs
"cs$tt|�j|f|�tjt�|_dS)N)�superr�__init__�loggingZ	getLogger�__name__�log)r�policy�kwargs)�	__class__rrr#}szTERuleQuery.__init__c$csB|jjdj|��|jjdj|��|jjdj|��|jjdj|��|j|j�|j|j�|jjdj|��|jjdj|��|jjdj|���x�|jj�D�]�}|jr�|j|jkr�q�|j	r�t
|j	|j	|j|j�r�q�|j
r�t
|j
|j
|j|j�r�q�|j|��sq�yN|j�rJ|j�rJ|j�r8t|j�dk�r8w�|j|jk�rXw�n|j|��sXw�Wntk
�rrw�YnXy&|j�r�t|j|j|jd	��r�w�Wntk
�r�w�YnX|j�r�yt
|j|jd
|j��s�w�Wntk
�r�w�YnX|j�r4y t|jj|j|j |j!��sw�Wnt"k
�r2w�YnX|Vq�WdS)z-Generator which yields all matching TE rules.z*Generating TE rule results from {0.policy}zRuletypes: {0.ruletype}zLSource: {0.source!r}, indirect: {0.source_indirect}, regex: {0.source_regex}zLTarget: {0.target!r}, indirect: {0.target_indirect}, regex: {0.target_regex}z*Xperms: {0.xperms!r}, eq: {0.xperms_equal}z0Default: {0.default!r}, regex: {0.default_regex}zGBoolean: {0.boolean!r}, eq: {0.boolean_equal}, regex: {0.boolean_regex}rFTN)#r&�infor�debugZ_match_object_class_debugZ_match_perms_debugr'Zterules�ruletype�sourcer�source_indirectr�target�target_indirectrZ_match_object_classZpermsZextendedZperms_equal�lenZ
xperm_typeZ_match_permsrrr
�xperms_equal�defaultr�booleanZconditionalZbooleans�
boolean_equalrr)rZrulerrr�results�s�








zTERuleQuery.results)r%�
__module__�__qualname__�__doc__rr
r,rr-rr.r/rr0r3rr4rr5rr2�propertyr�setterr#r6�
__classcell__rr)r)rrs&6




r)r$�re�rrZdescriptorsrrZ	exceptionrrZ	policyrepr	r
�utilrrr
Z
MatchObjClassZMatchPermissionZPolicyQueryrrrrr�<module>s

Filemanager

Name Type Size Permission Actions
__init__.cpython-36.opt-1.pyc File 2.34 KB 0644
__init__.cpython-36.pyc File 2.34 KB 0644
boolquery.cpython-36.opt-1.pyc File 1.8 KB 0644
boolquery.cpython-36.pyc File 1.8 KB 0644
boundsquery.cpython-36.opt-1.pyc File 1.67 KB 0644
boundsquery.cpython-36.pyc File 1.67 KB 0644
categoryquery.cpython-36.opt-1.pyc File 1.49 KB 0644
categoryquery.cpython-36.pyc File 1.49 KB 0644
commonquery.cpython-36.opt-1.pyc File 1.71 KB 0644
commonquery.cpython-36.pyc File 1.71 KB 0644
constraintquery.cpython-36.opt-1.pyc File 4.42 KB 0644
constraintquery.cpython-36.pyc File 4.42 KB 0644
defaultquery.cpython-36.opt-1.pyc File 2.12 KB 0644
defaultquery.cpython-36.pyc File 2.12 KB 0644
descriptors.cpython-36.opt-1.pyc File 7.36 KB 0644
descriptors.cpython-36.pyc File 7.56 KB 0644
devicetreeconquery.cpython-36.opt-1.pyc File 2.31 KB 0644
devicetreeconquery.cpython-36.pyc File 2.31 KB 0644
dta.cpython-36.opt-1.pyc File 13.23 KB 0644
dta.cpython-36.pyc File 13.23 KB 0644
exception.cpython-36.opt-1.pyc File 8.63 KB 0644
exception.cpython-36.pyc File 8.63 KB 0644
fsusequery.cpython-36.opt-1.pyc File 2.81 KB 0644
fsusequery.cpython-36.pyc File 2.81 KB 0644
genfsconquery.cpython-36.opt-1.pyc File 2.96 KB 0644
genfsconquery.cpython-36.pyc File 2.96 KB 0644
ibendportconquery.cpython-36.opt-1.pyc File 3.01 KB 0644
ibendportconquery.cpython-36.pyc File 3.01 KB 0644
ibpkeyconquery.cpython-36.opt-1.pyc File 4.22 KB 0644
ibpkeyconquery.cpython-36.pyc File 4.22 KB 0644
infoflow.cpython-36.opt-1.pyc File 11.33 KB 0644
infoflow.cpython-36.pyc File 11.33 KB 0644
initsidquery.cpython-36.opt-1.pyc File 2.41 KB 0644
initsidquery.cpython-36.pyc File 2.41 KB 0644
iomemconquery.cpython-36.opt-1.pyc File 3.67 KB 0644
iomemconquery.cpython-36.pyc File 3.67 KB 0644
ioportconquery.cpython-36.opt-1.pyc File 3.67 KB 0644
ioportconquery.cpython-36.pyc File 3.67 KB 0644
mixins.cpython-36.opt-1.pyc File 6.31 KB 0644
mixins.cpython-36.pyc File 6.31 KB 0644
mlsrulequery.cpython-36.opt-1.pyc File 2.95 KB 0644
mlsrulequery.cpython-36.pyc File 2.95 KB 0644
netifconquery.cpython-36.opt-1.pyc File 2.48 KB 0644
netifconquery.cpython-36.pyc File 2.48 KB 0644
nodeconquery.cpython-36.opt-1.pyc File 3.53 KB 0644
nodeconquery.cpython-36.pyc File 3.53 KB 0644
objclassquery.cpython-36.opt-1.pyc File 2.87 KB 0644
objclassquery.cpython-36.pyc File 2.87 KB 0644
pcideviceconquery.cpython-36.opt-1.pyc File 2.65 KB 0644
pcideviceconquery.cpython-36.pyc File 2.65 KB 0644
permmap.cpython-36.opt-1.pyc File 11.67 KB 0644
permmap.cpython-36.pyc File 11.9 KB 0644
pirqconquery.cpython-36.opt-1.pyc File 2.58 KB 0644
pirqconquery.cpython-36.pyc File 2.58 KB 0644
polcapquery.cpython-36.opt-1.pyc File 1.29 KB 0644
polcapquery.cpython-36.pyc File 1.29 KB 0644
portconquery.cpython-36.opt-1.pyc File 4.21 KB 0644
portconquery.cpython-36.pyc File 4.21 KB 0644
query.cpython-36.opt-1.pyc File 1003 B 0644
query.cpython-36.pyc File 1003 B 0644
rbacrulequery.cpython-36.opt-1.pyc File 3.75 KB 0644
rbacrulequery.cpython-36.pyc File 3.75 KB 0644
rolequery.cpython-36.opt-1.pyc File 1.94 KB 0644
rolequery.cpython-36.pyc File 1.94 KB 0644
sensitivityquery.cpython-36.opt-1.pyc File 2.12 KB 0644
sensitivityquery.cpython-36.pyc File 2.12 KB 0644
terulequery.cpython-36.opt-1.pyc File 6.13 KB 0644
terulequery.cpython-36.pyc File 6.13 KB 0644
typeattrquery.cpython-36.opt-1.pyc File 2.09 KB 0644
typeattrquery.cpython-36.pyc File 2.09 KB 0644
typequery.cpython-36.opt-1.pyc File 2.81 KB 0644
typequery.cpython-36.pyc File 2.81 KB 0644
userquery.cpython-36.opt-1.pyc File 3.64 KB 0644
userquery.cpython-36.pyc File 3.64 KB 0644
util.cpython-36.opt-1.pyc File 4.59 KB 0644
util.cpython-36.pyc File 4.59 KB 0644