View previous topic :: View next topic |
Author |
Message |
Dr.Black.85 n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
![](images/avatars/144277005143e3c45e75869.jpg)
Joined: 19 Dec 2005 Posts: 55 Location: Czech Republic
|
Posted: Sat Feb 11, 2006 7:39 pm Post subject: [SOLVED] - How to setup a basic blocking of specific IP's? |
|
|
Hello,
I've been searching these forums for a basic way how to prevent access to specific webservers but I couldn't find how to prevent access to some web pages. It can be a really basic way since I don't expect that about 10year children will find a way to bypass it.
What kind of application would you recommend and how to add there banned IP's?
And some important things:
- It should be an application for workstations since there's no real server in the LAN except the router.
- It should be capable of sending me an e-mail of any attemp of access to that server.
Thanks for your help. _________________ How will you notice that you spend too much time programming?
When you're surprised that your document writer isn't marking lines unfinished by semicolon with "cannot find symbol"
Last edited by Dr.Black.85 on Sun Feb 12, 2006 3:42 pm; edited 1 time in total |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Teetante Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
![](images/avatars/133375206543bb2a682d9a0.jpg)
Joined: 02 Mar 2004 Posts: 515 Location: Oldenburg/Germany
|
Posted: Sat Feb 11, 2006 8:01 pm Post subject: Re: How to setup a basic blocking of specific IP's? |
|
|
Dr.Black.85 wrote: | Hello,
I've been searching these forums for a basic way how to prevent access to specific webservers but I couldn't find how to prevent access to some web pages. It can be a really basic way since I don't expect that about 10year children will find a way to bypass it.
What kind of application would you recommend and how to add there banned IP's?
And some important things:
- It should be an application for workstations since there's no real server in the LAN except the router.
- It should be capable of sending me an e-mail of any attemp of access to that server.
Thanks for your help. |
Well you should setup a proxyserver like squid to handle all web traffic. All browsers must then be pointed to that proxy server to handle their requests. If someone disabled the use of proxy servers in his browser it would of course fail.
A real solution could only be built on the router (either filter _all_ access to the IPs/Hosts) or by only allowing the proxy process direct HTTP/HTTPS connects. _________________ ICQ #81510866 - http://the-gay-bar.com - MSN tante@emptiness.de
Occam's Razor:
-"Entia non sunt multiplicanda praeter necessitatem."- |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Dr.Black.85 n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
![](images/avatars/144277005143e3c45e75869.jpg)
Joined: 19 Dec 2005 Posts: 55 Location: Czech Republic
|
Posted: Sat Feb 11, 2006 8:21 pm Post subject: Re: How to setup a basic blocking of specific IP's? |
|
|
Teetante wrote: | A real solution could only be built on the router (either filter _all_ access to the IPs/Hosts) or by only allowing the proxy process direct HTTP/HTTPS connects. |
Thanks for the advise however the problem with the router is that it doesn't have pretty much functions. And in something called "Access control" I could only select game protocols to disable or to disable access to ALL webservers.
Isn't there some other way like howto ensure that the proxy won't be bypassed? I'm leaving the LAN unmanned from Monday to Wednesday and I wouldn't like to see that when I was gone some child was browsing webpages he/she shoudln't be able to...
I know I asked about a basic solutions but the problem is that I wouldn't like to underestimate a situation when someone older will come and turn the proxy of by himself. _________________ How will you notice that you spend too much time programming?
When you're surprised that your document writer isn't marking lines unfinished by semicolon with "cannot find symbol" |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Teetante Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
![](images/avatars/133375206543bb2a682d9a0.jpg)
Joined: 02 Mar 2004 Posts: 515 Location: Oldenburg/Germany
|
Posted: Sat Feb 11, 2006 8:29 pm Post subject: Re: How to setup a basic blocking of specific IP's? |
|
|
Dr.Black.85 wrote: | Teetante wrote: | A real solution could only be built on the router (either filter _all_ access to the IPs/Hosts) or by only allowing the proxy process direct HTTP/HTTPS connects. |
Thanks for the advise however the problem with the router is that it doesn't have pretty much functions. And in something called "Access control" I could only select game protocols to disable or to disable access to ALL webservers.
Isn't there some other way like howto ensure that the proxy won't be bypassed? I'm leaving the LAN unmanned from Monday to Wednesday and I wouldn't like to see that when I was gone some child was browsing webpages he/she shoudln't be able to...
I know I asked about a basic solutions but the problem is that I wouldn't like to underestimate a situation when someone older will come and turn the proxy of by himself. |
Well you could disable net access in the router for the child's PC and build the proxy on one of your other PCs. The child can either use the proxy then or has no net whatsoever. Of course that would cut off everything not handled by the proxy. _________________ ICQ #81510866 - http://the-gay-bar.com - MSN tante@emptiness.de
Occam's Razor:
-"Entia non sunt multiplicanda praeter necessitatem."- |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Dr.Black.85 n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
![](images/avatars/144277005143e3c45e75869.jpg)
Joined: 19 Dec 2005 Posts: 55 Location: Czech Republic
|
Posted: Sat Feb 11, 2006 8:40 pm Post subject: |
|
|
The posibility of building a physical proxy here is practicly minimal since there is a few of computers with local users...
Isn't there something like a daemon that would watch any internet traffic coming in an out on the physical computer? Something that wouldn't have to be specified in the browser settings? Something that would simply block any incoming packets from a given IP and notify me about such attemps?
I managed to read something about banning IP's from servers side. Couldn't something like that be used?
I know that I must be really an annoying n00b since I haven't expected that I'll have to leave active access to internet when I'm gone... _________________ How will you notice that you spend too much time programming?
When you're surprised that your document writer isn't marking lines unfinished by semicolon with "cannot find symbol" |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Teetante Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
![](images/avatars/133375206543bb2a682d9a0.jpg)
Joined: 02 Mar 2004 Posts: 515 Location: Oldenburg/Germany
|
Posted: Sat Feb 11, 2006 9:11 pm Post subject: |
|
|
Dr.Black.85 wrote: | The posibility of building a physical proxy here is practicly minimal since there is a few of computers with local users...
Isn't there something like a daemon that would watch any internet traffic coming in an out on the physical computer? Something that wouldn't have to be specified in the browser settings? Something that would simply block any incoming packets from a given IP and notify me about such attemps?
I managed to read something about banning IP's from servers side. Couldn't something like that be used?
I know that I must be really an annoying n00b since I haven't expected that I'll have to leave active access to internet when I'm gone... |
Well if you can get a proxy running in that network you should be able to use itables to let the clients do HTTP and HTTPS connection just to the comuter that you made the proxy. If the other computers are not linux boxes, maybe some software firewall might do the same.
If you cannot get a proxy running you could of course setup a software firewall on each client and deny certain sites (but you'll have to do that manually on every client).
But for a real solution you might wanna replace your hardware router with a little linux box to get rid of problems like that one. An old Pentium takes care of our DSL here for example (using Fli4L, a special Linux distribution for Router/Proxy use). _________________ ICQ #81510866 - http://the-gay-bar.com - MSN tante@emptiness.de
Occam's Razor:
-"Entia non sunt multiplicanda praeter necessitatem."- |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Dr.Black.85 n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
![](images/avatars/144277005143e3c45e75869.jpg)
Joined: 19 Dec 2005 Posts: 55 Location: Czech Republic
|
Posted: Sat Feb 11, 2006 9:23 pm Post subject: |
|
|
Thanks for the reply.
There's not much computers in the LAN so I will just install a firewall. I've already ran some search about GUI frontends for iptables that I found in net-firewall section.
Which frontend should I use if I want to receive alerts via e-mail about atempts to reach blacklisted sites because it's quite important to know which user tried to do it.
I'll probably let it work on for "pedagogical" issues. I can only guess how many corious students will have a problem. At least there will be some fun ![Laughing :lol:](images/smiles/icon_lol.gif) _________________ How will you notice that you spend too much time programming?
When you're surprised that your document writer isn't marking lines unfinished by semicolon with "cannot find symbol" |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
nms n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
![](images/avatars/122919549443ef45584c0f6.jpg)
Joined: 16 Jul 2005 Posts: 43 Location: Umeå, Sweden
|
Posted: Sun Feb 12, 2006 1:24 am Post subject: |
|
|
The most sensible solution in this situation is probably using a proxy like Squid, just like suggested. In combination with iptables this can be used completely transparent to the user and his/her web browser, which means there is no way for the user to avoid using the proxy. The proxy can then be set up to block certain web sites based on host/domain name.
As far as e-mail alerts go, you would probably need some sort of tool that scans the proxy log once a day (or at whatever interval you feel is necessary) and sends you a list of any attempts to access blocked web sites.
How much control do you need regarding what individuals are trying to access what? Is each and every individual using his/her own computer (and static IP address) on the local network, or does each individual have a personal user account for logging in to shared computers? There are a number of variables depending on the actual hardware (how many systems, how many individuals etc) and software (personal or shared user accounts, operating systems etc) configuration of your network.
I'm quite sure that your specific needs can be met without anyone growing too many grey hairs, you just need to figure out what those needs are. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Dr.Black.85 n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
![](images/avatars/144277005143e3c45e75869.jpg)
Joined: 19 Dec 2005 Posts: 55 Location: Czech Republic
|
Posted: Sun Feb 12, 2006 9:07 am Post subject: |
|
|
Well, the LAN consists from 3 permanently connected computers and some laptops. Each computer has local users since I didn't mind of creating server side users (if there is no server I couldn't do it all ).
It would be nic to know which user tried to accessed a blacklisted site, when he tried it and what was the target IP/domain. I looked at some mailing scripts and I guess that with some work I could write a wokring one in few hours and then simply put it in cron. If there isn't a simplier solution of course. _________________ How will you notice that you spend too much time programming?
When you're surprised that your document writer isn't marking lines unfinished by semicolon with "cannot find symbol" |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
nms n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
![](images/avatars/122919549443ef45584c0f6.jpg)
Joined: 16 Jul 2005 Posts: 43 Location: Umeå, Sweden
|
Posted: Sun Feb 12, 2006 1:19 pm Post subject: |
|
|
Quote: | Each computer has local users since I didn't mind of creating server side users (if there is no server I couldn't do it all ). |
This confuses me a bit; are the users local to each client system or network wide?
I would guess that Squid can perform ident lookups on the client when it tries to access a blacklisted site, but I haven't used Squid in a couple of years so I can't say for sure. If it can't do ident lookups, it wouldn't be much of a hassle to compare time in the Squid log to those in the client system auth log. If the clients are MSWin (which you failed to mention), this would require that you are using Samba or similar as domain controller and that all logins on the client machines are done to the domain so that Samba logs all logins. If all clients are *nix you could set up remote logging on the clients so that all client auth log events are sent to your firewall instead of stored on the client disk. Both of these solutions of course requires that the client systems are in your control.
The script to scan the logs and send e-mail alerts should be easy enough to put together, but as I don't have any Squid logs handy I'm having trouble giving you an example of this. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Dr.Black.85 n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
![](images/avatars/144277005143e3c45e75869.jpg)
Joined: 19 Dec 2005 Posts: 55 Location: Czech Republic
|
Posted: Sun Feb 12, 2006 2:14 pm Post subject: |
|
|
- All the computers are running Gentoo Linux (for budget, reliability and control reasons).
- All user accounts are local.
I tried to include iptables in the kernel of one computer but I probably did something wrong because it ruined the eth0 module so I recovered it and unmerged the iptables.
So should I try that Squid proxy? I hope it doesn't require any kernel modifications since I was quite on nerves when I was recovering the functioning kernel for about 2 hours (I couldn't find to where I have backed up the configuration). _________________ How will you notice that you spend too much time programming?
When you're surprised that your document writer isn't marking lines unfinished by semicolon with "cannot find symbol" |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
nms n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
![](images/avatars/122919549443ef45584c0f6.jpg)
Joined: 16 Jul 2005 Posts: 43 Location: Umeå, Sweden
|
Posted: Sun Feb 12, 2006 2:35 pm Post subject: |
|
|
For Squid to work transparently and thereby not require any configuration on the client systems you need Netfilter (iptables) in the kernel. This should not be a problem, as the only modification you need to make to the kernel configuration is to enable all the iptables modules. Netfilter is required to make any outgoing connections on port 80 (www) redirect to port 3346 (transparent proxy).
This proxy system of course needs to be placed between the network of local computers (the client systems) and the external network (the "internet connection"), which usually means it will need two network interface cards. There are ways to work around this, but this is the easiest way to do things.
Do any of the individual users have root access to any of the client systems? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Dr.Black.85 n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
![](images/avatars/144277005143e3c45e75869.jpg)
Joined: 19 Dec 2005 Posts: 55 Location: Czech Republic
|
Posted: Sun Feb 12, 2006 2:45 pm Post subject: |
|
|
nms wrote: | Do any of the individual users have root access to any of the client systems? |
The only person who have root access is me. And I wouldn't like to play with the kernel again since when I turned the iptables in the kernel the eth0 refused to work with "no such device".
Couldn't I use Squid on each computer without any manipulation with the kernel? I have assured myslef that all the users have no idea what a proxy is so I gues that they won't know what to do with the settings to bypass it. _________________ How will you notice that you spend too much time programming?
When you're surprised that your document writer isn't marking lines unfinished by semicolon with "cannot find symbol" |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
nms n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
![](images/avatars/122919549443ef45584c0f6.jpg)
Joined: 16 Jul 2005 Posts: 43 Location: Umeå, Sweden
|
Posted: Sun Feb 12, 2006 3:30 pm Post subject: |
|
|
The proxy settings are very easy to bypass if they are set in the web browser, but you know your users better than I do.
I would recommend against running a web proxy on each client system since it would probably slow each system down. Web proxies are normally run on a separate system to speed up web access for all clients using that proxy, since it stores files retreived by one client and then uses the locally cached copy of the file if it is requested again (by the same or another client). Blacklisting web sites is just a "bonus" functionality that web proxies like Squid offer.
If you are only interested in blocking web sites and not the web proxy in general you could always set up a local DNS that points all blacklisted hosts to a local web server that delivers an error message. This will make logging and e-mail alerts a lot more difficult though. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Dr.Black.85 n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
![](images/avatars/144277005143e3c45e75869.jpg)
Joined: 19 Dec 2005 Posts: 55 Location: Czech Republic
|
Posted: Sun Feb 12, 2006 3:42 pm Post subject: |
|
|
Well I think I'll go for the proxy on all local systems that can be accessed by students since there is no computer that I could use as a plain proxy system or a DNS. Well, I'll see how it turns out.
Thanks for the advise nms. _________________ How will you notice that you spend too much time programming?
When you're surprised that your document writer isn't marking lines unfinished by semicolon with "cannot find symbol" |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|