Practice with gopacket in Go: Implementing a High-Performance SYN Scanner from Scratch

Practice with gopacket in Go: Implementing a High-Performance SYN Scanner from Scratch

In previous articles, we discussed the design principles of Masscan and the engineering practices of Naabu. Today, we dive into the code level and use the Go language and Google’s powerful gopacket library to build a simple SYN Scanner with our own hands. Why Not Just Use net.Dial? In Go, the simplest way to check a port is to use net.Dial("tcp", "ip:port"). This corresponds to the OS’s Connect Scan: System sends SYN. Target replies SYN+ACK. System automatically replies ACK (handshake complete). Application layer Dial returns success. Application layer calls Close, sending FIN/RST. Disadvantages of this method: ...

January 6, 2026 · 5 min · 928 words · Allen
Reflections on One Year of Golang: The Beauty of a Language Easy to Learn but Hard to Master

Reflections on One Year of Golang: The Beauty of a Language Easy to Learn but Hard to Master

I used to be a Python developer, having written Python for about 5 years. Recently, I started learning and using Golang for a year. Although my work during this period wasn’t entirely coding-focused, my overall feelings about Golang come down to two main points: Development is indeed very convenient; it is worth studying in depth and mastering as a long-term programming language. It is easy to get started, but not simple to use well. 1. Development Efficiency and Ecological Advantages Golang’s syntax is similar to Python, but its execution efficiency is higher. Its advantages include: ...

November 11, 2023 · 2 min · 579 words · allen