Port Scanner （端口检测工具）
This project is a tool for scanning opened ports . This tool has three implementations by different languages:
Golang 1.6. The
Goversion is the fastest. The
C++version remains some bugs, one of them is program will be blocked when the number of threads exceeds 1600. If you have any ideas or suggestions, please e-mail me or open your PR.
This small script is written in three languages:
Golang 1.6 and
- The Visual Studio project file
port-scanner.slnis in folder
C++. I wrote these code with VS Ultimate 2013, version
port-scanner.gois the implementation of
Golang 1.6, in folder
port-scanner.pyis the implementation of
Python 3.5, in folder
- All packages used are built-in.
- Python version:
python3 port-scanner.py ip_address start_port-end_port. For example,
python3 port-scanner.py localhost 0-65535, then the tool will scan all the ports opened in your PC. You can change the timeout value in code.
- Go version:
go run port-scanner.go --host=ip_address --cores=cores, here
--coresparameter is used to assigning how many cpu cores to use. Default is 2 CPU cores. You can change the timeout value in code. This version is the fastest.
- C++ version: You need to build the project first. In
mainfunction, you should create a
Scannerobject, you can specify the ip address, port range and threads you want to use. However, the tool may be slower when the number of threads is beyond 1600. Also, sometimes the
C++version cannot scan all the opend ports. Maybe I will fix this later. Call it
- 2016-9-25: Add this tool.
- 2016-10-7: Build repository.
All codes in this repository are licensed under the terms you may find in the file named "LICENSE" in this directory.