You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/network-services-pentesting/584-pentesting-afp.md
+37-1Lines changed: 37 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -50,6 +50,19 @@ The NSE brute-force script can be combined with Hydra/Medusa if more control is
50
50
hydra -L users.txt -P passwords.txt afp://<IP>
51
51
```
52
52
53
+
If you already have credentials, **Nmap's AFP scripts become much more useful** because `afp-serverinfo` leaks the advertised **UAMs** (auth methods), while `afp-showmount` and `afp-ls` can enumerate reachable shares, ACLs and interesting files:
***Machine Type: Netatalk** in `afp-serverinfo` output, which usually means a NAS / Unix host rather than Apple's own AFP implementation.
63
+
***UAMs** such as `DHX`, `DHX2`, `Cleartxt` or `Guest`, because they directly hint at the reachable login paths and whether legacy / weak auth is enabled.
64
+
***Share ACLs** from `afp-showmount`; world-readable or drop-box style shares often expose backups, `.appl` files, and user metadata before you ever mount the volume.
65
+
53
66
### Interacting with shares
54
67
55
68
*macOS*
@@ -71,6 +84,14 @@ afp_client <IP>
71
84
72
85
Once mounted, remember that classic Mac resource-forks are stored as hidden `._*` AppleDouble files – these often hold interesting metadata that DFIR tools miss.
73
86
87
+
On Netatalk targets this metadata backend also matters for exploitability:
88
+
89
+
*`ea = ad` means metadata is stored in **AppleDouble v2** files / `.AppleDouble` directories.
90
+
*`ea = sys` or `ea = samba` stores metadata in filesystem extended attributes instead.
91
+
* In **Netatalk 4.2+** the old `appledouble` option was removed and the backend is controlled solely through the `ea` option.
92
+
93
+
From an offensive perspective, this lets you quickly decide whether **AppleDouble-oriented bugs** are more likely to be reachable on the server.
94
+
74
95
---
75
96
76
97
## Common Vulnerabilities & Exploitation
@@ -95,11 +116,24 @@ If the target runs an affected QNAP/Synology firmware, successful exploitation y
95
116
96
117
Older Netatalk (3.0.0 - 3.1.11) is vulnerable to an out-of-bounds write in the **DSI OpenSession** handler allowing unauthenticated code execution (**CVE-2018-1160**). A detailed analysis and PoC were published by Tenable Research.
97
118
119
+
### Newer Netatalk attack surface (2022-2024)
120
+
121
+
Recent Netatalk advisories show that the attack surface is no longer limited to `parse_entries()` and OpenSession handling:
122
+
123
+
***CVE-2022-45188**: a specially crafted `.appl` file can trigger a heap overflow in `afp_getappl`; this is especially relevant if you can **write files into a share** and the server runs FCE / notify features.
124
+
***CVE-2023-42464**: a **type confusion** bug in the **Spotlight RPC** handlers can become reachable when `spotlight = yes` is enabled in `afp.conf` (disabled by default).
125
+
***CVE-2024-38439 / CVE-2024-38440 / CVE-2024-38441**: one-byte heap out-of-bounds writes in login-related paths fixed in **Netatalk 2.4.1 / 3.1.19 / 3.2.1**. These bugs are interesting because exploitability depends on the configured **UAMs**:
126
+
*`uams_clrtxt.so` + PAM-backed ClearTxt login exposes the `FPLoginExt` path relevant to **CVE-2024-38439**.
127
+
*`uams_dhx.so` + PAM-backed DHX login reaches the vulnerable path for **CVE-2024-38440**.
128
+
*`uams_guest.so` keeps the **Guest** login path reachable for **CVE-2024-38441**.
129
+
130
+
This means the output of `afp-serverinfo` is not just fingerprinting data; it helps you decide which **login parser** is exposed before spending time on exploit development or NAS firmware triage.
131
+
98
132
### Other notable issues
99
133
100
134
***CVE-2022-22995** – Symlink redirection leading to arbitrary file write / RCE when AppleDouble v2 is enabled (3.1.0 - 3.1.17).
101
135
***CVE-2010-0533** – Directory traversal in Apple Mac OS X 10.6 AFP (detected by `afp-path-vuln.nse`).
102
-
* Multiple memory-safety bugs were fixed in **Netatalk 4.x (2024)** – recommend upgrading rather than patching individual CVEs.
136
+
* Multiple memory-safety bugs were fixed again during the **2024 Netatalk releases**; if you identify `Netatalk` in `afp-serverinfo`, spend a minute correlating the exposed UAMs / Spotlight / metadata backend with the server version before assuming only the 2018/2022 bugs matter.
103
137
104
138
---
105
139
@@ -121,4 +155,6 @@ Older Netatalk (3.0.0 - 3.1.11) is vulnerable to an out-of-bounds write in the *
0 commit comments