Click here to Skip to main content
Click here to Skip to main content

Writing a Parental Control Software for Windows

, 8 Jul 2010 GPL3
Rate this:
Please Sign up or sign in to vote.
Writing a parental control software: The beginning of the adventure

Introduction

It is now well admitted that the Internet can be a dangerous place and particularly for children.

Being a new parent, I have been looking for a good parental software to install on my PC.

There are many softwares, some are free, and most are around $40.

I tried a few, but I soon realized that none will actually fit my needs, they all have one or two features I like but with either many things lacking or several features I actually do not want.

The ideal software in my view should come with a set of modules but also allow extensions a bit like the FireFox browser.

As I could not find such a software, on a rainy evening of winter, I decided to start such a software. How hard can it be?

This article contains:

  • a tale of our progress so far
  • the entire source code
  • the plan for the future and a cry for help

Background

Whatever your talents, I am looking for your input into this project.

I would benefit from:

  • C++ programmers (especially Winsock)
  • C# programmers
  • Any other .NET language programmers

But also:

  • Parents that would like to submit a request
  • Teenagers frustrated by their current parental control software

Downloading the Code

I have posted a few articles over the years and I don't believe I have ever given any sort of warning.

This time I tell you: Do NOT install the software on your machine, but on a virtual machine.

I am developing it, and I use a virtual machine to test. So should you.

If you are crazy enough to run it on your machine, I suggest you backup your registry first:

Run Regedit 

Right click the key
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Winsock and select
Export. Choose a folder (my documents is ok) and enter the name :
winsock

Right click the key
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Winsock2 and
select Export. Enter the name : winsock2

If you crash your network layers, I can't guarantee these two files will restore your machine.
Formatting your hard disk and reinstalling Windows should though.

If you're still decided, the code can be found from www.easyparentalcontrol.com.

You'll need a software like Tortoise SVN to download the source.

Compiling the Code

The file lsp.sln is a Visual Studio 2010 C++ solution. It is a Layered Service Provider 'firewall' application.

The file MiniWebBrowser.sln is a Visual C# 2010 solution.

Both solutions are designed to run within the free Visual Studio Express or any more expensive versions. Both projects should be compiled.

Installing the Firewall

To install the firewall, a small batch file is in the bin folder. You have to provide a parameter, I typically enter a sequential number 1 to n. The batch file de-registers all layered providers including perhaps your antivirus or current firewall program. It then copies the new firewall to a temp directory and re-registers it.

C:\easyparentalcontrol\trunk\lsp\bin>i 21
Uninstalling the firewall
Hello World
1 LSPs installed:
   8106: v20 with 44 layered entries
Removing LSPs...
Removing dummy entry for: v20
Removing the associated layered entries with GUIDs:
 GUID: {1D99CFE0-CE76-4AD7-8CB5-89B47236B8F8}
 8197: v7 over [MSAFD Tcpip [TCP/IP]]
...
 Uninstalled providers for {0D8DE36F-0E77-4A6F-85FE-9895B7D57FF7}
Press any key to continue...

Copying and reinstalling the firewall
 1 file(s) copied.
LSP name is 'v21'

It baffles me a bit that during the install, no Windows security warning appears, even though the program you're installing this way could potentially be less well intentioned than mine. I won't go into more details about this.

The WebBrowser is a simple test browser with a low startup time used for testing. it doesn't require any installation.

Testing the Firewall

The firewall can be tested through the lsp.sln solution. The debug options have been set to run: C:\easyparentalcontrol\trunk\bin\MiniWebBrowser.exe.

If the firewall was installed properly, the output window should contain something like that. This shows that the firewall is effectively trapping all the communication between the Browser and the system Winsock library.

