Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 156
  • Last Modified:

Integrate security system with win2000

I'm writing a program that i want to serve as a secondary user authentication to windows 2000, i.e. After u logon to the machine that the program is on the application will ask for more user details other than that which win2000 requires. My problem is i don't know a way that i can tell when a user wants to or has logged on to a system via a network. I'm looking for a guide as to how to approach the problem, if i can get started i know i can figure out the rest. If anyone know where i could get some reference material that would be of great help.
0
shizzle
Asked:
shizzle
  • 4
  • 2
1 Solution
 
advappCommented:
Depending upon just how integrated you want to be here...

One way is to simply have a process/program that fires up when the user logs in.  The program can than get the current user and the do what ever else you want it to do.

Maybe some additional info as to just what you want to be able to do once you have the user's additional info; i.e., log them off, prevent them from getting on in the first place, etc.
0
 
shizzleAuthor Commented:
[advapp ] I was thinking the same thing except that i would like the program to be running at all times, this way i would need to know when someone uses the win2000 authentication system, that way when sin2K is finished it would pass the user on to my program. Once i get the user info i want to be able to run more rigid authentication tests on that user (i.e) they would have another user name and password that is needed for my program if they fail to enter this correctly as specified by the program i want to log them off. When u speak of firing up the program when someone logs on r u talking something like spawning the process from another process?  
0
 
advappCommented:
I've done similar things by using a program that runs from the startup list in the registry.  Though it is not fool-proof (to those who know the registry) there are ways to make it so you at least know when/who buggered with the program, if they do.

Is there a specific reason you want this to run even when someone is not logged in?  If that is important to the probject, maybe you should consider creating it as a service -- which does run all the time.  At the moment, I don't know of a way to hook it into the security system but it could certainly do a sleep-and-poll method to see who (if anyone) is logged in.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
shizzleAuthor Commented:
[advapp] I think i like what u r saying. Would it be possible for u to show me some code example as to how u did what u did? My program will validate users from a database created by me and will be maintained by the system admin. via a customised UI. I really just want to know how i can start get my program going after win2k has finished doing what its doing and also get the info pertaining to the current user info. You have been of quite some help alreay just by ur guidance. Thanks. [the points r urs, just need a bit more help]
0
 
advappCommented:
The text below can be edited, then pasted into a REG file and merged into the registry to establish the startup process.  Just change "ProgramName" to what ever you commonly call your program and "PROGRAM.EXE" to the actual name of the executable along with any necessary arguments.  Once in place, whenever any user logs in, the program will run.  Note that this will occur after the system has validated them as a user.

=================================================================
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]
"ProgramName"="PROGRAM.EXE"
=================================================================

The only way someone can get around this is: 1) remove the entry in the registry, or 2) using the task manager to kill the program.  Within the program, set a status flag that can be evaluated should the program be terminated abnormally.  As the program progresses, it updates this value to indicate the progress made.  It starts by checking the status of this flag from the last time the program was run.  If it indicates abnormal termination in the last session, it then prevents the user from continuing, tells them to talk with the administrator to get it rectified, and logs off the session.  If the status looks ok, processing continues by setting a value that assumes the user killed the program via task manager -- assuming the worst.

In my program there is an initial form that displays some information to the user about their session and the user can either close it manually, or the form will time-out after 10 seconds.  In either case, the form is not unloaded but only hidden.  Within the Form_QueryUnload event of this form, I Case the UnloadMode value to determine what/who is unloading it and set this status flag appropriately.  If the user kills the program, I can evaluate the status and see that it shows the original value -- indicating the user killed the program via task manager.  If the form is closed through orthodox means, the status is updated appropriately by the QueryUnload event.

Now, whether this process is secure enough for your situation, you'll have to decide.  If you really want something unavailable to the user you may be better off going with a service.
 
0
 
advappCommented:
Some code for the QueryUnload event:

Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)

    Select Case UnloadMode
    Case vbFormControlMenu
        'User closed window
        Cancel = 1
        Me.Hide
    Case vbFormCode
        'Closed by program via Unload <frm>
        'Ensure that it continues to show killed if that was status at the beginning
        If SessionTerm <> TERM_TSKMGR _
          And SessionTerm <> TERM_PREVENT Then
            'Set status to show session ended by program
        End If
    Case vbAppWindows
        'Set status to show user logged off of session
    Case vbAppTaskManager
        'Process killed via Task Manager
    End Select

End Sub
0
 
CleanupPingCommented:
Hi shizzle,
This old question (QID 20561319) needs to be finalized -- accept an answer, split points, or get a refund.  Please see http://www.cityofangels.com/Experts/Closing.htm for information and options.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now