How to block most ads and malware sites!

Discussion in 'Archives' started by The Black Tux, Apr 5, 2011.

How to block most ads and malware sites!
  1. Unread #1 - Apr 5, 2011 at 7:17 PM
  2. The Black Tux
    Joined:
    Apr 19, 2009
    Posts:
    10,306
    Referrals:
    30
    Sythe Gold:
    55
    Vouch Thread:
    Click Here
    Two Factor Authentication User Cool Kid Former OMM Cook RsProd Sythe Awards 2012 Winner Village Drunk

    The Black Tux Veteran
    The Black Tux Donor Java Programmers PHP Programmers

    How to block most ads and malware sites!

    How to block most ads & some malware sites.

    1. Introduction

      In this guide I will teach you how to block most of the sites that provide the ads and a few detected servers around the world that distribute malware using the hosts found at mvps.org in Windows ; I will teach you how to setup it and check if it's working once you are done. This might be a simple guide, but a very useful one. Note: I will post the location of the hosts file for Linux and Mac, you can follow the guide using the programs of you operating system.

    2. Understanding how it works
      • Host File:

        "The hosts file is a computer file used in an operating system to map hostnames to IP addresses. The hosts file is a plain-text file and is traditionally named hosts." From Wikipedia.org

        "The Hosts file contains the mappings of IP addresses to host names. This file is loaded into memory (cache) at startup, then Windows checks the Hosts file before it queries any DNS servers, which enables it to override addresses in the DNS. This prevents access to the listed sites by redirecting any connection attempts back to the local (your) machine. Another feature of the HOSTS file is its ability to block other applications from connecting to the Internet, providing the entry exists.

        You can use a HOSTS file to block ads, banners, 3rd party Cookies, 3rd party page counters, web bugs, and even most hijackers. This is accomplished by blocking the connection(s) that supplies these little gems"
        From mvps.org

      • Location of the hosts file:
        • Linux: /etc/hosts
        • Windows: %SystemRoot%\system32\drivers\etc\
        • Mac OS X: /private/etc/hosts

        [​IMG]

      • Editing hosts file: You must use Administrator/root privileges, and just use a text editor.

        [​IMG]

    3. Getting the hosts

      We'll be using the plain text file provided by mvps.org at http://www.mvps.org/winhelp2002/hosts.txt

      You must copy from
      Code:
      #start of lines added by WinHelp2002
      # [Misc A - Z]
      [​IMG]

      To the end of the file

      [​IMG]

      You can now save the file!

      [​IMG]

    4. Checking it works!
      We must now ping any address that it's on the file. Type this on cmd/terminal/ssh
      Code:
      ping images.adster.com
      It should show something like this:
      [​IMG]

    Enjoy 0.00001% ads browsing with more malware protection!

    Thanks for reading!
     
  3. Unread #2 - Apr 8, 2011 at 11:25 PM
  4. lilpjer
    Joined:
    Jul 11, 2009
    Posts:
    2,009
    Referrals:
    3
    Sythe Gold:
    0

    lilpjer Grand Master
    Banned

    How to block most ads and malware sites!

    Nice guide. Thanks for adding the pictures and colored text. 9/10!
     
  5. Unread #3 - Apr 9, 2011 at 3:16 PM
  6. The Black Tux
    Joined:
    Apr 19, 2009
    Posts:
    10,306
    Referrals:
    30
    Sythe Gold:
    55
    Vouch Thread:
    Click Here
    Two Factor Authentication User Cool Kid Former OMM Cook RsProd Sythe Awards 2012 Winner Village Drunk

    The Black Tux Veteran
    The Black Tux Donor Java Programmers PHP Programmers

    How to block most ads and malware sites!

    Thanks for your comment.
     
  7. Unread #4 - Apr 9, 2011 at 4:05 PM
  8. Vibes
    Joined:
    Feb 2, 2008
    Posts:
    308
    Referrals:
    0
    Sythe Gold:
    95
    Discord Unique ID:
    219820071055261706
    Discord Username:
    Vibes
    Two Factor Authentication User

    Vibes Forum Addict

    How to block most ads and malware sites!

    Nice guide. Thanks!

    Easy to understand, precise, and to the point. (y)

    9/10
     
  9. Unread #5 - Apr 9, 2011 at 4:35 PM
  10. The Black Tux
    Joined:
    Apr 19, 2009
    Posts:
    10,306
    Referrals:
    30
    Sythe Gold:
    55
    Vouch Thread:
    Click Here
    Two Factor Authentication User Cool Kid Former OMM Cook RsProd Sythe Awards 2012 Winner Village Drunk

    The Black Tux Veteran
    The Black Tux Donor Java Programmers PHP Programmers

    How to block most ads and malware sites!

    Thanks for you comment Vibes
     
  11. Unread #6 - Apr 10, 2011 at 1:48 AM
  12. Delta bot
    Joined:
    Feb 7, 2011
    Posts:
    78
    Referrals:
    0
    Sythe Gold:
    0

    Delta bot Member

    How to block most ads and malware sites!

    the bad thing about this is that can slow down you browsing speed it can also cause a process named svchosts to use a lot of ram and cpu speed.

    Oh and there is a program you can use for this.
    Its called hostsman and it has a couple of blacklists in it. you can also auto update it with this program.
     
  13. Unread #7 - Apr 10, 2011 at 1:15 PM
  14. The Black Tux
    Joined:
    Apr 19, 2009
    Posts:
    10,306
    Referrals:
    30
    Sythe Gold:
    55
    Vouch Thread:
    Click Here
    Two Factor Authentication User Cool Kid Former OMM Cook RsProd Sythe Awards 2012 Winner Village Drunk

    The Black Tux Veteran
    The Black Tux Donor Java Programmers PHP Programmers

    How to block most ads and malware sites!

    I did a test, and even though I have 10+ svchost.exe process, all are at 0% CPU usage, one once in a while only one go to 1-2%
     
  15. Unread #8 - Apr 10, 2011 at 7:40 PM
  16. kxracer1219
    Joined:
    Jun 29, 2010
    Posts:
    793
    Referrals:
    1
    Sythe Gold:
    0

    kxracer1219 Apprentice
    Banned

    How to block most ads and malware sites!

    Great guide, keep up the good work.
     
  17. Unread #9 - Apr 10, 2011 at 9:31 PM
  18. The Black Tux
    Joined:
    Apr 19, 2009
    Posts:
    10,306
    Referrals:
    30
    Sythe Gold:
    55
    Vouch Thread:
    Click Here
    Two Factor Authentication User Cool Kid Former OMM Cook RsProd Sythe Awards 2012 Winner Village Drunk

    The Black Tux Veteran
    The Black Tux Donor Java Programmers PHP Programmers

    How to block most ads and malware sites!

    Thanks for your comment kxracer.
     
  19. Unread #10 - Apr 11, 2011 at 7:12 PM
  20. Krypton6
    Joined:
    Aug 17, 2007
    Posts:
    1,020
    Referrals:
    0
    Sythe Gold:
    0

    Krypton6 Guru
    $5 USD Donor

    How to block most ads and malware sites!

    good guide, thanks. I will try this sometime
     
  21. Unread #11 - Apr 11, 2011 at 8:22 PM
  22. The Black Tux
    Joined:
    Apr 19, 2009
    Posts:
    10,306
    Referrals:
    30
    Sythe Gold:
    55
    Vouch Thread:
    Click Here
    Two Factor Authentication User Cool Kid Former OMM Cook RsProd Sythe Awards 2012 Winner Village Drunk

    The Black Tux Veteran
    The Black Tux Donor Java Programmers PHP Programmers

    How to block most ads and malware sites!

    Thanks for you comment Krypton
     
  23. Unread #12 - Apr 11, 2011 at 8:37 PM
  24. xOneDown
    Joined:
    May 29, 2010
    Posts:
    871
    Referrals:
    1
    Sythe Gold:
    0

    xOneDown Apprentice

    How to block most ads and malware sites!

    Hey, thanks a ton for the guide :) One question though, when I do the ping part in cmd, I'm getting 2 packets received, 2 lost. Why is that? =]
     
  25. Unread #13 - Apr 11, 2011 at 8:38 PM
  26. The Black Tux
    Joined:
    Apr 19, 2009
    Posts:
    10,306
    Referrals:
    30
    Sythe Gold:
    55
    Vouch Thread:
    Click Here
    Two Factor Authentication User Cool Kid Former OMM Cook RsProd Sythe Awards 2012 Winner Village Drunk

    The Black Tux Veteran
    The Black Tux Donor Java Programmers PHP Programmers

    How to block most ads and malware sites!

    Thanks for your comment.

    What's the address being pinged 127.0.0.1?

    Add me in msn :)
     
  27. Unread #14 - Apr 11, 2011 at 8:41 PM
  28. xOneDown
    Joined:
    May 29, 2010
    Posts:
    871
    Referrals:
    1
    Sythe Gold:
    0

    xOneDown Apprentice

    How to block most ads and malware sites!

    Added, thanks :)

    edit: btw, yes it's pinging 127.0.0.1
     
  29. Unread #15 - Apr 21, 2011 at 6:19 AM
  30. Poyzon
    Joined:
    Apr 19, 2011
    Posts:
    54
    Referrals:
    0
    Sythe Gold:
    0

    Poyzon Member
    Banned

    How to block most ads and malware sites!

    Hey great guide man
     
  31. Unread #16 - May 3, 2011 at 6:43 PM
  32. Divine blob
    Joined:
    Mar 14, 2007
    Posts:
    1,289
    Referrals:
    2
    Sythe Gold:
    0

    Divine blob Guru

    How to block most ads and malware sites!

    Hey man, this is a pretty simple guide! You should spice it up, with like programs like adblock plus or like add colour as its so bland it should be changed bro
     
  33. Unread #17 - May 3, 2011 at 7:30 PM
  34. 1ce
    Joined:
    Mar 11, 2011
    Posts:
    261
    Referrals:
    1
    Sythe Gold:
    0

    1ce Forum Addict
    Banned

    How to block most ads and malware sites!

    Hosts file isn't just for 'blocking' it's to assist with ns assistance / forwarding.

    Also ping gets resolved into an IP so you'd be blocking the whole server. Hardly effective. You should use DNSutil/Bind's utilities for that purpose, you could also output a zone transfer with '>> zone.txt' and you'll have a nice block list.

    Also hosts doesn't do domain name, it can only handle IP resolution so using it as an 'add blocker' typically creates more problems than it does solutions.

    Not to hate on your guide but I don't recomend following OP's instructions, try updating firefox instead?

    1ce
     
  35. Unread #18 - May 3, 2011 at 7:33 PM
  36. The Black Tux
    Joined:
    Apr 19, 2009
    Posts:
    10,306
    Referrals:
    30
    Sythe Gold:
    55
    Vouch Thread:
    Click Here
    Two Factor Authentication User Cool Kid Former OMM Cook RsProd Sythe Awards 2012 Winner Village Drunk

    The Black Tux Veteran
    The Black Tux Donor Java Programmers PHP Programmers

    How to block most ads and malware sites!

    I use AdBlock and some custom rules with Firefox, but blocking with this has worked pretty good, I've had to remove a few in some cases though.

    Thanks for the feedback
     
  37. Unread #19 - May 3, 2011 at 8:01 PM
  38. Divine blob
    Joined:
    Mar 14, 2007
    Posts:
    1,289
    Referrals:
    2
    Sythe Gold:
    0

    Divine blob Guru

    How to block most ads and malware sites!

    but you know you see this is not good as you will not understand what is blocking if you block it with the hosts file
     
  39. Unread #20 - May 3, 2011 at 8:06 PM
  40. 1ce
    Joined:
    Mar 11, 2011
    Posts:
    261
    Referrals:
    1
    Sythe Gold:
    0

    1ce Forum Addict
    Banned

    How to block most ads and malware sites!

    Firefox does pretty good but every now and again one slips through.

    The problem is that you'd be blocking the whole IP and consequently everything the DNS could provide for you, and not just by socket value. Would work a little like this:

    You ping an add and ping returns with the IP, so you use hosts to redirect it to localhost. It works, but only until you realize you just blocked google because the domain name you pinged is sharing an IP off google's server.

    A decent Firewall will do the same thing, if you do netstat -an -p TCP you should get the socket it's sent on, :)80, :8080, etc) and you can simply block web adds and leave other services open.


    [​IMG]
    works pretty good.


    Sincerely, 1ce
     
< [Free-For-All] Massive Pure Slaughter Fest [Free-For-All] Your Thoughts? | Insomnia/Depression >

Users viewing this thread
1 guest


 
 
Adblock breaks this site