Skip to content

Commit

Permalink
error handling for smbclient yielding no OS info
Browse files Browse the repository at this point in the history
  • Loading branch information
jtpereyda committed Jun 13, 2020
1 parent c49e253 commit fab9360
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions enum4linux.pl
Original file line number Diff line number Diff line change
Expand Up @@ -460,8 +460,14 @@ sub get_os_info {
my $os_info = `$command`;
chomp $os_info;
if (defined($os_info)) {
($os_info) = $os_info =~ /(Domain=[^\n]+)/s;
print "[+] Got OS info for $global_target from smbclient: $os_info\n";
my $os_info_result;
($os_info_result) = $os_info =~ /(Domain=[^\n]+)/s;
if (defined($os_info_result)) {
print "[+] Got OS info for $global_target from smbclient: $os_info_result\n";
}
else {
print "[E] smbclient returned no or invalid OS info for $global_target: \"$os_info\"\n";
}
}

$command = "rpcclient -W '$global_workgroup' -U'$global_username'\%'$global_password' -c 'srvinfo' '$global_target' 2>&1";
Expand Down

0 comments on commit fab9360

Please sign in to comment.