Page 1 of 2 12 LastLast
Results 1 to 20 of 25
  1. #1
    slider57 is offline Member
    Join Date
    Aug 2011
    Posts
    29
    Rep Power
    0

    Default denying access to one program from another

    My goal here is to create a program that will deny access to the browsers during certain times of the day. The research that I have done makes this out to be near impossible (using signal handlers in java). I need some advice on where to start, if its possible, or anything else im missing. (System is windows 7). Thanks in advance.

  2. #2
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,932
    Rep Power
    8

    Default Re: denying access to one program from another

    This doesn't sound like a job for Java. You probably need access to the underlying operating system, which sounds more like a lower-level language like C++.
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. #3
    slider57 is offline Member
    Join Date
    Aug 2011
    Posts
    29
    Rep Power
    0

    Default Re: denying access to one program from another

    That is the vibe im getting. Ive done a little c++ back in the day, where do u think I need to start?

  4. #4
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,932
    Rep Power
    8

    Default Re: denying access to one program from another

    I'm not a C++ guy so I really have no idea. I just know you're going to have a hard time with it in Java, since Java was designed specifically not to care about the underlying operating system.
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  5. #5
    slider57 is offline Member
    Join Date
    Aug 2011
    Posts
    29
    Rep Power
    0

    Default Re: denying access to one program from another

    Okee. I appreciate the quick feedback.

  6. #6
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,932
    Rep Power
    8

    Default Re: denying access to one program from another

    You could also look into writing a plugin for your browser that does whatever you want. Really depends on your context though.
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  7. #7
    slider57 is offline Member
    Join Date
    Aug 2011
    Posts
    29
    Rep Power
    0

    Default Re: denying access to one program from another

    Ok. That might be an idea. Thanks.

  8. #8
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    3,876
    Rep Power
    5

    Default Re: denying access to one program from another

    Quote Originally Posted by slider57 View Post
    That is the vibe im getting. Ive done a little c++ back in the day, where do u think I need to start?
    Its not even really a C++ question, this is operating system specific too. Its going to be a hard quest of digging through the operating system's programming interface and APIs to find out how you would perhaps apply multiple one or more of its low level components to perhaps do what you specifically want. Since its a program that is linked to a graphical window, it might even be specific to a GUI toolkit; as an example in Linux it might require different code to do it if it were to be done in KDE or GNOME, unless there is an existing abstraction layer (like X-Windows) that might solve it for you for any and all of them.

    That is in my aging experience as a C++ programmer how difficult this problem really is. And that makes Java FAR from a likely candidate to solve it with, it is already going to be difficult enough using native code.


    The plugin idea is far better, but then remember that there is not one browser to rule them all; you'd need to create a plugin for each browser that you want to target, and plugins are easily disabled.
    Last edited by gimbal2; 01-02-2014 at 03:55 PM.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  9. #9
    slider57 is offline Member
    Join Date
    Aug 2011
    Posts
    29
    Rep Power
    0

    Default Re: denying access to one program from another

    Yea, that sounds like it is far beyond the scope of what Im willing to do. Disabling plugins might be an issue also. What about creating pseudo-launchers for the browsers forcing them to open up through my program. Then the actual folder containing the browser could be password locked. Any holes in that plan?

  10. #10
    kjkrum's Avatar
    kjkrum is offline Senior Member
    Join Date
    Apr 2011
    Location
    Tucson, AZ
    Posts
    1,060
    Rep Power
    6

    Default Re: denying access to one program from another

    Yeah. Where would the password be stored? What's to stop someone installing their own browser?

    This sounds like some ill-conceived parental control plan designed by someone wearing a suit.
    Get in the habit of using standard Java naming conventions!

  11. #11
    jim829 is online now Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    3,507
    Rep Power
    5

    Default Re: denying access to one program from another

    Of course, some browsers can be installed even if the user isn't an admin so how do you control that? If you are denying access to browsers and just need a security solution, you might as well shut down outgoing ports on the firewall during a specific period of time. I would think it would be easier. Some firewalls and routers already support that capability. On the other hand, if this is simply a "can I do it excercise?" I have no additional advice.

    Regards,
    Jim
    The Java™ Tutorial | SSCCE | Java Naming Conventions
    Poor planning our your part does not constitute an emergency on my part.

  12. #12
    zFollette is offline ▼ dafuq did I do?
    Join Date
    Dec 2013
    Posts
    203
    Rep Power
    0

    Default Re: denying access to one program from another

    There is a way to get all of the running processes in windows using java (this method is platform dependent). It is something like:
    Java Code:
    Process p = Runtime.getRuntime().exec("ps -few");
    You can then use a loop to read each process from p.getInputStream() and if the browser process is running, stop it. You will have to look into that.

  13. #13
    jim829 is online now Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    3,507
    Rep Power
    5

    Default Re: denying access to one program from another

    On a similar note, if the browser is on a *nix machine and is owned by the system, just clear its execution bits on the permissions. Doesn't help much if the users have their own browsers though.

    Regards,
    Jim
    The Java™ Tutorial | SSCCE | Java Naming Conventions
    Poor planning our your part does not constitute an emergency on my part.

  14. #14
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    3,876
    Rep Power
    5

    Default Re: denying access to one program from another

    Quote Originally Posted by zFollette View Post
    There is a way to get all of the running processes in windows using java (this method is platform dependent). It is something like:
    Java Code:
    Process p = Runtime.getRuntime().exec("ps -few");
    You can then use a loop to read each process from p.getInputStream() and if the browser process is running, stop it. You will have to look into that.
    That's a pretty interesting idea - out of the box thinking. It probably would require running the commands through sudo however since it would require the admin privileges to kill the processes, which in itself would create a bit of a security hole.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  15. #15
    zFollette is offline ▼ dafuq did I do?
    Join Date
    Dec 2013
    Posts
    203
    Rep Power
    0

    Default Re: denying access to one program from another

    Quote Originally Posted by gimbal2 View Post
    That's a pretty interesting idea - out of the box thinking. It probably would require running the commands through sudo however since it would require the admin privileges to kill the processes, which in itself would create a bit of a security hole.
    Not sure if good or bad feedback about my idea.

    denying access to one program from another-hqdefault.jpg

  16. #16
    slider57 is offline Member
    Join Date
    Aug 2011
    Posts
    29
    Rep Power
    0

    Default Re: denying access to one program from another

    Haha, fry. Thanks guys. This project has some merit in the real world I guess but its mostly a learning thing. Im off a couple semesters and would like to stay busy. Ill research that runtime idea a bit and see what I come up with.

  17. #17
    slider57 is offline Member
    Join Date
    Aug 2011
    Posts
    29
    Rep Power
    0

    Default Re: denying access to one program from another

    The only time a user would be able to instal their own browser would be through the open period when they can surf the internet. I dont want to close all internet traffic though because there are processes that need it.

  18. #18
    slider57 is offline Member
    Join Date
    Aug 2011
    Posts
    29
    Rep Power
    0

    Default Re: denying access to one program from another

    Not sure of the best way to store passwords. I was thinking of generating an alpha-numeric password known only to the program itself. This way you would have to login to the program to unlock it. I still have yet to learn how to use java's auth code though.

  19. #19
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    3,876
    Rep Power
    5

    Default Re: denying access to one program from another

    Quote Originally Posted by zFollette View Post
    Not sure if good or bad feedback about my idea.
    I like the idea, but I don't think that ultimately it is going to be a viable solution. But I'm far from perfect and my knowledge of Linux environments is not -that- extensive, so there may be a way to do it so it is secure.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  20. #20
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,932
    Rep Power
    8

    Default Re: denying access to one program from another

    Quote Originally Posted by zFollette View Post
    There is a way to get all of the running processes in windows using java (this method is platform dependent). It is something like:
    Java Code:
    Process p = Runtime.getRuntime().exec("ps -few");
    You can then use a loop to read each process from p.getInputStream() and if the browser process is running, stop it. You will have to look into that.
    What's stopping the user from just killing Java?

    OP I think you should take a step back and think about what your actual goal is. The router-level solution is probably the correct one. But if you're looking for programming projects, I'm sure we can give you other ideas.
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 6
    Last Post: 05-28-2012, 01:50 PM
  2. Creating a simple random file access program
    By bad biddy in forum New To Java
    Replies: 6
    Last Post: 04-03-2012, 12:13 AM
  3. Replies: 2
    Last Post: 10-25-2011, 07:48 PM
  4. quiz program using access as database
    By miinnesh in forum AWT / Swing
    Replies: 5
    Last Post: 03-05-2010, 11:30 AM
  5. quiz program using access as database
    By miinnesh in forum JDBC
    Replies: 0
    Last Post: 03-05-2010, 05:54 AM

Tags for this Thread

Posting Permissions

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