Your IP : 216.73.216.196
B
� f � @ sl d Z ddlZddlmZmZmZ ddlZddlZdZdZdd� Z dd � Z
y
e � W n ek
rf Y nX dS )
z�
Remote python server.
Execute Python commands remotely and send output back.
WARNING: This version has a gaping security hole -- it accepts requests
from any host on the Internet!
� N)�socket�AF_INET�SOCK_STREAMi i c C s� t tj�dkrttjd �} nt} ttt�}|�d| f� |� d� xd|�
� \}\}}td||� d}x|�t
�}|sxP ||7 }qhW t|�� �}|�|�� � |�� qFW d S )N� � zconnection from� )�len�sys�argv�int�PORTr r r ZbindZlistenZaccept�printZrecv�BUFSIZE�execute�decode�send�encode�close)Zport�sZconnZ
remotehostZ
remoteport�request�dataZreply� r �8/opt/alt/python37/lib64/python3.7/Tools/demo/rpythond.py�main s$
r c C sj t j}t j}t�� t _ t _}z2yt| i i � W n t� t�d� Y nX W d |t _|t _X |� � S )N�d )
r �stdout�stderr�io�StringIO�execr
� traceback� print_exc�getvalue)r r r Zfakefiler r r r ( s r )�__doc__r r r r r r r r r r �KeyboardInterruptr r r r �<module> s