开发者

'Cannot request session' when using impacket's SMB client against a Windows machine

开发者 https://www.devze.com 2023-04-12 11:46 出处:网络
i am running on fedora 15 ( python 2.7 ) i\'ve tried the imapcket.smb against win开发者_C百科dows 2000 sp4 (frensh) , windows xp sp2 (frensh) , windows xp sp3 (frensh) and it worked perfectly , but w

i am running on fedora 15 ( python 2.7 )

i've tried the imapcket.smb against win开发者_C百科dows 2000 sp4 (frensh) , windows xp sp2 (frensh) , windows xp sp3 (frensh) and it worked perfectly , but when i use it against windows 7 (frensh) x64 it didn't work .

from my python :

>>> import impacket.smb as smb
>>> session = smb.SMB ( '*SMBSERVER' , '192.168.56.103' )

and i always get the following line :

>>> NetBIOSError ( 'Cannot request session', 240, 130 )

i can't understand why this is happening


*SMBSERVER is a NetBios alias that would allow to establish a SMB over NetBIOS (port 139) connection against a target Windows machine without knowing the real NetBIOS server name of the target. Since Vista on, that alias has been deprecated.

So you have two choices:

  1. session = smb.SMB ( '<TARGET NETBIOS NAME>' , '192.168.56.103' ). You will need to know in advance the target's NetBIOS name
  2. session = smb.SMB ( '192.168.56.103' , '192.168.56.103', sess_port = 445 ). This will connect to target port 445 where you don't need to know the target's NetBIOS server name.
0

精彩评论

暂无评论...
验证码 换一张
取 消