ROOTPLOIT
Server: LiteSpeed
System: Linux server71.web-hosting.com 4.18.0-513.18.1.lve.el8.x86_64 #1 SMP Thu Feb 22 12:55:50 UTC 2024 x86_64
User: niphet (1079)
PHP: 5.3.29
Disabled: NONE
Upload Files
File: //lib/python3.6/site-packages/firewall/__pycache__/dbus_utils.cpython-36.pyc
3

gJ@sdddddddddd	d
gZddlZddlZddlZdd
lmZddlmZejdkZ	ddZ
ddZddZddZ
ddZddZddZdddZddZddd	Zdd
ZdS)command_of_pid
pid_of_sender
uid_of_senderuser_of_uidcontext_of_sendercommand_of_senderuser_of_senderdbus_to_pythondbus_signature%dbus_introspection_prepare_properties!dbus_introspection_add_propertiesN)minidom)log3cCsPy6td|d}|jdjddj}WdQRXWntk
rJdSX|S)z  Get command for pid from /proc z/proc/%d/cmdlinerr N)open	readlinesreplacestrip	Exception)pidfcmdr /usr/lib/python3.6/dbus_utils.pyr%s&cCsD|jdd}tj|d}yt|j|}Wntk
r>dSX|S)zW Get pid from sender string using 
    org.freedesktop.DBus.GetConnectionUnixProcessID zorg.freedesktop.DBusz/org/freedesktop/DBusN)
get_objectdbus	InterfaceintZGetConnectionUnixProcessID
ValueError)bussenderdbus_obj
dbus_ifacerrrrr.scCsD|jdd}tj|d}yt|j|}Wntk
r>dSX|S)zV Get user id from sender string using 
    org.freedesktop.DBus.GetConnectionUnixUser zorg.freedesktop.DBusz/org/freedesktop/DBusN)rrrr ZGetConnectionUnixUserr!)r"r#r$r%uidrrrr;scCs,ytj|}Wntk
r"dSX|dS)z Get user for uid from pwd Nr)pwdgetpwuidr)r&ZpwsrrrrHs
c
CsP|jdd}tj|d}y|j|}Wntk
r:dSXdjttt|S)zl Get SELinux context from sender string using 
    org.freedesktop.DBus.GetConnectionSELinuxSecurityContext zorg.freedesktop.DBusz/org/freedesktop/DBusN)	rrrZ#GetConnectionSELinuxSecurityContextrjoinmapchrr)r"r#r$r%contextrrrrQscCstt||S)z  Return command of D-Bus sender )rr)r"r#rrrr_scCstt||S)N)rr)r"r#rrrrdscCs|dkr|}nt|tjr(t|}nt|tjrNtrB|jdnt|}ntrjt|tjrjt|}ndt|tj	rt|}nLt|tj
st|tjst|tjst|tj
st|tjst|tjst|tjrt|}nt|tjrt|}nt|tjrdd|D}nt|tjr6tdd|D}nt|tjrXdd|jD}nvt|tst|tst|tst|tst|tst|tst|tst|tr|}ntdt||dk	r|tkrt|ts|tkrt|ts|tkr t|ts|tkr8t|ts|tkrPt|ts|tkrht|ts|tkrt|trtd|t||f|S)	Nzutf-8cSsg|]}t|qSr)r).0xrrr
<listcomp>}sz"dbus_to_python.<locals>.<listcomp>cSsg|]}t|qSr)r)r.r/rrrr0scSsi|]\}}t|t|qSr)r)r.kvrrr
<dictcomp>sz"dbus_to_python.<locals>.<dictcomp>zUnhandled %sz%s is %s, expected %s)
isinstancerBooleanboolStringPY2encodestr
UTF8String
ObjectPathByteInt16Int32Int64UInt16UInt32UInt64r DoublefloatArrayStructtuple
Dictionaryitemsbyteslistdict	TypeErrorreprtype)objZ
expected_typeZ
python_objrrrrgsV


cCs>t|tjrdSt|tjr dSt|tjr0dSt|tjr@dSt|tjrPdSt|tjr`dSt|tjrpdSt|tj	rdSt|tj
rd	St|tjrd
St|tjrdSt|tj
rt|jdkrd
|jSd|jSnXt|tjrd|jSt|tjrd|jStr*t|tjr*dStdt|dS)Nbsoynir/qutdza(%s)za%sz(%s)za{%s}zUnhandled %s)r4rr5r7r<r=r>r?r@rArBrCrDrFlenZ	signaturerGrIr8r;rNrO)rQrrrr	sB


cCs|dkri}t|ds"t|dit|d}i||<y|j|}Wntk
rZi}YnXxV|jD]J\}}dt|i|||<||kr|||||d<qfd|||d<qfWdS)N_fw_dbus_propertiesrPaccessread)hasattrsetattrgetattrZGetAllrrJr	)rQ	interfacer_dipZ_dictkeyvaluerrrr
s


c
Cstj|}t|drx|jdD]}|jdr |jd|kr i}t|drTt|d}||kr xX||jD]H\}}|jd}|j	d||j	d|d|j	d|d|j
|qjWq Wtj|j
|j
}	|j|	S)Nr^rdnamepropertyrPr_)r
ZparseStringraZgetElementsByTagNameZhasAttributeZgetAttributercrJZ
createElementZsetAttributeZappendChildrZdebug10Ztoxmlunlink)
rQdatarddocZnodererfrgZpropZnew_datarrrrs&





)N)N)__all__rr'sysZxml.domr
Zfirewall.core.loggerrversionr8rrrrrrrrr	r
rrrrr<module>s*
	

	
0%