Gad-2 wrote:
can i do anything to know for sure if i'm compromised or not ? also it's a fresh device with no data at all but i loggen into my accounts on it apple and google accounts, could it have access to my browser data that is saved on the cloud ?
I don't know if you could "prove" you are "ok" because whatever you look for, you might miss something.
Instead of trying to figure out what might have happened, assume the worst and make a clean start.
I think changing the Apple ID and Google (and all other) passwords is how to start. Especially if they are synchronized across multiple devices. Now is the time to act before someone else does something.
Wiping the Mac and restoring from a backup predating the "event" plus changing ALL passwords makes you quite secure, I think. By the way, ALL passwords includes banking, all logins to web sites, social media, Microsoft-365, emails, Netflix etc., everything. As all that stuff from Keychain or Passwords or caches or browser saved data could be accessed and sent out to whomever instigated this. Some passwords and credit card info is saved in these places. In fact I think that is what those nasty scripts try to do that you might have unintentionally executed in Terminal.
Also, temporarily disable Wallet on all your devices. Definitely monitor all your credit cards and debit accounts carefully going forward.
I don't think I would be able to sleep at night until I did these things if this happened to me. Don't waste time or energy rethinking or regretting what happened, just focus on what you need to do going forward.
Lesson learned might be to be very cautious about any use of Terminal. And never to insert any code externally found or generated into your Mac via scripts or Terminal commands.