Yes, avast detection caught these kind of infections.
Of course, neither a detection software is perfect and you need to add safe browsing to your habits.