简体   繁体   中英

Is there an easy way to do half open TCP connection via Python Asyncio?

I'm just picking up some async Python and trying to write a simple TCP port scanner using the Asyncio module.

I can open a full-fledged TCP connection with 3-way handshakes via asyncio.open_connection . However, I want to create an SYN-ACK half-open connection —similar to what nmap uses—using asyncio. I was rummaging through the streams API but couldn't find anything. Is there a high-level method to do this? If not, how do I do this?

asyncio doesn't give you such control on TCP/IP stack layers and even hides some complex tasks such as callbacks, low-level protocols, transports. You can do it using a raw socket.

Modules that can be useful

  • python-nmap
  • scapy

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM