CasperSecurity

Current Path : /lib/python3/dist-packages/sos/report/__pycache__/
Upload File :
Current File : //lib/python3/dist-packages/sos/report/__pycache__/reporting.cpython-310.pyc

o

([Qh5�@s�dZzddlZWn
eyddlZYnwGdd�d�ZGdd�de�ZGdd�de�Zd	d
�ZGdd�de�ZGd
d�de�Z	Gdd�de�Z
Gdd�de�ZGdd�de�ZGdd�de�Z
dd�ZGdd�d�ZGdd�de�ZGdd�de�ZdS)zS This provides a restricted tag language to define the sos report
    index/report
�Nc@s eZdZiZdd�Zdd�ZdS)�NodecCst�|j�S�N)�json�dumps�data��self�r	�6/usr/lib/python3/dist-packages/sos/report/reporting.py�__str__szNode.__str__cCsdS)NFr	�r�noder	r	r
�can_addszNode.can_addN)�__name__�
__module__�__qualname__rrrr	r	r	r
rsrc@seZdZdZdS)�Leafz0Marker class that can be added to a Section nodeN)rrr�__doc__r	r	r	r
r"src@�(eZdZdZdd�Zdd�Zdd�ZdS)	�Reportz?The root element of a report. This is a container for sections.cCs
i|_dSr)rrr	r	r
�__init__)�
zReport.__init__cC�
t|t�Sr)�
isinstance�Sectionrr	r	r
r,rzReport.can_addcGs&|D]}|�|�r|j|j|j<qdSr)rr�name�r�nodesr
r	r	r
�add/s

��z
Report.addN�rrrrrrrr	r	r	r
r&s
rcC�t|t�r|S|�dd�S)z3returns a string text for a given unicode/str input�utf8�ignore�r�str�decode)�sr	r	r
�_decode5sr'c@r)	rzeA section is a container for leaf elements. Sections may be nested
    inside of Report objects only.cCst|�|_i|_dSr)r'rr)rrr	r	r
r>s

zSection.__init__cCrr)rrrr	r	r
rBrzSection.can_addcGs0|D]}|�|�r|j�|jg��|j�qdSr)rr�
setdefault�ADDS_TO�appendrr	r	r
rEs

��zSection.addNrr	r	r	r
r:s
rc@�eZdZdZdd�ZdS)�Command�commandscCst|�|t|�d�|_dS)N)r�return_code�href�r'r)rrr.r/r	r	r
rOs�zCommand.__init__N�rrrr)rr	r	r	r
r,K�r,c@r+)�
CopiedFile�copied_filescC�t|�t|�d�|_dS�N)rr/r0�rrr/r	r	r
rY��zCopiedFile.__init__Nr1r	r	r	r
r3Ur2r3c@r+)�CreatedFile�
created_filescCr5r6r0r7r	r	r
rbr8zCreatedFile.__init__Nr1r	r	r	r
r9^r2r9c@r+)�Alert�alertscC�t|�|_dSrr0�r�contentr	r	r
rk�zAlert.__init__Nr1r	r	r	r
r;gr2r;c@r+)�Note�notescCr=rr0r>r	r	r
rsr@z
Note.__init__Nr1r	r	r	r
rAor2rAcCs
|�d�S)a Return True if 'string' ends with a backslash, and False otherwise.

        Define this as a named function for no other reason than that pep8
        now forbids binding of a lambda expression to a name:

        'E731 do not assign a lambda expression, use a def'
    �\)�endswith)�stringr	r	r
