Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add port scan #2

Open
bdougherty opened this issue Apr 28, 2022 · 5 comments
Open

Add port scan #2

bdougherty opened this issue Apr 28, 2022 · 5 comments

Comments

@bdougherty
Copy link
Member

Not sure what Apple used for doing port scanning.

@jeff-h
Copy link

jeff-h commented Sep 3, 2023

Would it have been lsof perhaps?

@luckydonald
Copy link

According to Wikipedia's old page,

Network Utility uses the tools supplied in the unix directories for most of its functions, however for the port scan it uses a unix executable in its resources folder, stroke, found at Network Utility.app/Contents/Resources/stroke.

@jeff-h
Copy link

jeff-h commented Nov 18, 2024

Aha, nice find! Do you think Stroke was an internal tool developed by Apple? I can't find any reference to it outside of its use inside Network Utility.

More broadly, I find it extraordinary that macOS/Unix seems to have to check each port in order to see if it's in use. I'd have thought there would be a central registry or something tracking which ports are available and which are not, and such a query would be an almost instantaneous system call.

@luckydonald
Copy link

The port scan is of other hosts, so it needs some kind of bruteforce there.

I wonder if one could decompile the old binary to figure out what's it doing on its core.

@jeff-h
Copy link

jeff-h commented Nov 21, 2024

The port scan is of other hosts, so it needs some kind of bruteforce there.

Ha, of course, sorry! I'm too fixated on my own particular use-case (scanning localhost).

Presumably bundling an existing binary (perhaps nmap?) would be more efficient than writing a new one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants