• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: netstat & port scanning
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: netstat & port scanning


  • Subject: Re: netstat & port scanning
  • From: Apple Developer <email@hidden>
  • Date: Tue, 27 Sep 2005 01:06:34 -0700

Josh Graessley wrote:


netstat doesn't do a portscan. A portscan attempts to connect to various ports to determine what's open. netstat uses sysctls to get information from the kernel about which ports are open. I believe the network utility performs a classic port scan, iterating through the ports attempting to connect to each one.


it is my understanding that netstat tells you the state of an address.port (I needed to do other sysctls calls as well) I was only interested in the code that checks if the port is open/closed, and was looking for code to does this.

The ip6stat structure is a private structure. This structure is likely to change from release to release. Since netstat is recompiled by Apple with every release where the structure changes, this isn't a problem. If a third party used that data structure, they would find that their program broke every time we changed the data structure.

I downloaded netstat from darwin sources and was unable to compile due to files not present in 10.4.x

#include <netinet6/ip6_var.h>

for example is not found with spotlight. Was not sure if there was anything else I needed to download to get it to compile.



I was able to get nc to compile from the cmd line and get the code that I needed from that.




-josh

On Sep 26, 2005, at 2:48 AM, Apple Developer wrote:

Hi,

I need to get the status of a port (open or closed). I have attempted to get netstat from the darwin sources to compile, but found problems in that 'ip6stat' structure was not found (a .h file is not found in 10.4). Does anyone else know of any source that can do a port scan like the network utility does?

Thank you,

Randy
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40apple.com


This email sent to email@hidden



_______________________________________________ Do not post admin requests to the list. They will be ignored. Macnetworkprog mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >netstat & port scanning (From: Apple Developer <email@hidden>)
 >Re: netstat & port scanning (From: Josh Graessley <email@hidden>)

  • Prev by Date: Re: sockaddr structs vs. address strings
  • Next by Date: Re: sockaddr structs vs. address strings
  • Previous by thread: Re: netstat & port scanning
  • Next by thread: mDNS Packet storm help
  • Index(es):
    • Date
    • Thread