A simple multi-threaded port scanner written in C with basic banner grabbing support.
- Multi-threaded TCP port scanning
- Basic banner grabbing
- HTTP response detection
- Common service identification
- Custom port range support
.
├── port_scanner.c
└── README.md
Compile C code using:
gcc -o port_scanner port_scanner.c -lpthread
./port_scanner -i 192.168.1.1 -s 1 -e 1024./port_scanner -i 127.0.0.1 -s 1 -e 100| Argument | Description |
|---|---|
-i |
Target IP or hostname |
-s |
Start port |
-e |
End port |
[+] Port 22 OPEN | Service: ssh
[+] Port 80 OPEN | Service: http
======================================================================
OPEN PORTS AND BANNERS
======================================================================
Port : 22
Service : ssh
Banner : SSH-2.0-OpenSSH_8.2p1 Ubuntu-4ubuntu0.5
Port : 80
Service : http
Banner : HTTP/1.1 200 OK
- Make sure the script has execute permission:
chmod +x port_scanner