How to list AFP shares from command-line (MacOS)?

Christophe picture Christophe · Oct 9, 2012 · Viewed 14k times · Source

From the command-line, I need to list all the AFP shares available from a given server on a local network.

I can browse the available servers that provides AFP as follow:

iMac:bin me$ dns-sd -B _afpovertcp._tcp
Browsing for _afpovertcp._tcp
Timestamp     A/R Flags if Domain                    Service Type              Instance Name
10:36:36.531  Add     3  4 local.                    _afpovertcp._tcp.         iMac
10:36:36.547  Add     3  5 local.                    _afpovertcp._tcp.         iMac
10:36:36.547  Add     3  4 local.                    _afpovertcp._tcp.         box
10:36:36.547  Add     2  5 local.                    _afpovertcp._tcp.         box
^C

And now I want to know what shares are available from "iMac" for instance (the ones that are displayed by the Finder when you clic on the server icon in the "Shares" left-column view) ?

PS I already found many threads about this (here and here), but they are unanswered for this specific topic.

Answer

Jan Fröhling picture Jan Fröhling · Aug 21, 2015

Have alook at this one:

https://nmap.org/nsedoc/scripts/afp-showmount.html

I could get the info about available afp-shares with nmap...

My command:

nmap -p 548 --script afp-showmount --script-args afp.username=yourusername,afp.password=yourpassword yourserveraddress