Free tool : Windows 2003/2008 Certificate Authority Certificate List Utility for pending requests and about-to-expire certificates

This article has 18,133 views

In one of my earlier posts, I have talked about setting up a Windows 2008 based Certificate Authority/PKI. Once your Windows 2008 CA setup is in place and configured, you can go ahead and starting issuing certificates. But at the same time, you need to put a maintenance/management procedure in place so you can stay on top of certain tasks, such as processing pending certificate requests or identify certificates that will expire and need manual renewal.  Unfortunately there is no easy way to get notified when new requests are pending, or certificates will expire somewhere in the future.

I wrote a small script that will help you putting in place this maintenance process.

This free utility requires .Net framework and requires proper permissions to connect to the CA admin interface.  It uses the Windows Server 2003, 2008 or Vista version of certutil and will run against a 2003 or 2008 CA.

The tool will perform the following tasks

– list all pending certificate requests

– list all certificates that will expire in a given number of days (or have expired in the last x days)

You can configure the tool to send you an email based on the results of these 2 queries.   What I usually do is run this script in 2 separate schedules :

– look for pending requests, run script every day

– look for certificates that will expire in the next x days, and run script on a weekly basis.

Of course, you are free to schedule the script the way you want.

Usage

After unpacking the zip file, you will get a single .exe file.  After launching the tool without specifying any parameters, you will get this :

 ---------------------------------------
  PVE CA Cert List Utility - (c) 2009
  List pending requests and expirations
  http://www.corelan.be:8800
  Version : 1.0.0.58
 ---------------------------------------
   Usage :

   pvecacertlist.exe parameters

   Parameters :
     -h    Show this help text. All other options will be ignored
     -s <CAServer\CAName> optional, only used when CA is not running
                            on the local machine)
     -e <Nr of days> Show list of certificates that will expire in less
                      than <Nr of days> days
     -p    Show list of pending certificate requests
       Note : you must specify at least option -e or option -p.
              Otherwise, there won't be any output
     -i <templateName>
           Only show certificates from the specified certificate template
           defined here (max. 1 template)
     -v    Verbose - show verbose output
     -n    notify - send email with report.
           This option requires a valid config file. By default, the
           utility will search for a file called smtp.cfg.
           This file must contain the following entries :
               mailserver=<hostname or IP of mailserver>
               mailserverport=<port to connect to on mailserver
               mailfrom=<email address>
               mailto=<email address>
           You can specify multiple To: addresses by separating the
           addresses with a comma
     -c <path to custom smtp config file>   This parameter allows you
           to specify the path/filename to a custom smtp config file
     -o    Only send email when action is required. Used only with -n
     -f <path to report file>   Use this parameter to specify a path/filename
           where the utility output report needs to be written to
           If this parameter is not used, the report will be written into
           a file called report.txt in the working directory
     -b    Don't write anything to log/report files
     -u    Check for updates)

 

Let’s have a look at some of the parameters :

-s : if you run the utility on the CA server itself, you don’t need to specify the –s parameter.  If you are running the utility from a remote machine, you need to specify the CA Servername\CA name using the –s parameter. You can get the exact CA Servername\CA name string by running  “certutil” on the CA server, look for “Config:”.  This is the string you need to use. (Put the string between double quotes if it contains spaces)

-e : if you want to look for certificates that will expire in a given number of days, specify the –e parameter, followed by the number of days that you want to look ahead. You can use a negative value to look back in time (to list certificates that have expired)

-p : If you want to look for pending certificate requests, specify the –p parameter.

You can use –e and –p at the same time. The tool will perform both queries in the same run.

The –v parameter will show verbose output when running the script.

-i : only show certificates that match with the specified templatename. You can only provide one template name.

-n : Notify.  If you want to send emails, you need to create a file called smtp.cfg first. This file needs to contain 4 entries (as indicated above).   If you only use the –n parameter, you will get an email every time, regardless whether pending requests / certificates that will expire are found. This file needs to be in the application directory or in the working directory. In order for mail notification to work, a valid smtp configuration file must exist. You can either create a file called smtp.cfg (in the working directory), or you can specify a custom Mysmtp.cfg file (any path/name will work) by using the -c parameter.

-o : This parameter can only be used when –n is used as well. It will force the tool to only send emails when actions need to be taken (pending requests, or certificates that will expire)

-u : check for update.  If you enable this option, and enable email notification (-n) as well, the report will contain a note if an updated version is detected.

By default, output will be written into a file called report.txt (in working directory).  If you don’t want to write anything to a local file, use the -b parameter.  If you want to specify a custom path/filename to write the report into, use the -f parameter to overrule the default local report.txt file.

If you find bugs or want to leave feedback about this tool, please use the discussion forum.

Download

Current version : 

Last update :

Forum : http://www.corelan.be:8800/index.php/forum/pve-ca-cert-list-utility

Show your respect for my work :

[paypal-donation]

You must be logged on to download this tool. You can register/log in using the “Login/Register/Logout” link in menu bar at the top of this blog.

  PVE CA Cert List Utility (9.9 KiB, 1,918 hits)

MD5 checksum :

Changelog :


© Corelan Consulting BV. All rights reserved. ​The contents of this page may not be reproduced, redistributed, or republished, in whole or in part, for commercial or non-commercial purposes without prior written permission. See the Terms of Use and Privacy Policy for details.

8 thoughts on “Free tool : Windows 2003/2008 Certificate Authority Certificate List Utility for pending requests and about-to-expire certificates”

  1. Is this tool still available. I am unable to download it. I just get a 5byte file, have tried from multiple machines.

  2. Hello, When I run the tool for the first time I see a command prompt show up for a split second and goes away. Any suggestions?
    I tried running as admin, I’m using Windows 7 32 bit

  3. Tool sounds like just what I need but I cannot get the download to work. Tried it several times, .zip won’t open, MD5 sum doesn’t match (f8 13 2f ad 58 9d 0b c4 37 ce 91 cc 5d 1b c7 30). Any help greatly appreciated!

  4. This is an awesome tool, and it has saved me a lot of time.

    Would it be much trouble to be able to add “Issued Email Address” as one of the fields that is put into the outputted text file? I’m using AD CS to manage User Certificates for users that are not on the same domain or are not connected at all. (Mac/Linux)

    It would be nice to be able to use that output to send an email to them to remind them to visit the site to renew or apply for a new certificate. Thanks for your hard work!

Comments are closed.