DDoS and malware attack


We have implemented defender in our most of the sites, but still got malware attack and got all JS files infected. My all sites got started redirecting to affiliate and porn sites.

My query is that does Defender not cover XSS and DDoS attack on websites? Because when we took support from sucuri – we realised that even Defender folder got affected with this attack and had no clue how to fix it.

Kindly advise what we need to do to avoid such malware attacks and getting our site affected.