I am doing the same thing. But what I have done is used a database. I have a table that logs all machines on the network during a scan.
A table that profiles the machinelast_ipaddress------computer_name-----timestamp
And a table that keeps track of hotfixes.computer_name---os_version---service_pack---hotfixes_installed---hotfi +xes_not_intsalled
hot_fix_id---hotfix_name---os---sp_level----hotfix_fingerprint
The fields Hotfixes_installed, Hotfixes_not_install and hotfix_fingerprint contain xml data. I have found that xml is the best way to store variable width data.
Than I have perl scripts that get the data for these machines. The first script scans a range of IP addresses and gets the machine name of any connected machine. This updates the first table. Slowly building a list of the machines in the network. The second script connects and uses the Tie::Registry modules to build the second database defining the machines. The third script upacks all the xml files creating a list of files and registry keys to check for each os and service pack. It than connects to each machine in the second table by name, it grabs the fingerprint for that machine and service pack and checks the reg keys and files and returns what is installed and what is not.I started with scripts just to hunt machines but after some false positives and false negatives from the Microsoft supplied scanner for MS03-039 I needed to make my own check on if the files installed. We have 14,000 machines to check so I figured keeping a db as a storage mechanism would be more efficient. I have the first two scripts running fine. The fingerprinting of the third script I am trying to make more efficient. But the nature of our network and machines I have found this to best layout to do this. Some notes to get the Tie::Registry information and the file attributes on footprinted file the machine running the scripts has to be the domain admin for the connected machines. I use this to flag machines that are not configured properly.
We tried Microsoft's Baseline security analyser and it just didn't do what we needed. So we are moving to this. It is my joyful work in progress. And was a handful of individual scripts run by hand to check each of these things one by one text lists of machines. The only problems I have with the design is the fingerprint system needs an entry for each os and an entry for service pack. though I am going to add an sp field that is not just the sp number but 2=>, 3, 2<=. What has become good about this is the database can be used to check other things against our network.
I don't see it as being easier, but it is the best model for our organisation. My scripts are barely working right now and I don't have it all automated to work on its own. I am trying to get it to be scheduled doing different levels of checks on different days and times. My biggest gripe is getting my head around fork on win32 and should this be one script or multiple scripts that can call each other.
Now from your question, I would use database queries to output to the html page. I would seperate the queries probably by OS with a sub category of service pack and list fully patched machines, partially patched machines, and completely unpatched machines. With options to display the details further. But that is the benefit of using a database. Also our large number of machines make other storage formats impratical. I was writing this and just released that instead of unpacking the xml files and creating the fingerprint in memory which is impratical, and instead on adding a new hotfix file to the database I could create the needed fingerprint file at that time for each os and service pack.
My question is how are you determining if the patch is installed? We started by just reading HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\WINNT\CURRENT_VERSION\HOTFIXES or HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\WINNT\UPDATES, but I was never sure if that would be complete enough. So we took versions and file sizes of the files in the updates as a check. I am wondering if there is an easy way of doing this. Is there something already out there I can use instead of having to fight with these scripts I am doing.
In reply to Re: Got's to be a better way
by Ninthwave
in thread Got's to be a better way
by ear
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |