The best defense is not to click on links and not to download anything from members who have no reputation on the forum. What the forum should do is ban posting any links for newbies, or at least not allow them to be clickable.
I suggested that newbies shouldn't be allowed to post links directly after creating their accounts last year:
What we can do is to have a requirement after creating a new account for users to be able to post links, which means that if someone creates a new account, they shouldn't be able to post links unless they spend a specific amount of time in the forum like 24 hours or something. So if someone joins the forum being interested in the forum itself and plans to stay, they should be okay because they will have the requirement completed within a few days, and those who are doing these things won't be able to post links to promote specific services.
The only exception should be for users buying Copper membership, which means that if someone buys Copper membership, they should be exempted from this requirement and be able to post links immediately.
But apparently, most people were against the idea, saying that there should be no "newbie jail" and that theymos is against it, even though in my opinion, it's not a jail but a prevention from things that we often face. If a newbie gets to have all the functionalities after a couple of days of joining the forum, it shouldn't be a problem for them if their motives behind joining the forum are genuine.