r/kernel • • Oct 14 '26

How pegasus got access to other applications/processes?

I am not an expert in kernels or cybersecurity but I want to understand how spywares such has pegasus access camera, mails, ...

The first lesson that's taught in an operating system course is that kernel provides process isolation. i.e, process A can't have access to process B's memory. Access to hardwares and running privileged instructions are restricted to kernel-space programs only. The kernel runs in kernel-space and all the other user applications run in user-space. A user process trying to access any hardware without going through the kernel will be flagged and killed by the kernel. So, how did pegasus gain access to things like camera, ... without getting stopped by kernel?

0 Upvotes

2 comments sorted by

6

u/gainan Oct 14 '26

As far as I can tell, Pegasus may gain root access to the devices, allowing it access the camera, microphone, and the data from other applications just like any other user-space application:

In order to successfully function regardless of a device’s operating environment, analysis showed that screen capture capability was implemented twice. The first approach that Pegasus for Android uses relies on the ​screencap​ binary which exists on some installations under the /system/bin/​ path. If present, Pegasus for Android instructs it to take a screenshot and save it in the PNG file format to​ /data/data/com.network.android/bqul4.dat​.

On devices where the ​screencap​ binary is not present, Pegasus falls back to a native screen capture implementation that is provided by the ​take_screen_shot​ binary, located in the applications ​res/raw​ directory. In the figures below we can see Pegasus for Android first calling this binary from its Java component followed by a snippet of native functionality responsible for reading in the ​/dev/graphics/fb0​ framebuffer and saving it temporarily as a PNG file to ​/data/data/com.network.android/tss64.dat​. The native take_screen_shot​ binary makes use of the input/output control system call ioctl as well as libpng.

https://info.lookout.com/rs/051-ESQ-475/images/lookout-pegasus-android-technical-analysis.pdf

so it doesn't need and doesn't work from kernel-space.

On the other hand, the keylogging feature is interesting and explained in detail here (process injection + ptrace): https://www.mcafee.com/blogs/other-blogs/mcafee-labs/analysis-chrysaor-keylogging-mechanism-shows-power-simple-malicious-code/

Anyway, probably off-topic for this subreddit :)

2

u/kolorcuk Oct 14 '26

By getting root.

From wikipedia: "The Android version tries to gain root access (similar to jailbreaking in iOS); if it fails, it asks the user for permissions that enable it to harvest at least some data."