Lots of websites spread malware by publishing advertisements that distribute malware. Even YouTube's ad network has been compromised in the past. Browser ad blockers and related plugins have there own problems. Can I use iptables to protect against virus and malware attacks from specific web sites?
I recognize that the sites themselves are still vulnerable to attacks through their site software or server which could compromise the end user. I also recognize that using advanced malware software or a proxy can help with this but I'm specifically looking into how much I can do as it relates to iptables.
For example, say I have a home system setup just for online financial transactions (banking, paying bills) and no other web browsing. I have my iptables setup to only allow traffic to/from specific websites (Citi, HSBC, etc). All other sites and services are blocked.
Can iptables block redirect exploits from advertisements on the websites?
Can iptables block malicious downloads that originate from clicking advertisements on those websites?