Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/scripts/meterpreter/get_application_list.rb
Views: 11766
##1# WARNING: Metasploit no longer maintains or accepts meterpreter scripts.2# If you'd like to improve this script, please try to port it as a post3# module instead. Thank you.4##567# Meterpreter script for listing installed applications and their version.8# Provided: carlos_perez[at]darkoperator[dot]com910#Options and Option Parsing11opts = Rex::Parser::Arguments.new(12"-h" => [ false, "Help menu." ]13)1415def app_list16tbl = Rex::Text::Table.new(17'Header' => "Installed Applications",18'Indent' => 1,19'Columns' => [20"Name",21"Version"22])23appkeys = ['HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall',24'HKCU\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall' ]25threadnum = 026a = []27appkeys.each do |keyx86|28soft_keys = registry_enumkeys(keyx86)29if soft_keys30soft_keys.each do |k|31if threadnum < 1032a.push(::Thread.new {33begin34dispnm = registry_getvaldata("#{keyx86}\\#{k}","DisplayName")35dispversion = registry_getvaldata("#{keyx86}\\#{k}","DisplayVersion")36if dispnm =~ /\S*/37tbl << [dispnm,dispversion]38end39rescue40end41})42threadnum += 143else44sleep(0.05) and a.delete_if {|x| not x.alive?} while not a.empty?45threadnum = 046end47end48end495051end52print_line("\n" + tbl.to_s + "\n")53end5455opts.parse(args) { |opt, idx, val|56case opt57when "-h"58print_line "Meterpreter Script for extracting a list installed applications and their version."59print_line(opts.usage)60raise Rex::Script::Completed6162end63}64if client.platform == 'windows'65app_list66else67print_error("This version of Meterpreter is not supported with this Script!")68raise Rex::Script::Completed69end707172