Hi everyone,
I was just wondering if someone can tell me where I have to start for writing a personal firewall,
I'd appreciate it if someone can put me in the right track, or if you know of any links or anything that can be of use.
thanks in advance
Hi everyone,
I was just wondering if someone can tell me where I have to start for writing a personal firewall,
I'd appreciate it if someone can put me in the right track, or if you know of any links or anything that can be of use.
thanks in advance
Uhh, this is going to be pretty complicated. Be sure you have a very good level of knowledge of C, and then make sure you have a very good level of knowledge with regard to the system you will br programming for. You'll also have to know very advanced concepts most likely depending upon how far you want to go.
This is not something a beginner, and possibly even an intermediate programmer will be able to undertake. Consider postponing this project if you're not up for the level of difficulty.
does anyone know of any useful links or can put me in the right track please.
Here's some stuff I found when I Googled "how to write a firewall":
http://discuss.fogcreek.com/joelonso...w&ixPost=87521
http://sourceforge.net/projects/firewallpapi/
http://sourceforge.net/projects/tdifw
Part of your question is of course dependant on what you mean by "writing a personal firewall". An internet firewall is essentially a filter service that acts as some sort of proxy server on one side, and has a WAN connection on the other side.
In between, you have some more or less intelligent filtering capability that can say "this is an OK packet that we want to let through" and "this is not to be let through". You'll need a very good understanding of internet protocols (not how the protocol itself works, perhaps, but how the protocol is used to communicate between different types of applications, eg. a web-server and a web-browser, or how a game uses a game-server).
Most firewalls also allow the use of "hiding", that is, the outside of the firewall is exposed at a different IP-address than the real IP-address of the host. There are several variations on this theme - the most popular one being something called NAT.
One important key is of course that the outside part of the firewall is written in a secure way - it's pretty pointless to have a firewall that falls over on the first attempt of a buffer overflow.
First thing google got from "How to design a firewall" is this: http://www.unix.org.ua/orelly/networ...wall/index.htm
It doesn't give you C-code to implement a firewall, but it explains quite well how a firewall works, and what type of configurations one may want - which is a starting point.
--
Mats
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
I think you want to be looking for the protocol and port number to determine whether or not to discard the packet. Port numbers are part of the layer 4 TCP header. I don't know a whole lot about this stuff, but heres a diagram of the TCP segment header I googled:
http://www.abcseo.com/papers/security/img36.html
AFAIK headers get added at layer 2, 3, and 4. The layer 4 segment header should come first as its the last to get added, then the layer 3 packet header, and finally the frame header and trailer.