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/report/plugins/__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/report/plugins/__pycache__/firewall_tables.cpython-310.pyc
o

���b��@s*ddlmZmZmZGdd�dee�ZdS)�)�Plugin�IndependentPlugin�SoSPredicatec@s8eZdZdZdZdZdd�Zdd�Zdd�Zd	d
�Z	dS)�firewall_tableszfirewall tables)�network�systemcC�2d|}d|d}|j|t||dgd�d�dS)z� Collecting iptables rules for a table loads either kernel module
        of the table name (for kernel <= 3), or nf_tables (for kernel >= 4).
        If neither module is present, the rules must be empty.�iptable_ziptables -t � -nvL�	nf_tables��kmods��predN��add_cmd_outputr��self�	tablename�modname�cmd�r�D/usr/lib/python3/dist-packages/sos/report/plugins/firewall_tables.py�collect_iptables
�zfirewall_tables.collect_iptablecCr)z& Same as function above, but for ipv6 �	ip6table_z
ip6tables -t r
rrrNrrrrr�collect_ip6tables
�z firewall_tables.collect_ip6tablecCs&t|ddgddid�}|jd|dd�S)	zS Collects nftables rulesets with 'nft' commands if the modules
        are present r�	nfnetlinkr
�all)r
�requiredznft list rulesetT)r�changes)r�collect_cmd_output)r�nft_predrrr�collect_nftables's��z firewall_tables.collect_nftablesc	Cs�|��}ggd�}|ddkr|dnd}|��D])}|��dd�}t|�dkrB|ddkrB|d|��vrB||d�|d	�qd
}ztd���}WntyX|}Ynw|��D]}|ddkrp||dvrp|�	|�q]ztd
���}Wnty�|}Ynw|��D]}|ddkr�||dvr�|�
|�q�|ddks�d|dvr�|jdt|ddgd�d�|ddks�d|dvr�|jdt|ddgd�d�|�
gd��dS)N)�ip�ip6�statusr�output���table��zmangle
filter
z/proc/net/ip_tables_namesr#z/proc/net/ip6_tables_namesr$�filterziptables -vnxL�iptable_filterrrrzip6tables -vnxL�ip6table_filter)z
/etc/nftablesz/etc/sysconfig/nftables.confz/etc/nftables.conf)r"�
splitlines�split�len�keys�append�open�read�IOErrorrrrr�
add_copy_spec)	r�nft_list�
nft_ip_tables�	nft_lines�line�words�default_ip_tables�ip_tables_namesr)rrr�setup2sP
���
��
���zfirewall_tables.setupN)
�__name__�
__module__�__qualname__�
short_desc�plugin_name�profilesrrr"r?rrrrrs	rN)�sos.report.pluginsrrrrrrrr�<module>s

Anon7 - 2022
AnonSec Team