To be honest, these kinds of scripts are considered pretty script kiddie levels and they have existed ever since bitcoin first started. If you do not click on any of the pretty obvious "free btc for doing A or installing B" sites and you are not greedy and do not visit weird sites, you should be pretty safe.
Really? Those scripts are still in "kiddie" level? Amazing
So that virus can be acquired usually through entering untrusted sites, now I know! and I feel relieved because I'm not that kind of person who easily enter to those such kind of sites. I'm not too dumb to believe in " earn free bitcoins, click here" statements.
I think from now on I will double check the address carefully every time I will send coins to someone because honestly, I always skip checking the address of my receivers before, I only look at the last letter/number and if it matches from what I copied then that's it.