Python TCP stack implementation

前端 未结 5 830
日久生厌
日久生厌 2021-02-03 12:50

Is there a python library which implements a standalone TCP stack?

I can\'t use the usual python socket library because I\'m receiving a stream of packets over a socket

5条回答
  •  一向
    一向 (楼主)
    2021-02-03 13:46

    If you are already committed to the software at the other end of the socket, that is forwarding TCP packets to you, then perhaps TCPWatch will show you how to get at the SYN packets. SCAPY is certainly great for sending exactly the packets that you want, but I'm not sure that it will work as a proxy.

    http://hathawaymix.org/Software/TCPWatch

    However, if you are not committed to what is on the sending end, then consider using Twisted Conch or Paramiko to do SSH forwarding. Even if you don't need encryption, you can still use these with blowfish which has a low impact on your CPU. This doesn't mean that you need Conch on the other end, since SSH is standardised so any SSH software should work. In the SSH world this is normally referred to as "port forwarding" and people use an SSH terminal client to log into an SSH server and set up the port forwarding tunnel. Conch and Paramiko allow you to build this into a Python application so that there is no need for the SSH terminal client.

提交回复
热议问题