Skip to content

Commit 7b69eba

Browse files
authored
Merge pull request #2055 from HackTricks-wiki/research_update_src_network-services-pentesting_584-pentesting-afp_20260326_134223
Research Update Enhanced src/network-services-pentesting/584...
2 parents 5e594f3 + cb5a161 commit 7b69eba

1 file changed

Lines changed: 37 additions & 1 deletion

File tree

src/network-services-pentesting/584-pentesting-afp.md

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,19 @@ The NSE brute-force script can be combined with Hydra/Medusa if more control is
5050
hydra -L users.txt -P passwords.txt afp://<IP>
5151
```
5252

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:
54+
55+
```bash
56+
nmap -p 548 --script afp-serverinfo,afp-showmount,afp-ls \
57+
--script-args 'afp.username=<USER>,afp.password=<PASS>,ls.maxdepth=2,ls.maxfiles=50' <IP>
58+
```
59+
60+
Pay attention to:
61+
62+
* **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+
5366
### Interacting with shares
5467

5568
*macOS*
@@ -71,6 +84,14 @@ afp_client <IP>
7184

7285
Once mounted, remember that classic Mac resource-forks are stored as hidden `._*` AppleDouble files – these often hold interesting metadata that DFIR tools miss.
7386

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+
7495
---
7596

7697
## Common Vulnerabilities & Exploitation
@@ -95,11 +116,24 @@ If the target runs an affected QNAP/Synology firmware, successful exploitation y
95116

96117
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.
97118

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+
98132
### Other notable issues
99133

100134
* **CVE-2022-22995** – Symlink redirection leading to arbitrary file write / RCE when AppleDouble v2 is enabled (3.1.0 - 3.1.17).
101135
* **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.
103137

104138
---
105139

@@ -121,4 +155,6 @@ Older Netatalk (3.0.0 - 3.1.11) is vulnerable to an out-of-bounds write in the *
121155

122156
* Netatalk Security Advisory CVE-2022-23121 – "Arbitrary code execution in parse_entries" <https://netatalk.io/security/CVE-2022-23121>
123157
* Tenable Research – "Exploiting an 18-Year-Old Bug (CVE-2018-1160)" <https://medium.com/tenable-techblog/exploiting-an-18-year-old-bug-b47afe54172>
158+
* Netatalk Security Advisories index <https://netatalk.io/security.html>
159+
* Netatalk 4.2.0 Release Notes <https://netatalk.io/4.2/ReleaseNotes4.2.0>
124160
{{#include ../banners/hacktricks-training.md}}

0 commit comments

Comments
 (0)