Skip to content
sethwalsh edited this page Mar 21, 2014 · 18 revisions

About

The purpose of this application is to track user logins and program usage on Windows systems. The application will run as a Windows service. Every minute of being logged in the application creates what are called "Events". Each Event is a string combination containing the user name and a hexidecimal representation of the programs being monitored. Each hex string represents a total of 32 bit positions and can thus represent up to 32 programs. Multiple hex blocks can be contained in a single Event. In this way up to N*32 programs can be monitored at a time where N = number of blocks. Each program has a specific bit position and if found running that particular bit is set to 1, otherwise it's 0. Each Event also contains a epoch timestamp representing the time that Event was recorded according to the Clients localtime.

Some of the other features that are possible through this application is managing time restricted user accounts by tracking their allowed time versus their logged in time, displaying appropriate messages when an impending logout is close, and then logging them out. Account lockout is not handled at this time by the Client but is possible.

The Client also has the ability to run external programs / scripts at specified times of the day and days of the week (much like cron on Linux systems). If for example you wanted to have the Client kick off a cleanup script at a specific time of day during the week.

Example of a single EVENT with between (33-64) programs being monitored:
22000000000000000001u11111111395344340

Flag, Number of Blocks, Block1, Block2, User Name Length, User Name, Epoch Timestamp
2, 2, 00000000, 00000000, 01, u1111111, 1395344340

Flag: Tells the Server this is a data string
Number of Blocks: Tells the Server how many 32bit blocks are in this EVENT
Block1: First block in the EVENT
Block2: Second block in the EVENT
User Name Length: Length(in Hex) of User Name string
User Name: User Name that created the EVENT
Epoch Timestamp: Epoch Timestamp on the host for this EVENT

Download

Install

  • Create directory C:\Tools\monitoring
  • Create directory C:\Tools\monitoring\config
  • Create directory C:\Tools\monitoring\data
  • Create directory C:\Tools\monitoring\log
  • Copy Client into C:\Tools\monitoring
  • Copy default.cfg into C:\Tools\monitoring\config
  • Copy masterlist.txt into C:\Tools\monitoring\config
  • Copy message displayer into Windows All Users Startup
  • Use srvany to create a service and edit the registry to have it start the Client

Config

  • The config file is XML based and pretty explanatory inside the default file what the settings do

Running

  • Modify the default.cfg file settings as you see fit.
  • Once you have downloaded the files, created the directories, setup the service the Client requires a reboot to take effect.
  • The Client works by running as a Windows Service. This allows for the Client to be running while no user is currently logged in.
  • The Client will track users that log into the machine and which (if any) of the monitored programs are run by that user.
  • Updated program lists will be handed out by the Server as they are changed on the back end.
  • Data is gathered as "Events", where each minute an "Event" is created if a user is logged in.
  • An "Event" contains the machine name, user name, and which (if any) of the monitored programs are being run.
  • When the Server requests all "Events" from a Client that data is sent (data is requested by the Server every minute).
  • If the Server fails to contact the Client that data is stored locally on disk until the Server contacts the Client at some future time (preventing loss of data due to Server failure).
  • If user accounts are being monitored for time restriction the message display application will display messages from the config file to the user. This is required because a Service cannot interact with the users desktop.

Clone this wiki locally