Url Block

  • Thread starter Thread starter Lespaul36
  • Start date Start date
L

Lespaul36

I need to write a program to block certain URLs when web browsing, but I
have not been able to really find anything to help. I was hoping to have a
service running in the back that can check browser windows and compare the
URLs then post a message and shut down the web page if it matches....Any one
have a good starting point for me.

TIA
Dave
 
I need to write a program to block certain URLs when web browsing, but I
have not been able to really find anything to help. I was hoping to have a
service running in the back that can check browser windows and compare the
URLs then post a message and shut down the web page if it matches....Any one
have a good starting point for me.

TIA
Dave

That sounds like the job of a proxy server or a firewall...

The problem with using browser windows is that, how are you going to
know the window for every possible browser... So, you hook IE, but what
if the user decides to fire up Firefox (my fav!) or Mozilla or Opera or
.... No, the only way to do this (unless you know that you will always
be dealing with only one browser) is really to intercept outbound traffic
in the form of a proxy as stated above, or on the low level like a
firewall. The low level would involve the use of raw sockets to sniff
all outbound traffic, and you would probably have an easier time doing
that in C# the VB.NET...

If you know it's always going to be one browser, then you would probably
need to do a system wide hook to recieve all messages related to the
creating of top level windows... Probably WH_SHELL would be the best
choice, since it would only send you notifications for top level
windows, and not for every dialog, button, and menu in the system. But,
that would mean that you would have to step outside of .NET for the
actual hook since this kind of hook must reside in a standard non-com
dll.

Is there some reason that you can't use one of the many available
solutions to this?
 
Tom,

I am glad you write about this in this way, the last time I was scared to
answer this kind of messages because of the lot of messages I had seen about
ports and was in doubt if there was not found a method for this.

You know that I answer this always in context wise exact same way as you did
now.

Cor
 
It is for my nephew...he has been getting in a bit of trouble and is
restricted on his computer use. In the past I have tried a few of the
parenting products out there, but they over did it and then I couldn't seem
to remove them, was a real pain in the but.

He uses IE and he can't install software. I thought there was a way to
block sites using Security Policies, but haven't been able to find much out
about it. I was thinking there might even be a way to do it with IE itself,
but no luck.

I was interested in finding out how a program like that would work also to
further my knowledge. As far as being easier in C#, don't all .net
languages have the same access to the CLR. I do know c#, but I am more
comfortable with vb.
 
It is for my nephew...he has been getting in a bit of trouble and is
restricted on his computer use. In the past I have tried a few of the
parenting products out there, but they over did it and then I couldn't seem
to remove them, was a real pain in the but.

He uses IE and he can't install software. I thought there was a way to
block sites using Security Policies, but haven't been able to find much out
about it. I was thinking there might even be a way to do it with IE itself,
but no luck.

I was interested in finding out how a program like that would work also to
further my knowledge. As far as being easier in C#, don't all .net
languages have the same access to the CLR. I do know c#, but I am more
comfortable with vb.

The main reason that working with raw sockets may be a little easier in
C# is it's ability to use direct memory access (aka, real pointers) via
the unsafe keyword. It's not impossible in VB.NET - but it would be
slower and not as clean.

I would avoid raw sockets. You can write a proxy server - but you'll want
to get familiar with the RFC's related to http. Really, the easiest and
most practicle way is to setup a firewall and filter from there. If you
can't find a reasonably priced hardware firewall that has this ability -
you can always use something like FreeBSD. The nice thing is that you
don't need much of a machine to run it. I'm running FreeBSD 4.11 as a
firewall on a Pentium 200 box with 128MB of RAM and 4GB harddrive.
 
Lespaul.

The sites that you want to block for your little nephew can't mostly not be
blocked even not with the most expensive hardware/software.

They change there IP adresses they change their dns names they use
redirectors from homepage style url's or whatever to prevent that.

(When you dont want to block any access)

Just my thought,

Cor
 
Tom Shelton said:
I would avoid raw sockets. You can write a proxy server - but you'll
want to get familiar with the RFC's related to http. Really, the
easiest and most practicle way is to setup a firewall and filter from

Indy already has proxy components and can be used from VB. Its free with
source too:
http://www.indyproject.org/


--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programming is an art form that fights back"

Empower ASP.NET with IntraWeb
http://www.atozed.com/IntraWeb/
 
Lespaul.

The sites that you want to block for your little nephew can't mostly not be
blocked even not with the most expensive hardware/software.

They change there IP adresses they change their dns names they use
redirectors from homepage style url's or whatever to prevent that.

(When you dont want to block any access)

Just my thought,

Cor

That's true - there are sites that are hard to block without constant
attention.
 
I am going to take a look the proxy idea. However, knowing that he is only
using IE, I am checking out BHOs(Browser Heloper Objects), but I think I may
put that on the back burner for a bit and just do some research until I get
more time.
 
I don't mean this to sound sarcastic (although I think it will come across
that way), but have your nephew's parents considered spending time with him
while he is on the computer and being involved in what he does to ensure
that he doesn't do things that can get him in trouble?

Perhaps it would be worthwhile moving his computer away from the solitude
and privacy of his room into a more open environment like the lounge, or
dining room so that he is always aware that people are around and can see
his screen?

On a technology level, install terminal services or VNC or anything that
lets someone else log in and see what he is up to, then point out to the
young man that he will be subject to random checks of his machine using this
tool.

Alternatively, if you really want to write a software solution write some
code that will screenshot the entire screen onto a network share so long as
DirectX Exclusive mode is not in use (which would mean he's in a game). Then
set the software to screenshot at a configurable interval in minutes. This
could be achieved with off the shelf screenshotting software like Snagit,
but there is an obvious risk there that he will simply terminate the program
when he finds it .

My personal view is that attempting to restrict what the kid can do won't
work. However, making him responsible for his actions and aware that his
actions will be monitored and followed up may help more.
 
Pete,

I completly agree, however not alone for kids.

This is as well for workers in a company.

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top