HEX
Server: LiteSpeed
System: Linux cpir1.prohostdns.com 4.18.0-553.123.2.lve.el8.x86_64 #1 SMP Thu May 7 23:17:13 UTC 2026 x86_64
User: pelakir (2976)
PHP: 8.2.31
Disabled: exec, shell_exec, system, passthru, proc_open, proc_close, proc_terminate, proc_get_status, popen, pclose, pcntl_exec
Upload Files
File: //usr/lib/python3.6/site-packages/sshuttle/methods/__pycache__/__init__.cpython-36.pyc
3

�m�Z��@s|ddlZddlZddlZddlZddlZddlmZmZdd�ZGdd�de	�Z
Gdd�de	�Zd	d
�Zdd�Z
d
d�ZdS)�N)�Fatal�debug3cCs�ydd}d}|jtj||�}tjd|dd��\}}}}}}	tj|�tjksNt�d||||	f}
|
|fStjk
r�}z |j	dt
jkr�|j�S�WYdd}~XnXdS)N�P�z!HHBBBB�z%d.%d.%d.%dr)
Z
getsockopt�socketZSOL_IP�struct�unpackZhtonsZAF_INET�AssertionError�error�args�errnoZENOPROTOOPTZgetsockname)�sockZSO_ORIGINAL_DSTZSOCKADDR_MINZsockaddr_in�proto�port�a�b�c�dZip�e�r�/usr/lib/python3.6/__init__.py�original_dst	s rc@seZdZdS)�FeaturesN)�__name__�
__module__�__qualname__rrrrrsrc@s|eZdZdd�Zdd�Zedd��Zedd��Zed	d
��Zdd�Z	d
d�Z
dd�Zdd�Zdd�Z
dd�Zedd��ZdS)�
BaseMethodcCsd|_||_dS)N)�firewall�name)�selfrrrr�__init__szBaseMethod.__init__cCs
||_dS)N)r)r rrrr�set_firewall#szBaseMethod.set_firewallcCs"t�}d|_d|_d|_d|_|S)NFT)r�ipv6�udp�dns�user)�resultrrr�get_supported_features&sz!BaseMethod.get_supported_featurescCst|�S)N)r)rrrr�
get_tcp_dstip/szBaseMethod.get_tcp_dstipcCs td�|j|�\}}|d|fS)NzAccept UDP using recvfrom.
)rZrecvfrom)�udp_listener�bufsize�data�srciprrr�recv_udp3szBaseMethod.recv_udpcCs*|dk	rtd|j|f�|j||�dS)Nz7Method %s send_udp does not support setting srcip to %r)rrZsendto)r rr-Zdstipr,rrr�send_udp9szBaseMethod.send_udpcCsdS)Nr)r Ztcp_listenerrrr�setup_tcp_listener?szBaseMethod.setup_tcp_listenercCsdS)Nr)r r*rrr�setup_udp_listenerBszBaseMethod.setup_udp_listenercCsB|j�}x4dD],}t||�rt||�rtd||jf��qWdS)Nr$r%r#r&z)Feature %s not supported with method %s.
)r$r%r#r&)r(�getattrrr)r ZfeaturesZavail�keyrrr�assert_featuresEs
zBaseMethod.assert_featurescCs
t��dS)N)�NotImplementedError)r rZdnsportZnslist�familyZsubnetsr$r&rrr�setup_firewallMszBaseMethod.setup_firewallcCs
t��dS)N)r5)r rr6r$r&rrr�restore_firewallQszBaseMethod.restore_firewallcCsdS)NFr)�linerrr�firewall_commandTszBaseMethod.firewall_commandN)rrrr!r"�staticmethodr(r)r.r/r0r1r4r7r8r:rrrrrs	rcCs^tjd�ptjjtj�}x@|D]8}d||f}tjj|�rtjj|�oTtj|tj	�SqWdS)N�PATHz%s/%s)
�os�getenv�defpath�split�pathsep�path�exists�isdir�access�X_OK)r�paths�p�fnrrr�_program_existsYs

rJcCstjd|�}|j|�S)Nzsshuttle.methods.%s)�	importlib�
import_moduleZMethod)�method_name�modulerrr�
get_methodasrOcCsHtd�rd}n2td�rd}n$td�r*d}ntd�r8d}ntd��t|�S)NZiptablesZnatZnftZpfctlZpfZipfwz9can't find either iptables, nft or pfctl; check your PATH)rJrrO)rMrrr�get_auto_methodfsrP)r=rKrrr
Zsshuttle.helpersrrr�objectrrrJrOrPrrrr�<module>s;