Welcome to Dream.In.Code
Getting Help is Easy!

Join 136,088 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,571 people online right now. Registration is fast and FREE... Join Now!




I need help creating an internet filter.

 
Reply to this topicStart new topic

I need help creating an internet filter.

Skinny
16 Nov, 2007 - 07:03 PM
Post #1

New D.I.C Head
*

Joined: 16 Nov, 2007
Posts: 2


My Contributions
Hello,

I've wanted to create a web filter of my own for a long time. I feel like there are so much bad things that a child could be exposed to that I wanted to do something to help out.

My problem is a really don't know where to start. Unfortunately, I have a handle of the basics of languages like C, C++, VB, HTML, and PHP, but I don't really know how to do anything advanced.

I've built websites and stuff and done basics executable programs but nothing this intense.

I would really appreciate it if any of you could help me get started?

What language would be preferred for this software?
Could I create an online app version of this?

Any and all help would be very much appreciated.

Skinny

This post has been edited by Skinny: 16 Nov, 2007 - 07:08 PM
User is offlineProfile CardPM
+Quote Post

rockstar_
RE: I Need Help Creating An Internet Filter.
16 Nov, 2007 - 09:41 PM
Post #2

D.I.C Head
Group Icon

Joined: 16 Oct, 2006
Posts: 187


Dream Kudos: 275
My Contributions
QUOTE(Skinny @ 16 Nov, 2007 - 08:03 PM) *

My problem is a really don't know where to start. Unfortunately, I have a handle of the basics of languages like C, C++, VB, HTML, and PHP, but I don't really know how to do anything advanced.

<snip>
QUOTE(Skinny @ 16 Nov, 2007 - 08:03 PM) *

What language would be preferred for this software?
Could I create an online app version of this?


Hey Skinny-

Internet filters are great. I use one here in the house to not only block porn, but to block ad websites, and sites that could be harmful. I run a squid proxy server on my Debian based router. It's been quite convenient. All the code for Squid was written in C. However, there are some things I think you should consider first.

I think you should probably read up on the OSI model, and learn how a network works. You could implement a proxy at many different levels, including the Application level, which would apply to your browser. There's a Firefox extension called AdBlock that does just this. I can think of a few ways to implement a proxy through plain ol' javascript. My squid proxy is a layer 3/4 proxy (depending on where TCP/IP fits, which is debatable). When you decide which layer you'd like implement your filter, than you can start considering languages to write it in.

The higher level your proxy is, the easier it is to bypass, and the higher level language you can use. The lower level it is, the lower level the language is, and the harder it is to bypass. My squid proxy has firewall rules set up that pretty much FORCE you to go through the proxy or nothing at all.

rockstar
User is offlineProfile CardPM
+Quote Post

Skinny
RE: I Need Help Creating An Internet Filter.
17 Nov, 2007 - 09:47 AM
Post #3

New D.I.C Head
*

Joined: 16 Nov, 2007
Posts: 2


My Contributions
Thanks for responding.

I'm familiar with the OSI model (I'm taking Electronics and I studied briefly Networking which discussed the OSI model).

I will read into that more.

So do these filters operate by reading packets that are coming in through the internet connection or do they operate by checking to see if a URL entered isn't harmful (by checking a database) or a combo of both?

Skinny

This post has been edited by Skinny: 17 Nov, 2007 - 09:49 AM
User is offlineProfile CardPM
+Quote Post

baavgai
RE: I Need Help Creating An Internet Filter.
17 Nov, 2007 - 10:49 AM
Post #4

Dreaming Coder
Group Icon

Joined: 16 Oct, 2007
Posts: 2,019



Thanked: 105 times
Dream Kudos: 475
Expert In: C, C++, Java, C#, ASP.NET, PHP, Perl, Python, Oracle, SQL Server, MySql, HTML, JavaScript, Lua

My Contributions
The most common implementation is a basic proxy server with a url blacklist. These used to work before kids stared getting smart. The same mechanism is still used, but the application of the blacklist is more complex.

The best blockers are actually intrusive routers. They open up http packets, make sure the http header isn't bogus, and then, just to be safe, rewrap the pay load and send it on.