5456: EasyWSPAddressToString
5456: EasyWSPIoctl
5456: EasyWSPBind
5456: EasyWSPGetSockName
5456: EasyWSPConnect
5456: EasyWSPSend
5456: EasyWSPRecv
5456: WSPRecv(1 bytes)
5456: EasyWSPSelect
5456: EasyWSPSelect
5456: EasyWSPSetSockOpt
5456: EasyWSPAddressToString
5456: EasyWSPSetSockOpt
5456: EasyWSPSetSockOpt
5456: EasyWSPSetSockOpt
5456: EasyWSPSend
5456: EasyWSPRecv
5456: WSPRecv(1260 bytes)
5456: EasyWSPSend
5456: EasyWSPRecv
5456: WSPRecv(1 bytes)

The Elusive LSP

Writing a firewall is proving hard, very hard. In the old days, people would simply move the Winsock library and replace it by their own version. This is not possible anymore.
Windows offers some API to write a FireWall, but it is based the API offers a filtering based on port and IP not content as a parental control firewall might require.

We searched for a valid technology for some time and found some elusive documentation about LSP there: http://en.wikipedia.org/wiki/Layered_Service_Provider. The documentation is sparse.

An article was written in the MSDN magazine in May 1999 and very little since. The sample file is still present in the Windows 7 SDK though:
C:\Program Files\Microsoft SDKs\Windows\v7.0\Samples\netds\winsock\lsp

This source, painfully being adapted to Visual C++/CLI, is the base of our Firewall. The steps I fixed myself are:

  • Rebuild a project that compiles in VS 2010 (done)
  • Enable Precompiled headers (done)
  • .NET library interropability (done)
  • Refactor the code from global variables and functions to classes, members and methods (only started)

The Plan for the Future

This part is there only if you're interested in this free parental control software project, even interested in contributing to it.

As I said earlier, we're interested in all sorts of input, from programmers to graphic artists, kids, parents, translators, hackers, project managers, sponsors...

This article is part of a bigger project called 'Easy Parental Control.com'.

They want the website to offer a Parental Control Suite to the world.

We want EasyParentalControl to be:

  • Simple
  • Powerful
  • Popular
  • Free and financially successful

Simple

EasyParentalControl has to be installable and usable by the average dad or mum, who will more often than not be less computer literate than his or her children.
One of the steps we took in that direction is to decide to use web pages interface for the administration of the program.
People know how their web browsers work and they won't have to learn a new interface.
We have to make sure that:

  • The interface is simple
  • The back button can be used at any time (no 'do you want to resubmit this page?').
  • You can bookmark administration pages

Powerful

This is a difficult one. As EasyParentalControl becomes more powerful, we take the risk of making it less simple to use. One of the steps we took to keep simplicity is to build EasyParentalControl as a set of plug-ins. This will allow us to experiment without bloating the software. For example, someone could be interested in having less strict hours during school holidays. This can be developed into an optional plug-in. We'll actively encourage people to write plug-ins for us.

Popular

We've seen around 100 products. More are created and die every year. They all tend to sell between 50$ and 100$. Our plan is to start and keep a free forever version. This version won't offer the best support and all the plug-ins. We would like to be the best free parental program around.

Free and Financially Successful

This is an hard one again, as my wife says, how can you be free and financially successful? I am used to replying: 'look at Google'. We're not going to make much money for at least two years, but if we want the project to live on, we'll have to get some revenue. If EasyParentalControl and our little company is still running after two years, we will have several options:

  • Charge money on some optional plug-ins or services
  • Use advertising
  • Feature 'products'

Software Architecture

Our typical setup will involve 3 computers:

On the Kid's computer(s)

  • Background filters or loggers (keyboard, network, time logger...)
  • Optionally a notification program (probably showing as an icon in the task bar).
  • Optionally a web browser for kids

On the Dad's computer(s)

  • A web browser should be enough to see/modify everything
  • Optionally a live notification program (also showing clearly whether you're a parent or not when the Kid's computer is shared by parents).

The administration should be possible even when the kid computer is off.

