Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to create a simple TCP port scanner in GE language

2025-01-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly introduces "how to use GE language to create a simple TCP port scanner". In daily operation, I believe many people have doubts about how to use GE language to create a simple TCP port scanner. Xiaobian consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful for you to answer the questions of "how to use GE language to create a simple TCP port scanner". Next, please follow the editor to study!

TCP scanning essence

When we use TCP to connect, we need to know the ip:port of the other machine.

Normal handshake

If the connection is successful, the process is as follows.

Connection failed

If there is normal, there is failure. If it is shut down by the connecting party, the process is as follows.

If there is a firewall

Another possibility is that the port is open, but the firewall blocks, and the process is as follows.

Code

Once you understand the essence, you can start playing with the code.

In Go, we usually use net.Dial for TCP connections.

There are only two situations.

Success: return conn.

Failed: err! = nil.

Ordinary version

Relatively speaking, at the beginning, we may not be too bold, we all write prototypes first, regardless of performance.

Code

Package main import ("fmt"net") func main () {var ip = "192.168.43.34" for I: = 21; I

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report