Results 1 to 19 of 19

Thread: Block WebPages in FireFox and IE

  1. #1

    Thread Starter
    Fanatic Member coolcurrent4u's Avatar
    Join Date
    Apr 2008
    Location
    *****
    Posts
    993

    Block WebPages in FireFox and IE

    Hello guys,

    most anti-virus not block know dangerous web pages. just like the picture in this post.

    how do i implement this feature in my program

    Any Ideas?

    thanks
    Attached Images Attached Images  
    Programming is all about good logic. Spend more time here


    (Generate pronounceable password) (Generate random number c#) (Filter array with another array)

  2. #2
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: Block WebPages in FireFox and IE

    there's usually a list somewhere.... could be in the app itself, or in somekind of data file, or online. Before navigating to the page, it checks the destination address, and if it's in the list, re-routes the navigation and displays the access denied notice.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  3. #3

    Thread Starter
    Fanatic Member coolcurrent4u's Avatar
    Join Date
    Apr 2008
    Location
    *****
    Posts
    993

    Re: Block WebPages in FireFox and IE

    techgnome

    Thats true. I will have a list somewhere in my app that can be edited from time to time.
    but the question is how do i go about it?

    i heard i would need to enumerate opened IE and Fox. but what if the user has many tabs or windows opened?

    any ideas?
    Programming is all about good logic. Spend more time here


    (Generate pronounceable password) (Generate random number c#) (Filter array with another array)

  4. #4
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: Block WebPages in FireFox and IE

    oh... so this isn't inside of some browser you built... but rather you're trying to hook into the user's browser, what ever they have.... no clue how exactly they do that. Probably scanning the tcp traffic somehow... and some how returns a false response from the server...

    ???

    Got me.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  5. #5

    Thread Starter
    Fanatic Member coolcurrent4u's Avatar
    Join Date
    Apr 2008
    Location
    *****
    Posts
    993

    Re: Block WebPages in FireFox and IE

    techgnome that is another idea, but how do i scan tcp traffic of the computer. remember that some anti-virus might not like this, like Norton

    How do i do that?
    Programming is all about good logic. Spend more time here


    (Generate pronounceable password) (Generate random number c#) (Filter array with another array)

  6. #6
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Block WebPages in FireFox and IE

    What you are trying to make is a 'basic' Firewall, and it is not a trivial task... I recommend you find a pre-made one (perhaps on PlanetSourceCode), and try to find out how it works.

  7. #7
    Frenzied Member
    Join Date
    Nov 2005
    Posts
    1,834

    Re: Block WebPages in FireFox and IE

    There are no real firewalls written in VB on pscode.com. They do not block connections, but they disconnect already established connections to your computer.

    The way they do it is by continuously looping through the TCP table with the GetTcpTable API and a timer. But it might not be fast enough, because you need to convert each hostname (mscracks.com) to an IP address in order to disconnect it and that takes time, especially when you have a huge list of websites.

    Here's a small tool I wrote years ago to disconnect certain IP addresses you might want to play around with.

    http://www.vbforums.com/showpost.php...9&postcount=14

  8. #8

    Thread Starter
    Fanatic Member coolcurrent4u's Avatar
    Join Date
    Apr 2008
    Location
    *****
    Posts
    993

    Re: Block WebPages in FireFox and IE

    In the picture i placed above Eset detected the website as soon as i pressed go, that is very ok. because scanning tcp port is not a good idea. most antivirus don't like this.
    Programming is all about good logic. Spend more time here


    (Generate pronounceable password) (Generate random number c#) (Filter array with another array)

  9. #9

    Thread Starter
    Fanatic Member coolcurrent4u's Avatar
    Join Date
    Apr 2008
    Location
    *****
    Posts
    993

    Re: Block WebPages in FireFox and IE

    Quote Originally Posted by si_the_geek View Post
    What you are trying to make is a 'basic' Firewall, and it is not a trivial task... I recommend you find a pre-made one (perhaps on PlanetSourceCode), and try to find out how it works.
    what are your suggestions?
    Programming is all about good logic. Spend more time here


    (Generate pronounceable password) (Generate random number c#) (Filter array with another array)

  10. #10
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Block WebPages in FireFox and IE

    Search for a pre-made firewall project written in VB, and run the ones that seem good to see whether they seem to be capable of doing this (despite what Chris001 posted, I have seen VB projects that are real firewalls).

    If you find one that seems about right, try to make changes so that it does what you want.

    What Chris001 linked to could also be a good place to start, but I haven't looked at it.


    As I said before this kind of thing is not a trivial task, even if you manage to find a pre-made project it will still be far more complex than walking a treeview... so it may be best if you don't try to implement something like this (and instead use a pre-made program).

  11. #11
    Frenzied Member
    Join Date
    Nov 2005
    Posts
    1,834

    Re: Block WebPages in FireFox and IE

    If you've seen VB6 projects that are real firewalls, then I would like to see one. Real firewalls do low level packet filtering (probably requires a driver) and check a packet before it's allowed to go through.

    I've looked at this, this, this, this, this, this and this 'firewall' from pscode.com and all of them simply check the TCP Table after the connection has already been fully made. Then they set the State to 12 (MIB_TCP_STATE_DELETE_TCB) and disconnect with the SetTcpEntry API and that's too late.

  12. #12
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Block WebPages in FireFox and IE

    I have seen at least one that does it properly, but it was a few years ago so unfortunately I can't remember where I found it (and I didn't keep a copy, as I wasn't that interested).

    I can't remember details of it either, but I wouldn't be surprised if it had a C based DLL to act as a driver.

  13. #13

    Thread Starter
    Fanatic Member coolcurrent4u's Avatar
    Join Date
    Apr 2008
    Location
    *****
    Posts
    993

    Re: Block WebPages in FireFox and IE

    Thanks Si and Chris!

    So you are saying that it involves packet filtering,

    I think start from there.

    but please don't forget to post back if you find it.

    Si
    Am not planing on building a full fledge firewall, just a simple program to prevent browsing the site i specify. plus the fact that it wont look nice if i add third party to my program except its a dll or activex.
    Can you suggest a premadeone that is free anyways

    Thanks
    Last edited by coolcurrent4u; Feb 9th, 2010 at 11:58 AM.
    Programming is all about good logic. Spend more time here


    (Generate pronounceable password) (Generate random number c#) (Filter array with another array)

  14. #14
    Member
    Join Date
    Aug 2009
    Posts
    32

    Re: Block WebPages in FireFox and IE

    you can search 'local webserver' source code.
    and you can set your default page to local file with that.

    and you can edit file 'hosts' (without extension) in system32\driver directory.
    and direct it into 127.0.0.1

  15. #15

    Thread Starter
    Fanatic Member coolcurrent4u's Avatar
    Join Date
    Apr 2008
    Location
    *****
    Posts
    993

    Re: Block WebPages in FireFox and IE

    Quote Originally Posted by mozzart View Post
    you can search 'local webserver' source code.
    and you can set your default page to local file with that.

    and you can edit file 'hosts' (without extension) in system32\driver directory.
    and direct it into 127.0.0.1
    yes this is true. but how do i intercept the connection request and redirect it
    first each unwanted link will be in a file. what exactly i want to do is as soon as the user presses enter in the browser, if its is a bad site, i immediately redirect it.


    thanks
    Programming is all about good logic. Spend more time here


    (Generate pronounceable password) (Generate random number c#) (Filter array with another array)

  16. #16
    Fanatic Member newprogram's Avatar
    Join Date
    Apr 2006
    Location
    in your basement
    Posts
    769

    Re: Block WebPages in FireFox and IE

    I would go with mozzart way it the simplest way to go and guarantee to work each time.
    Quote Originally Posted by coolcurrent4u View Post
    yes this is true. but how do i intercept the connection request and redirect it
    first each unwanted link will be in a file. what exactly i want to do is as soon as the user presses enter in the browser, if its is a bad site, i immediately redirect it.


    thanks
    Live life to the fullest!!

  17. #17

    Thread Starter
    Fanatic Member coolcurrent4u's Avatar
    Join Date
    Apr 2008
    Location
    *****
    Posts
    993

    Re: Block WebPages in FireFox and IE

    i know, i know, but how? Any code sample would be ok. the examples posted that refers to PSC is not exactly what i want, but am presently working on seeing how to make it work. untill then, any suggestion and code samples would be appreciated
    Programming is all about good logic. Spend more time here


    (Generate pronounceable password) (Generate random number c#) (Filter array with another array)

  18. #18
    Addicted Member pcuser's Avatar
    Join Date
    Jun 2008
    Posts
    219

    Re: Block WebPages in FireFox and IE

    You can use a Browser Helper Object to do this with Internet Explorer but not Firefox.

  19. #19

    Thread Starter
    Fanatic Member coolcurrent4u's Avatar
    Join Date
    Apr 2008
    Location
    *****
    Posts
    993

    Re: Block WebPages in FireFox and IE

    Thanks pcuser,
    but i want ideas on something that if possible does not depends on the browser, because smart users will bypass this.

    Besides this technique will allow the user access d site for some some seconds before it is detected

    thanks again
    Last edited by coolcurrent4u; Feb 14th, 2010 at 06:09 PM.
    Programming is all about good logic. Spend more time here


    (Generate pronounceable password) (Generate random number c#) (Filter array with another array)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width