We use an interesting one at work, a combination of a firewall and a content filter. The firewall has a rule for http traffic that has it ask the filter. The filter is stateful and either asks the user for validation or uses current authentication to figure out identity. Either way it creates a session to track the user. It then checks the user against the blacklist and ultimately tells the firewall whether to allow the packet through or not.

Note, a proxy server is little more than an http server. It passes the requests to the internet and passes back the responses. A filtering proxy, because of it's position in the communication channel, just chooses never to pass on some requests.

I mention this because http servers are surprisingly easy to write.

Hope this helps.

User is offlineProfile CardPM
+Quote Post

no2pencil
RE: I Need Help Creating An Internet Filter.
19 Nov, 2007 - 06:33 AM
Post #5

My fridge be runnin OH NOEZ!
Group Icon

Joined: 10 May, 2007
Posts: 6,439



Thanked: 64 times
Dream Kudos: 2425
Expert In: Goofing Off

My Contributions
QUOTE(Skinny @ 16 Nov, 2007 - 09:03 PM) *

My problem is a really don't know where to start. Unfortunately, I have a handle of the basics of languages like C, C++, VB, HTML, and PHP, but I don't really know how to do anything advanced.


More importantly, which OS are you looking to code this for? There are lots of firewall programs for *nix, IPFW, IPChains, IPTables, ect. However for Windows, most people just assume that they are protected. Plus you'll have to fight with turning off the Windows firewall, if this is the direction that you take. You'll also want to have a look at the registry entry that controls the order of which domain names are resolved.

User is online!Profile CardPM
+Quote Post

1lacca
RE: I Need Help Creating An Internet Filter.
19 Nov, 2007 - 08:12 AM
Post #6

code.rascal
Group Icon

Joined: 11 Aug, 2005
Posts: 3,822



Thanked: 11 times
My Contributions
[offtopic]
Do you really think these filters will ever work?
If I think of my childhood I am not so optimistic. We could always circumvent whatever filters or limitations were in question (I'm not just talking about the internet here). I think some of the problems could be dealt with education (when your kid searches for these things - because (s)he will get it, at least you won't know about it, that is not a better option) and others by going and hitting the perv on the head with a shovel (when the content finds him/her - via msn, myspace, etc.) - with the shovel I meant the law, of course.
[/offtopic - if you want to reply to this, continue in the lounge, please]

Anyway, you can simply block websites by redirecting them to localhost in the etc/hosts file (both on *nix and windows systems) - maybe with some write protection on the file. You can't do serious filtering with this, only blocking whole domains is possible, and accessing them by ip addresses is still possible I think.
User is offlineProfile CardPM
+Quote Post

baavgai
RE: I Need Help Creating An Internet Filter.
19 Nov, 2007 - 09:16 AM
Post #7

Dreaming Coder
Group Icon

Joined: 16 Oct, 2007
Posts: 2,019



Thanked: 105 times
Dream Kudos: 475
Expert In: C, C++, Java, C#, ASP.NET, PHP, Perl, Python, Oracle, SQL Server, MySql, HTML, JavaScript, Lua

My Contributions
QUOTE(1lacca @ 19 Nov, 2007 - 11:12 AM) *

[offtopic]
Do you really think these filters will ever work?


No. They work the way all protection works, they prevent the casual user, but not the truly determined.

The trick is actually not the filtering itself; if it's in the blacklist, block it! The problem is a function of scale. Sure, you can block playboy.com, but what about the random site that just mirrors some of their favorite porn and only about ten people know about it? And a new proxy comes up every day. It's computer whack-a-mole and a losing proposition.

I believe, rather than blocking, auditing should be the norm for those who would control such behavior. Never block, but sometimes fire off a message that says something like, "This is on the restricted list and your actions have been logged! You will not always see this message, but be aware that all request are recorded."

Then, if it's bad, come to the infringer with an activity log and talk to them about it. Have consequences beyond merely, oops, you can't do that. This has a chance of changing behavior. Simply blocking is merely a challenge to be overcome.

User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/1/08 08:17PM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month