Is it possible to detect port scans on OSX at the kernel level? I would like to write a kext that detects the ip addresses of systems scanning my computers ports.

How exactly does a stealth scan work? Doesn't the kernel get notified when a port is accessed from outside?

1 Answer 1


A stealth scan as it is commonly called is a half open TCP connection. Rather than:

SYN ->


ACK ->

it goes

SYN ->


RST ->

It's only referred to as stealth because many applications log a connection on its listening port. As this scan never completes the TCP connection, no log entry is made. Its in no way undetectable. The network stack in the kernel will still receive notification on the connection just the application listening on the port does not.

A bit more information is available here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .