Writting your own firewall?

For everything that's not in any way related to PureBasic. General chat etc...
Edwin Knoppert
Addict
Addict
Posts: 1073
Joined: Fri Apr 25, 2003 11:13 pm
Location: Netherlands
Contact:

Writting your own firewall?

Post by Edwin Knoppert »

Is there a simple way to write a firewall.
No idea how to do that :)
User avatar
Rings
Moderator
Moderator
Posts: 1435
Joined: Sat Apr 26, 2003 1:11 am

Post by Rings »

no simple way, else there were more freeware 'firewalls' around.
but its not so complicated, just a 2 hints:

hook CreateProcess Api (global should be the best)
to prevent starting any process.

hook Sockets-Api/LoadLibrary to prevent
unattended communication

last not least :
hook Remotehread to prevent CodeInjection

For hooking Apis's global, its recomented IMHO that
you use a devicedriver to get in ring0.


links:
http://www.codeproject.com/internet/FwHookDrv.asp
http://www.codeproject.com/internet/smfirewall.asp
http://www.codeproject.com/threads/A_no ... rewall.asp
SPAMINATOR NR.1
Edwin Knoppert
Addict
Addict
Posts: 1073
Joined: Fri Apr 25, 2003 11:13 pm
Location: Netherlands
Contact:

Post by Edwin Knoppert »

It's for personal use.

I have ZA but i tried (older) Kerio to prevent just a few specific addresses.
Unf. i also have to set a rule to allow everything and therefore the other rule to dissallow a specific address is skipped(!)

To be more specific, i'm happy with ZA but i would like to be able to maintain a list of specific addresses to cancel 100%.
(Outwards)

For example the whole www.microsoft.com site?
Edwin Knoppert
Addict
Addict
Posts: 1073
Joined: Fri Apr 25, 2003 11:13 pm
Location: Netherlands
Contact:

Post by Edwin Knoppert »

o btw under XP so api-hooking might be enough.

Someone??
SFSxOI
Addict
Addict
Posts: 2970
Joined: Sat Dec 31, 2005 5:24 pm
Location: Where ya would never look.....

Post by SFSxOI »

Why not try creating an interface for the built in winXP (with SP-2) firewall? I know people don't think much of it (I don't use it personally), but for what it was intended to do, it works, and its already part of the OS with all the hooks and stuff in place already. Contrary to popular belief it wll do outbound filtering as well (even though outbound is not really needed, there are arguments for both sides here) but theres just no really suitable interface for it for controlling everything its capable of. Half the work is already done, just needs a suitable interface.
Edwin Knoppert
Addict
Addict
Posts: 1073
Joined: Fri Apr 25, 2003 11:13 pm
Location: Netherlands
Contact:

Post by Edwin Knoppert »

I have no idea where to start, is there a small example?
And really, i don't need a GUI, some dll or sort of which reads a list would do.

:)
Num3
PureBasic Expert
PureBasic Expert
Posts: 2812
Joined: Fri Apr 25, 2003 4:51 pm
Location: Portugal, Lisbon
Contact:

Post by Num3 »

Firewall are installed has hardware drivers...

So they can sniff packets, between the hardware driver itself and windows...
User avatar
flaith
Enthusiast
Enthusiast
Posts: 704
Joined: Mon Apr 25, 2005 9:28 pm
Location: $300:20 58 FC 60 - Rennes
Contact:

Post by flaith »

“Fear is a reaction. Courage is a decision.” - WC
Jan Vooijs
Enthusiast
Enthusiast
Posts: 196
Joined: Tue Sep 30, 2003 4:32 pm
Location: The Netherlands

Post by Jan Vooijs »

Edwin,

Have you looked at this page:
http://www.free-firewall.org/

There are two or three free firewalls there is even an open source firewall listed there: http://winsockfirewall.sourceforge.net/

And maybe this is something:
http://www.smoothwall.org/

Or maybe this freeware one:
http://www.jetico.com/

Next page can be VERY handy for info about a bunch of BAD perfomring firewalls and there safety FYI (for your information):
http://www.firewallleaktester.com/index.html

Good luck, wow if somebody could write an PB firewall THAT would be amazing (but not impossible).

Jan V.
Life goes to Fast, Enjoy!!

PB 4 is to good to be true, wake up man it is NOT a dream THIS is a reality!!!

AMD Athlon on 1.75G, 1Gb ram, 160Gb HD, NVidia FX5200, NEC ND-3500AG DVD+RW and CD+RW, in a Qbic EO3702A and Win XP Pro SP2 (registered)
rsts
Addict
Addict
Posts: 2736
Joined: Wed Aug 24, 2005 8:39 am
Location: Southwest OH - USA

Post by rsts »

if there are only known addresses you want to disallow access to, you could also use a hosts file?

cheers
Edwin Knoppert
Addict
Addict
Posts: 1073
Joined: Fri Apr 25, 2003 11:13 pm
Location: Netherlands
Contact:

Post by Edwin Knoppert »

rsts wrote:if there are only known addresses you want to disallow access to, you could also use a hosts file?

cheers

What is that?

:)
rsts
Addict
Addict
Posts: 2736
Joined: Wed Aug 24, 2005 8:39 am
Location: Southwest OH - USA

Post by rsts »

try
http://www.mvps.org/winhelp2002/hosts.htm

or google "hosts file"

there are also programs which allow you to update "on the fly" + several sites which provide "current" host files which block unwanted sites.

cheers
Edwin Knoppert
Addict
Addict
Posts: 1073
Joined: Fri Apr 25, 2003 11:13 pm
Location: Netherlands
Contact:

Post by Edwin Knoppert »

HEHE!!

Thanks dude :)

I no have blocked my 'favourite' site.. (i hope)

:)
TerryHough
Enthusiast
Enthusiast
Posts: 781
Joined: Fri Apr 25, 2003 6:51 pm
Location: NC, USA
Contact:

Post by TerryHough »

@Edwin

There is an interesting discussion on the Hosts file on Steve Gibson's site.
http://www.grc.com/default.htm
Edwin Knoppert
Addict
Addict
Posts: 1073
Joined: Fri Apr 25, 2003 11:13 pm
Location: Netherlands
Contact:

Post by Edwin Knoppert »

Not sure if we seen the same, i read the topic:

http://www.grc.com/sn/SN-045.htm

---------------------------------------------------

So far i have good results!

Any knowing the address ZA uses secretely?
I heard the freeware version calls home as well.
Post Reply