A simple port scanner written in C that uses poll() for single-threaded concurrency.
C Shell Makefile
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
Makefile
README.md
kclisten.c
kcportscan.c
test_kcportscan.sh

README.md

About

A simple port scanner written in C by Keith Craigie (https://kcraigie.com). Uses poll() for single-threaded concurrency.

Usage

kcportscan -4 ipv4_address[/prefix] [-t timeout_ms] [-s services_file]

Parameters

  • ipv4_address The IPv4 address you want to portscan. Use /prefix to specify an address block.
  • timeout_ms Timeout for connections in milliseconds. Defaults to 3000ms.
  • services_file Path to a file that maps service names to ports. Defaults to /etc/services.

Notes

To get more concurrent connection attempts, use "ulimit -n bigger_number" before running kcportscan.

Testing

Run ./test_kcportscan.sh to perform an automated test of kcportscan using listeners on random ports. The test returns 0 if all random ports were discovered by kcportscan and 1 if any were missed.