• 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: how to enumerate TCP and UDP listeners
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how to enumerate TCP and UDP listeners


  • Subject: Re: how to enumerate TCP and UDP listeners
  • From: email@hidden
  • Date: Fri, 20 Oct 2006 13:06:33 -0600

On Oct 20, 2006, at 12:15 PM, email@hidden wrote:

How can I enumerate open TCP and UDP ports on my computer programmatically in OS X? Also, is there a way to enumerate open TCP connections?

There still seems to be a lot of argument about whether it's ok to call the command line directly, but try these commands:


lsof -i
sudo lsof -i
sudo lsof -i tcp
sudo lsof -i udp
sudo lsof -i tcp:80

In Debian, I double checked my ssl port with fuser, which is similar:

fuser -v 443/tcp

No idea how to do it programmatically except for calling one of these with system(). Can anyone else believe that these unix tools just don't take a version number request? I would love to be able to pass 1.0 to lsof and even if it's version 3.0 or whatever, it would return a 1.0 formatted response. This should have been a requirement to get a tool bundled into a distribution, oh, 30 years ago. Hope this helps,

------------------------------------------------------------------------
Zack Morris              Z Sculpt Entertainment               This Space
email@hidden      http://www.zsculpt.com                 For Rent
------------------------------------------------------------------------
If the doors of perception were cleansed, everything would appear to man
  as it is, infinite. -William Blake, The Marriage of Heaven and Hell


_______________________________________________ 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: 
 >how to enumerate TCP and UDP listeners (From: email@hidden)

  • Prev by Date: how to enumerate TCP and UDP listeners
  • Next by Date: Using cfhttp authentication functions when the response was constructed with CFHTTPMessageAppendBytes
  • Previous by thread: how to enumerate TCP and UDP listeners
  • Next by thread: Re: how to enumerate TCP and UDP listeners
  • Index(es):
    • Date
    • Thread