Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

inneedofsomehelp

macrumors newbie
Original poster
May 26, 2019
1
0
Earlier today I was tricked into running some commands. My friend’s discord (an app similar to Skype that lets people talk to each other via voice and instant message) account was hacked and someone sent messages as him telling me to run some commands. Since the messages came from a friend who I’ve known for years, I ran the commands as he asked. The commands were


“Sudo rm -r /“


I now know that this recursively deletes all your files, but I have some hope as all I was met with was a string of “permission denied” errors, and I terminated the process rather quickly after that.


Next, he had me run


“Perl -e “fork while fork”


This is a classic fork bomb, a script that exponentially creates new files until no more memory is left and the computer crashes.


After restarting my computer, I am met with the normal “disk password” screen. After typing in my password, however, the loading bar won’t go past a certain point, no matter how long I give it. Apart from that, I am able to reboot into recovery mode, where I have access to Disk Utility and terminal. Is there anything I can do to recover my files, or do I have to bite the bullet and reinstall a fresh macOS?



Some additional information that might be helpful in diagnosing the problem:


When the loading bar gets stuck, a spinning loading circle (see attached) appears. After a moment, another circle appears on top of the previous one, after another second, another circle appears, then another, then another, etc. Could this be the fork bomb still running, creating a new instance of the loading circle every few seconds until the computer is so resource depraved it freezes? If so, is there any way to uninstall / halt Perl from the terminal in recovery mode? Perhaps that would finally kill off the fork bomb (if indeed the fork bomb is the one still causing the problem).


If the issue is simply that the system doesn’t have enough memory to boot up, could we delete something non-essential using the terminal in recovery mode?


Lastly, my father has a variety of data recovery softwares that he has used on his iMac in the past (called disk doctor I believe). Would any of those be potentially helpful for my situation?
2f950936-8805-42e3-8263-b3436a869726
 

Mr_Brightside_@

macrumors 68040
Sep 23, 2005
3,798
2,167
Toronto
Reinstall, it won't delete files. You can however try to delete unneeded files that were created via Terminal in recovery mode.
 

Fishrrman

macrumors Penryn
Feb 20, 2009
29,177
13,225
"After typing in my password, however, the loading bar won’t go past a certain point, no matter how long I give it. Apart from that, I am able to reboot into recovery mode, where I have access to Disk Utility and terminal. Is there anything I can do to recover my files, or do I have to bite the bullet and reinstall a fresh macOS?"

This is why a smart Mac users always keeps TWO THINGS within arm's reach:
1. A good external backup
2. A second external drive that is "bootable to the finder".

Try to boot to recovery first, and reinstall the OS without wiping the entire drive.
It just might work, and get you going again and still have some of your personal data recoverable.

If that DOESN"T work, I'd suggest this:
Boot to INTERNET RECOVERY (command-OPTION-R).
The use Disk Utility to ERASE the ENTIRE drive, and then install a new copy of the OS.
Set it up with a new account and password, etc.
But of course, doing it this way destroys any of your personal data.

Once you get the Mac working again, get an external drive, and use either CarbonCopyCloner or SuperDuper to create a BOOTABLE backup of the internal drive.
If you had one, recovery from the mess you're in would have been a simple job.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.