I believe Metasploit tells you what programs/versions each vulnerability has been tested on to ensure it is working. So you could just read the description of the vulnerability and use the program/version they tell you on your computer.
for example: see the description below
"Description: This module exploits a buffer overflow in RealVNC 3.3.7"
Code:
Name: RealVNC 3.3.7 Client Buffer Overflow
Version: 3818
Targeting: win32, winxp, win2000, win2003 / x86
Privileges: No
Author: y0 [at] w00t-shell.net
Disclosed: Jan 29 2001
Targets:
0 - Windows 2000 SP4 English
1 - Windows XP SP2 English
2 - Windows 2003 SP1 English
Options:
VNCPORT - The local VNC listener port
VNCSERVER - The local VNC listener host
Payload Info:
Room for 500 bytes of payload
Restricted bytes: 0x00
Description: This module exploits a buffer overflow in RealVNC 3.3.7 (vncviewer.exe).
OR: "This issue is known to affect AOL Instant Messenger 5.5. "
Code:
Exploit Module: aim_goaway
Name: AOL Instant Messenger goaway Overflow
Version: 3818
Targeting: win32, win2000, winxp, win2003 / x86
Privileges: No
Authors:
skape <mmiller [at] hick.org>
thief <thief [at] uninformed.org>
Disclosed: Aug 9 2004
Targets:
0 - Automatic
1 - Windows XP SP0
Options:
HTTPHOST - The local HTTP listener host
HTTPPORT - The local HTTP listener port
Payload Info:
Room for 1014 bytes of payload
Restricted bytes: 0x00 0x09 0x0a 0x0d 0x20 0x22 0x25 0x26 0x27 0x2b 0x2f 0x3a 0x3c 0x3e 0x3f 0x40
Description: This module exploits a flaw in the handling of AOL Instant Messenger's 'goaway' URI handler. An attacker can execute arbitrary code by supplying a overly sized buffer as the 'message' parameter. This issue is known to affect AOL Instant Messenger 5.5.
References:
http://www.osvdb.org/8398
http://www.milw0rm.com/metasploit/3
http://www.idefense.com/application/poi/display?id=121&type=vulnerabilities