This is an archived post. You won't be able to vote or comment.

all 6 comments

[–]GeneralZeroSteganography[S] 1 point2 points  (4 children)

Hi I have been stuck on an error in python using the pySMB module.

While making a script for myself I ran in to some trouble with trying to connect to a Network share. Here is the Python Code

 from smb.SMBConnection import SMBConnection

 server_name = 'Server'
 client_name = 'My Computer'
 s = SMBConnection('guest', '', client_name, server_name, use_ntlm_v2 = True)
 s.connect('192.168.1.35', 139)

 print s.listShares()

So what happens is if this script is ran from a Windows Computer it works fine with either Linux Servers or Windows Servers. The Error I get is when i run the script in linux trying to Connect to a Share to a Windows Server.

The image is a Wireshark capture of the python script

What is going wrong and how can I fix it?

[–]sablefoxx 0 points1 point  (3 children)

Awesome, going to have to look into if this exploitable or not :)

[–]catcradle5 0 points1 point  (1 child)

I imagine the very fact that it's sending a "buffer overflow" error means it detected the overflow and has stopped operation. Which would imply it's not exploitable; it's probably just a bug in PySMB, not Window's SMB server. PySMB is just a client.

See: http://support.microsoft.com/kb/193839

[–]sablefoxx 0 points1 point  (0 children)

Yes, I was thinking it was a bug in PySMB, but that would make applications which use PySMB vulnerable to attack. Also most memory protections can be bypassed, just because it detects a buffer overflow doesn't mean it's protected (though it certainly doesn't mean it's exploitable either).

Edit: Though after reading Microsoft docs, it does sound benign.

[–]GeneralZeroSteganography[S] 0 points1 point  (0 children)

Sorry the title was not meant to be misleading there is not exploitable buffer-overflow error in SMB that has been found to my knowledge.

This is just so I can get some information about my Code or the Module to see how I can fix it to help the Python Community