LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 08-04-2014, 02:52 AM   #1
Michael13
LQ Newbie
 
Registered: Jul 2014
Posts: 20

Rep: Reputation: Disabled
Red face bad domain blocking program


Is there any program that would block bad domains for a linux ubuntu (lubuntu)? I mean something similar to spywareblaster on windows. Thanks and sorry for this.
 
Old 08-04-2014, 03:09 AM   #2
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680

Rep: Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373
You could, perhaps, look into creating a hosts file to block such domains. This seems to be a fairly good explanation of the hosts file but I'm sure you could find better with a little research:
http://www.bleepingcomputer.com/tuto...les-explained/
For web browsing thngs like NoScript and AdblockPlus go a long wAy towards removing unwanted content and Firefox and Chrome actually have built-in procedures to check domains against a list of known malicious domains held by Google which is somewhat controversial.
 
Old 08-04-2014, 11:10 AM   #3
Michael13
LQ Newbie
 
Registered: Jul 2014
Posts: 20

Original Poster
Rep: Reputation: Disabled
Thanks for the link! I downloaded the host file from here http://winhelp2002.mvps.org/hosts.htm and thought it would be as easy to use as replace the host file on /etc directory but that was not the case lol I tried to copy it there but it said permission denied... I think i need to use the "sudo" command to achieve that but i quess linux does not have similar copy command that windows has like copy hosts c:\windows... like i quess "sudo copy hosts /etc" or something like that lol dont work... Can someone tell me the correct command to replace the hosts file? Thanks you very much!
 
Old 08-04-2014, 11:23 AM   #4
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680

Rep: Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373
I would advise against simply replacing your existing hosts file as your host name or others you need may well be defined there. You could open the file with an editor like gedit by using something like:
Code:
gedit /etc/hosts
and when you're comfortable you know what any existing entries are you could add them to the top of the file you downloaded and copy it in place of your existing hosts file by doing the following:
Code:
sudo cp /etc/hosts /etc/hosts.backup
sudo cp /home/michael/Download/hosts.txt /etc/hosts
Changing the file paths in the above to suit the name and location of the file you downloaded. I have just remembered though that Windows text files are of a slightly different format to Linux ones so you may have to use dos2unix on the file first to convert it.
I should also point out that it is a very good idea to read through the hosts file and understand all the entries in there as I have not personally read that hosts file so I can't confirm whether there are any mistakes, site you wouldn't want to block etc..
 
Old 09-17-2014, 05:13 PM   #5
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Yeah, right. If there's anything bloated and ineffective it's that hosts file. Deities know why people keep promoting it... Using /etc/hosts for redirecting lookups like that is a crude, past millennium way of dealing with things. To be more specific it won't help with or can't parse Javascript fun or do path-based filtering, update incrementally, block ad-tracking cookies, block in-page ads residing in a path on the same server you visit, block ads from a hostname of which the domainname is the same as the server you visit, block ads presented through Javascript or Flash, block ads by host or path substring match, block only web bugs, set session-only cookies for a range of sites, selectively block popups, refresh-tags and redirects, keep images with specific sizes from displaying or block visiting domains based on content. On top of that you'll have a hosts file filled with sites you might not even visit, no insight in how filters get added and nobody to vouch for its contents other than this one person.

For effective, usable and efficient distro and browser-agnostic filtering you can't beat a filtering proxy. Disagree? See if your hosts file can "protect" you against "modern" tricks (and I mean this decade, not the past millennium): https://www.linuxquestions.org/quest...9/#post3585760 (BTW don't need to look: it can't.)
 
Old 09-18-2014, 02:34 AM   #6
ReaperX7
LQ Guru
 
Registered: Jul 2011
Location: California
Distribution: Slackware64-15.0 Multilib
Posts: 6,558
Blog Entries: 15

Rep: Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097
One trick I tried was to use Spybot Search and Destroy's bad URL block list in my hosts file. It works fairly well.
 
  


Reply

Tags
dont_use_a_hosts_file



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Blocking Bad Bots & HTACCESS Optimization Hammad101 Linux - Server 5 11-08-2010 02:21 AM
Router domain blocking linuxbird Linux - Networking 1 09-18-2009 09:48 AM
relaydelay blocking fake domain noir911 Linux - Server 0 08-12-2008 01:21 AM
Blocking a domain referrer from a webserver? Seventh Linux - Security 1 02-06-2007 04:28 PM
Blocking Harddisk bad sector wood Programming 8 03-30-2005 07:32 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 04:43 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration