r/ios • u/howmagical • 11h ago
Discussion I believe that I have made the most annoying proof of concept Shortcuts "malware" to date.
To be clear, calling this malware is a bit of a stretch. There's not really any infostealing going on here, rather just something that will annoy a victim and disable their phone.
I've been working on this shortcut "Chokehold" for a while. It drains battery super fast and can even partially obstruct the user from powering off their iPhone via the slider (hard reset still works, of course).
The basic foundation is that it creates an infinite loop by running itself. In this loop, it does many annoying things to drain the battery and to render the victim's phone useless while the shortcut is running.
But there is one issue. Apple has made it so that only 1 instance of a shortcut can run at a time, and that the system waits for a small amount of time before starting the new instance of the shortcut. This gives the user more than enough time to just hit the stop icon in the Shortcuts app.
How does my Shortcut solve this? Well, it uses the shortcuts:// URL handler to run the shortcut instead of an action. Because of how Apple implemented this spawning method, it creates a race condition where two instances of the same shortcut are running at once for a fraction of a second. A side effect of this is that the Shortcuts app now opens every time the loop runs, but this of course can be easily mitigated by those aforementioned annoying actions that kick you to the lock screen and home screen so you don't have time to press the stop button.
Pair this with the right actions such as toggle appearance, which causes the phone to stall for a second while toggling dark mode, and this becomes a pretty effective shortcut for disabling someone's phone. As I said before, this can even prevent the user from turning off their phone through the software, though it's absolutely not impossible.
Here are the actions in the shortcut and the purpose they serve:
Lock the screen
- To immediately combat Shortcuts opening from the previous run
Show notification "(any text)"
- Primarily an annoyance and battery drainer (vibration, sound)
Toggle appearance
- Stalls the phone
Open URL "shortcuts://run-shortcut?name=(shortcut name)"
- Spawns a new instance of the shortcut, every action below this still runs even while the new one is spawned (max. 3 ASYNC actions, if you're lucky. non async actions that pause the execution of the next will limit this. it depends on when the Shortcuts app finally kills the already active process)
Toggle appearance
- Stalls the phone again (to combat Shortcuts opening)
Go to Home Screen
- To combat Shortcuts opening
Some weak points of Chokehold:
Chokehold does not affect all iPhone models equally. Slower models might be able to escape, since the pause between the actions that prevent you from interacting with the Shortcuts app can become longer.
- This also applies to newer iPhones, just only when they're thermal throttling.
- Chokehold does not prevent the user from hard resetting the phone.
- Chokehold does not persist after a reboot.
- An Enable Zoom action might help prevent a user from stopping the shortcut, but in my testing, it adds too much execution time for the race condition to succeed.
- As Shortcuts now describes what the shortcut does with Siri AI by default, rather than showing the actions, it can be made very obvious to the user that the shortcut is malicious, and therefore it will be hard to convince people to run it in the first place.