mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-08 22:29:33 +00:00
97 lines
2.4 KiB
Perl
97 lines
2.4 KiB
Perl
#-----------------------------------------------------------
|
|
# putty.pl
|
|
# Extracts the saved SshHostKeys for PuTTY
|
|
#
|
|
# Change history
|
|
# 20110830 [fpi] + banner, no change to the version number
|
|
#
|
|
# References
|
|
#
|
|
# copyright (c) 2011-02-04 Brendan Coles <bcoles@gmail.com>
|
|
#-----------------------------------------------------------
|
|
# Require #
|
|
package putty;
|
|
use strict;
|
|
|
|
# Declarations #
|
|
my %config = (hive => "NTUSER\.DAT",
|
|
hasShortDescr => 1,
|
|
hasDescr => 0,
|
|
hasRefs => 1,
|
|
osmask => 22,
|
|
version => 20110204);
|
|
my $VERSION = getVersion();
|
|
|
|
# Functions #
|
|
sub getDescr {}
|
|
sub getConfig {return %config}
|
|
sub getHive {return $config{hive};}
|
|
sub getVersion {return $config{version};}
|
|
sub getShortDescr {
|
|
return "Extracts the saved SshHostKeys for PuTTY.";
|
|
}
|
|
sub getRefs {
|
|
my %refs = ("PuTTY Homepage:" =>
|
|
"http://www.chiark.greenend.org.uk/~sgtatham/putty/");
|
|
return %refs;
|
|
}
|
|
|
|
############################################################
|
|
# pluginmain #
|
|
############################################################
|
|
sub pluginmain {
|
|
|
|
# Declarations #
|
|
my $class = shift;
|
|
my $hive = shift;
|
|
|
|
# Initialize #
|
|
::logMsg("Launching putty v.".$VERSION);
|
|
::rptMsg("putty v.".$VERSION); # 20110830 [fpi] + banner
|
|
::rptMsg("(".getHive().") ".getShortDescr()."\n"); # 20110830 [fpi] + banner
|
|
|
|
my $reg = Parse::Win32Registry->new($hive);
|
|
my $root_key = $reg->get_root_key;
|
|
my $key;
|
|
my $key_path = "Software\\SimonTatham\\PuTTY\\SshHostKeys";
|
|
|
|
# If # PuTTY path exists #
|
|
if ($key = $root_key->get_subkey($key_path)) {
|
|
|
|
# Return # plugin name, registry key and last modified date #
|
|
::rptMsg("PuTTY");
|
|
::rptMsg($key_path);
|
|
::rptMsg("LastWrite Time ".gmtime($key->get_timestamp())." (UTC)");
|
|
::rptMsg("");
|
|
|
|
# Extract # all keys from PuTTY registry path #
|
|
my %keys;
|
|
my @vals = $key->get_list_of_values();
|
|
|
|
# If # registry keys exist in path #
|
|
if (scalar(@vals) > 0) {
|
|
|
|
# Extract # all key names+values for PuTTY registry path #
|
|
foreach my $v (@vals) {
|
|
$keys{$v->get_name()} = $v->get_data();
|
|
::rptMsg($v->get_name()." -> ".$v->get_data());
|
|
}
|
|
|
|
# Error # key value is null #
|
|
} else {
|
|
::rptMsg($key_path." has no values.");
|
|
}
|
|
|
|
# Error # PuTTY isn't here, try another castle #
|
|
} else {
|
|
::rptMsg($key_path." not found.");
|
|
::logMsg($key_path." not found.");
|
|
}
|
|
|
|
# Return # obligatory new-line #
|
|
::rptMsg("");
|
|
}
|
|
|
|
# Error # oh snap! #
|
|
1;
|