On our servers, we'll have:

  • A database with everybody's settings
  • A database with sites/pages classifications (based on http://www.icra.org/archive/vocabularyv02/ but we can expand on this)
  • Optionally Kid's logs (for Dad's to Consult when the kid computer is down)

Softwares to be Written

Background Activity Logger

We'll have to monitor and filter all computer activity. This means monitor computer to be turned on and off, keys typed and program used. In plug-ins, we could monitor more like for example a special plug-in for 'world of warcraft'. A second challenge will be to make it difficult to get around. These programs will be written in C#.

Background Internet Filter

This is probably the most technical bit of our project. I would like to be able to modify page content on the fly.

I have identified several methods, make an internet filter:

  • Write a (fake) Web or Socks Proxy Server on the kid's computer
  • Write a network protocol (VmWare does that)
  • Use Microsoft Layered Service Provider (introduced with Winsock2)

Because of the low level aspect of this program, it will probably have to be written in C++ at least partly in C++ (possibly managed C++).

Notification Program

This is not too hard, this will simply listen to the service and show its messages. The choice of interprocess communication method is critical. The same notification program could be used on Dad's computer and give live notification to the kid activity.

Web Browser for Kids

Again not too hard, but nice for younger kids and this will allow us to show our 'White List' of web pages.

Plug-Ins

Even our own programs will be plug-ins. This way, they can be replaced by improved version with minimal disruption.

Web Pages Classification

We thought of this for a rather a long time. It is very hard to tell what is suitable or unsuitable for a kid; something suitable for a 16 years old might be completely unsuitable for a 5 years old.
It is also very difficult to choose a minimum age to a given page. This will really vary too much depending on your sensibility or even your mood of the moment.

The choice is then to describe the page/site with an objective classification. We'll originally use the icra vocabulary.

I believe this is one of the best classifications available. We can extend it, but it would be very valuable to stick to it as much as we can.

One of the challenges will be to ask our users to understand and contribute to the classification of the pages. I'll do a document about this.

EasyParentalControl.com Web Server

The EasyParentalControl.com WebServer will offer two distinct services:

  • Centralized database for the Windows Software
  • Web Server for standard Web Browsers

Finally

The more I work on this, the more I realize that the task is huge. I write this article, partly to clarify my head and decide where to go from here, but also in the hope that some of you will volunteer to help me on this.

You can contact me using this website or by email at pascal2007@ganaye.com.

History

  • 7/7/2010: First LSP release and Cry for help

License

This article, along with any associated source code and files, is licensed under The GNU General Public License (GPLv3)

Share

About the Author

Pascal Ganaye
Software Developer (Senior)
United Kingdom United Kingdom
I am a French programmer.
These days I spend most of my time with the .NET framework, JavaScript and html.

Comments and Discussions

 
Questiondoesn't work PinmemberMember 814623627-Feb-12 1:52 
GeneralMy vote of 5 Pinmemberbprochniak15-Feb-11 3:13 
GeneralMy vote of 4 Pinmembersatsumatable9-Jul-10 4:32 
GeneralMy vote of 5 Pinmemberspiq8-Jul-10 20:58 
GeneralMy vote of 5 Pinmembercorto_maltese8-Jul-10 12:27 
GeneralMy vote of 3 PinmemberAlexandre GRANVAUD7-Jul-10 21:26 
GeneralRe: My vote of 3 PinmemberPascal Ganaye7-Jul-10 21:58 
GeneralRe: My vote of 3 PinmemberJohn Brett7-Jul-10 23:51 
GeneralRe: My vote of 3 PinmemberFernandaUY22-Aug-11 10:47 
GeneralRe: My vote of 3 PinmemberAlexandre GRANVAUD8-Jul-10 1:58 
GeneralThe source code is now available PinmemberPascal Ganaye8-Jul-10 2:34 
GeneralRe: The source code is now available Pinmembercorto_maltese8-Jul-10 12:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web04 | 2.8.141015.1 | Last Updated 8 Jul 2010
Article Copyright 2010 by Pascal Ganaye
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid