telnet传输文件

陌路散爱 提交于 2020-01-07 19:32:35

python2.7写入代码样例:

import socket
import base64
##port和filename根据实际情况可以修改为适合你的
port     = 10005
filename = 'libcrypto.so.1.0.1e'

sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.bind(('0.0.0.0', port))
sock.listen(5)
while True:
    connection,address = sock.accept()
    try:
        content = 'hello'
        f = file(filename)
        content = base64.b64encode(f.read())
        connection.sendall(content.strip())
        connection.close()
    except socket.timeout:
        print 'time out'
    connection.close()

 

 

telent输出代码样例:

telnet 102.200.200.202 10005 |tee > temp.txt
base64 -d < temp.txt |tee >out.ovpn

  

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!