AnonSec Shell
Server IP : 209.38.156.173  /  Your IP : 216.73.216.122   [ Reverse IP ]
Web Server : Apache/2.4.52 (Ubuntu)
System : Linux lakekumayuhotel 5.15.0-136-generic #147-Ubuntu SMP Sat Mar 15 15:53:30 UTC 2025 x86_64
User : root ( 0)
PHP Version : 8.1.2-1ubuntu2.22
Disable Function : NONE
Domains : 2 Domains
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /lib/python3/dist-packages/sos/cleaner/parsers/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /lib/python3/dist-packages/sos/cleaner/parsers/__pycache__/hostname_parser.cpython-310.pyc
o

���b�
�@s,ddlmZddlmZGdd�de�ZdS)�)�SoSCleanerParser)�SoSHostnameMapcsDeZdZdZdZdgZd
�fdd�	Zdd�Zd	d
�Zdd�Z	�Z
S)�SoSHostnameParserzHostname Parser�hostname_mapz5(((\b|_)[a-zA-Z0-9-\.]{1,200}\.[a-zA-Z]{1,63}(\b|_)))NcsJt�|_tt|��|�|j��|j�|�g|_|��|j�	�dS�N)
r�mapping�superr�__init__�load_domains_from_map�load_domains_from_options�short_names�load_short_names_from_mapping�set_initial_counts)�self�config�opt_domains��	__class__��E/usr/lib/python3/dist-packages/sos/cleaner/parsers/hostname_parser.pyr	s
zSoSHostnameParser.__init__cCs>|jj��D]}t|�d��dkr||jvr|j�|�qdS)aWhen we load the mapping file into the hostname map, we have to do
        some dancing to get those loaded properly into the "intermediate" dicts
        that the map uses to hold hosts and domains. Similarly, we need to also
        extract shortnames known to the map here.
        �.�N)r�dataset�keys�len�splitr�append)r�hnamerrrr
 s
��z/SoSHostnameParser.load_short_names_from_mappingcCszd|vrdS|�d�}t|�dkr|j�|d�n|j�|�t|�dkr5d�|dd��}|j�|�|j�|�dS)z�Force add the domainname found in /sos_commands/host/hostname into
        the map. We have to do this here since the normal map prep approach
        from the parser would be ignored since the system's hostname is not
        guaranteed
        �	localhostNrrr����)rrrr�joinr�add)r�hostname_string�domains�high_domainrrr�load_hostname_into_map,s
z(SoSHostnameParser.load_hostname_into_mapcCs||��}|D]5}|�d�sd|vrq|��dd�}|D]}t|�d��dkr4|j�|�|j�|�q|j�|�qqdS)a$Parse an archive's copy of /etc/hosts, which requires handling that
        is separate from the output of the `hostname` command. Just like
        load_hostname_into_map(), this has to be done explicitly and we
        cannot rely upon the more generic methods to do this reliably.
        �#rrNr)	�
splitlines�
startswithrrrrr�add_regex_itemr")r�content�lines�line�hostln�hostrrr�load_hostname_from_etc_hosts@s��z.SoSHostnameParser.load_hostname_from_etc_hostsr)�__name__�
__module__�__qualname__�name�map_file_key�regex_patternsr	r
r&r0�
__classcell__rrrrrs�	rN)�sos.cleaner.parsersr�!sos.cleaner.mappings.hostname_maprrrrrr�<module>s


Anon7 - 2022
AnonSec Team