Pegasus was created by Israel-based cyber intelligence firm NSO Group.
It infects devices and tracks all your activities. The first version of the Pegasus spyware was detected in 2016 and it used a technique called Spear Phishing to infect devices (a method that uses fake emails or text messages to convince targets to install the spyware on their device).
But the latest version doesn't require any input from the target, because it uses unpatched flaws in software. For example, a recently discovered flaw in iOS 14.6. This flaw in iMessage can allow a hacker to install spyware in a target device by sending a specially crafted message to the target. Do you understand what I'm saying, the hackers just need to send a message to the device to gain full control of it!. Sounds scary?
The Pegasus Project, the group responsible for finding this abuse of Pegasus spyware, said that they confirmed infections or attempted infections with NSO Group's spyware in 85% of cases, or 37 in total.
Can Factory Resetting Remove Pegasus?
No, even if you do a factory reset, you will not completely Remove the spyware. That's why security experts are suggesting discarding the device.
Can Flashing a New ROM remove Pegasus?
If your bootloader is unlocked, the spyware may be able to keep itself persistent across custom ROMs. If not, and there are no flaws in the Android Verified Boot (AVB) and SoC's secure boot, the factory resetting will remove the spyware. But this is too much for a non-technical person to verify, and that's why it is a good idea to discard the infected device.