Subject: | Authentication failure against Win2k8R2 |
Date: | Tue, 17 Jul 2018 23:17:28 +0200 |
To: | bug-SMB [...] rt.cpan.org |
From: | Philippe Baumgart <philippe.baumgart [...] gmail.com> |
The following code works as expected on Windows 10 but not on Windows Server 2008 R2 Standard 7601 Service Pack 1:
use SMB::Client;
my $h=shift;
my $s=shift;
my $client = SMB::Client->new("//$h/$s",
username => 'administrator',
password => ‘Mypass',
log_level => SMB::LOG_LEVEL_DEBUG,
);
my $tree = $client->connect_tree or die $!;
# try another share if the first is not available
# $tree ||= $client->connect_tree(share => 'c$') or die;
# list all txt files in the share
for my $file ($tree->find("*.*")) {
printf "%-40s %9s %s\n",$file->name, $file->size_string, $file->mtime_string;
}
Result on Win2k8R2:
* Connected - server #1 [192.168.166.24:445]
* SMB2 [Negotiate Request ] mid=0 uid=0 tid=00 - server #1 [192.168.166.24:445]
* SMB2 [Negotiate Response] mid=0 uid=0 tid=00 - server #1 [192.168.166.24:445]
Unsupported asn1 tag 0x1b on parse
* SMB2 [SessionSetup Request ] mid=1 uid=0 tid=00 - server #1 [192.168.166.24:445]
* SMB2 [SessionSetup Response] mid=1 uid=40004000061 tid=00 status=c0000016 - server #1 [192.168.166.24:445]
* SMB2 [SessionSetup Request ] mid=2 uid=40004000061 tid=00 - server #1 [192.168.166.24:445]
* SMB2 [SessionSetup Response] mid=2 uid=40004000061 tid=00 - server #1 [192.168.166.24:445]
* SMB2 [TreeConnect Request ] mid=3 uid=40004000061 tid=00 - server #1 [192.168.166.24:445]
* SMB2 [TreeConnect Response] mid=3 uid=40004000061 tid=00 status=c0000022 - server #1 [192.168.166.24:445]
SMB Error on TreeConnect response: STATUS_ACCESS_DENIED
Died at smb.pl line 10.
* Disconnected - server #1 [192.168.166.24:445]
Result on Windows 10:
* Connected - server #1 [192.168.166.44:445]
* SMB2 [Negotiate Request ] mid=0 uid=0 tid=00 - server #1 [192.168.166.44:445]
* SMB2 [Negotiate Response] mid=0 uid=0 tid=00 - server #1 [192.168.166.44:445]
Unsupported asn1 tag 0x1b on parse
* SMB2 [SessionSetup Request ] mid=1 uid=0 tid=00 - server #1 [192.168.166.44:445]
* SMB2 [SessionSetup Response] mid=1 uid=440004000075 tid=00 status=c0000016 - server #1 [192.168.166.44:445]
* SMB2 [SessionSetup Request ] mid=2 uid=440004000075 tid=00 - server #1 [192.168.166.44:445]
* SMB2 [SessionSetup Response] mid=2 uid=440004000075 tid=00 - server #1 [192.168.166.44:445]
* SMB2 [TreeConnect Request ] mid=3 uid=440004000075 tid=00 - server #1 [192.168.166.44:445]
* SMB2 [TreeConnect Response] mid=3 uid=440004000075 tid=01 - server #1 [192.168.166.44:445]
* SMB2 [Create Request ] mid=4 uid=440004000075 tid=01 - server #1 [192.168.166.44:445]
* SMB2 [Create Response] mid=4 uid=440004000075 tid=01 - server #1 [192.168.166.44:445]
* SMB2 [QueryDirectory Request ] mid=5 uid=440004000075 tid=01 - server #1 [192.168.166.44:445]
* SMB2 [QueryDirectory Response] mid=5 uid=440004000075 tid=01 - server #1 [192.168.166.44:445]
* SMB2 [Close Request ] mid=6 uid=440004000075 tid=01 - server #1 [192.168.166.44:445]
* SMB2 [Close Response] mid=6 uid=440004000075 tid=01 - server #1 [192.168.166.44:445]
$Recycle.Bin 0 4Y-2m-2d 2H:2M
$WINDOWS.~BT 0 4Y-2m-2d 2H:2M
pagefile.sys 671088640 4Y-2m-2d 2H:2M
swapfile.sys 268435456 4Y-2m-2d 2H:2M
* Disconnected - server #1 [192.168.166.44:445]