Detections · What MacVigil reads to decide
Terminal emulation: pseudo-terminals and reverse shells on a Mac
Terminal apps and code editors give you a shell inside a window by using a pseudo-terminal. A backdoor can use the same mechanism to give a distant attacker a live, interactive shell on your Mac, with full-screen tools and tab completion, as if they sat at your keyboard.
Updated November 25, 2026 · 11 detections in this category
In short
A terminal of its own: pseudo-terminals, a program's input and output rewired, a named shell. Terminal apps and code editors have one.
MacVigil has 11 detections in this category. It reads the file to find them and never runs it.
What it is
A pseudo-terminal is a pair of connected ends. A shell runs attached to one end, and a program reads and writes the other end to show the output and pass on the keystrokes. That is how Terminal, third-party terminal apps and the terminal panel of a code editor work.
A reverse shell takes the same setup and connects the other end to the network instead of a window. Whoever is at the other end of the connection types commands and sees the results, with the rights of the user who ran the program. It is one of the most direct forms of remote control: no fixed list of commands, just a shell.
How Mac malware does it
- One function that opens a pseudo-terminal with
forkpty,openptyorposix_openpt, starts a shell on it and relays its output through a thread - Pseudo-terminal setup and a process launch whose output is passed on to a network connection
- An object that keeps the pseudo-terminal, attaches a shell to one end and relays the other end through its own methods
- A class that writes text it receives as a parameter into a shell’s terminal, so whoever supplies that text drives the shell
- Scripts that rewire a program’s input and output with
dup2, then start/bin/sh,/bin/bashor/bin/zsh
What MacVigil looks for
MacVigil reads the file and never runs it. In compiled programs it looks at how the pieces fit together in the code: whether the same function opens a pseudo-terminal, starts a shell and relays its output, or whether direct calls carry that output to a network connection. In scripts it notes words for descriptor redirection, input forwarding and shell paths.
Opening a pseudo-terminal alone is rated as a capability, not a verdict, and script words are recorded for information only, since they establish no execution on their own. The ratings rise when the code itself joins the shell to a connection. Even then, the report says what is not established: a relay in the code shows the shape of a remote shell, not that a remote party drives it.
When it is normal
Terminal apps, code editors with a built-in terminal, SSH clients, remote administration tools you installed on purpose, container and virtual machine managers, and test frameworks all open pseudo-terminals and start shells. Command-line tools redirect input and output all the time. What separates a remote shell from these is where the other end of the terminal goes: a window on your screen, or a connection to someone else.
How to check your Mac
- In Activity Monitor, choose View > All Processes, Hierarchically, and look for
zsh,bashorshrunning under an app that is neither a terminal nor an editor. - In Terminal,
lsof -i -Plists open network connections with the program and process number behind each; look that number up in Activity Monitor. - In System Settings > General > Sharing, turn off Remote Login if you do not use SSH.
- Review System Settings > General > Login Items & Extensions (Login Items on older macOS), since a backdoor needs to start again after a restart.
Related categories
- Remote control: What lets someone drive this Mac from a distance: a channel that receives commands, and the means to run them.
- Listening for connections: What lets other programs connect to this one: a listening socket, a local server, a WebSocket or local address. Development tools and apps that talk to their own helpers have some.
- Running other programs: The commands and other programs this file can start. Most software has some.
Know what a file does before you open it
MacVigil reads any app, disk image, installer or script without running it, and shows the evidence behind every finding. Nothing leaves your Mac.
Free for 7 days, then $29.95 a year for 2 Macs, a launch price: the regular price will be $59 a year. Requires macOS 15 Sequoia or later on a Mac with Apple silicon.
More: all detection categories · what MacVigil detects · the blog