�ends_bsws
rFc@s�eZdZdZdZdZdZdZdZdZ	dZ
dZd	ZdZ
d
ZdZeeddfeed
dfeeddfeeddfeeddffZgZdd�Zdd�Zdd�ZdS)�PlainTextReportz@Will generate a plain text report from a top_level Report object�z  * %(name)sz  ! %sz  * %szLoaded Plugins:z  {name}�
�z{name}zH========================================================================z-  commands executed:z-  files copied:z-  files created:z
-  alerts:z	-  notes:cCstt�|j��|_dSr)�sorted�dict�itemsr�report_data)r�report_noder	r	r
r�szPlainTextReport.__init__c
	Csg|_}t|j�dkr|�|j�|�|j�d}d}t|j�}|jD]\}}|d|��7}|d7}||jdkrC||krC||j7}q$||j7}|�|�|jD]$\}}|�|j	�|�|��|j
D]\}}	}
}|�||j|
|	|�qdqQt|j
�dkr�|�|j
�d�tdd�|��}|S)NrrHz  �rIcSr )Nr!r"r#)�ir	r	r
�<lambda>�sz)PlainTextReport.unicode.<locals>.<lambda>)�line_buf�len�HEADERr*�PLUGLISTHEADERrN�PLUGLISTMAXITEMS�PLUGLISTSEP�PLUGLISTFOOTER�PLUGDIVIDER�subsections�process_subsectionr)�FOOTER�join�map)
rrS�linerQ�	plugcount�section_name�_�section_contents�type_�format_�header�footer�outputr	r	r
�unicode�s:


�


���zPlainTextReport.unicodecCsd||vr.|j�|�t|�|�dd�d�D]
}|j�||�qt|�dkr0|j�|�dSdSdS)NcSst|t�r	|dSdS)NrrH)rrL)�xr	r	r
rR�sz4PlainTextReport.process_subsection.<locals>.<lambda>)�keyr)rSr*rK�getrT)r�sectionrlrgrfrh�itemr	r	r
r\�s
��z"PlainTextReport.process_subsectionN)rrrrrUr]�LEAF�ALERT�NOTErV�PLUGLISTITEMrXrWrY�PLUGINFORMATrZr,r3r9r;rAr[rSrrjr\r	r	r	r
rG�s0




�"rGc@sveZdZdZdZdZdZdZdZdZ	dZ
dZd	Zd
Z
dZdZeed
dfeeddfeeddfeeddfeeddffZdS)�
HTMLReportz:Will generate a HTML report from a top_level Report objecta�<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
        <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
        <head>
            <meta http-equiv="Content-Type" content="text/html;
                  charset=utf-8" />
            <title>Sos System Report</title>
            <style type="text/css">
                td {
                    padding: 0 5px;
                   }
            </style>
        </head>
        <body>
z</body></html>z(<li><a href="%(href)s">%(name)s</a></li>z<li>%s</li>z#<h3>Loaded Plugins:</h3><table><tr>z&<td><a href="#{name}">{name}</a></td>
z
</tr>
<tr>rJz
</tr></table>z+<h2 id="{name}">Plugin <em>{name}</em></h2>z<hr/>
z<p>Commands executed:</p><ul>z</ul>z<p>Files copied:</p><ul>z<p>Files created:</p><ul>z<p>Alerts:</p><ul>z<p>Notes:</p><ul>N)rrrrrUr]rprqrrrVrsrXrWrYrtrZr,r3r9r;rAr[r	r	r	r
ru�s(




�ruc@r+)�
JSONReportz:Will generate a JSON report from a top_level Report objectcCstj|jddd�}|S)N�F)�indent�ensure_ascii)rrrN)rrir	r	r
rj�szJSONReport.unicodeN)rrrrrjr	r	r	r
rv�srv)rr�ImportError�
simplejsonrrrr'rr,r3r9r;rArFrGrurvr	r	r	r
�<module>s(�
		K&
Hacker Blog, Shell İndir, Sql İnjection, XSS Attacks, LFI Attacks, Social Hacking, Exploit Bot, Proxy Tools, Web Shell, PHP Shell, Alfa Shell İndir, Hacking Training Set, DDoS Script, Denial Of Service, Botnet, RFI Attacks, Encryption
Telegram @BIBIL_0DAY