Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SMB Server: Support for OPTIONS method #301

Closed
User65k opened this issue Aug 6, 2017 · 6 comments
Closed

SMB Server: Support for OPTIONS method #301

User65k opened this issue Aug 6, 2017 · 6 comments

Comments

@User65k
Copy link

User65k commented Aug 6, 2017

Hi,
when I try to access the SMBServer from Windows 7, I get:

code 501, message Unsupported method ('OPTIONS')
"OPTIONS / HTTP/1.1" 501 -

I used this code for the Server:

from impacket import smbserver

class SMBHandler(smbserver.SimpleSMBServer):
    def stop(self):
        #self._SimpleSMBServer__server.socket.close()
        #self._SimpleSMBServer__server.server_close()
        pass

smb = SMBHandler(listenAddress = args.ip, listenPort=args.smb)
smb.addShare("SHARE", args.folder, "")
smb.setSMB2Support(True)

t = Thread(target=smb.start, args=())
t.daemon = True
t.start()

I also tried without SMB2 support. Gives me the same Error. So I guess OPTIONS would be nice for Windows? 😃

@mubix
Copy link
Contributor

mubix commented Aug 7, 2017

WebDAV FTW!

@User65k
Copy link
Author

User65k commented Aug 7, 2017

So SMB can't work without a WebDAV Server (on port 80)?

@mubix
Copy link
Contributor

mubix commented Aug 7, 2017

If a SMB connection fails and the WebClient service is running then Windows will attempt to access the same share over WebDAV. For instance, that is how \live.sysinternals.com\tools\ works

@User65k
Copy link
Author

User65k commented Aug 7, 2017

Ok, I guess that makes sense.
But what's wrong with the SMB Share then? It works fine with nemo

@asolino
Copy link
Collaborator

asolino commented Aug 7, 2017

Hey folks:

Ok.. I need some clarifications here.

  1. OPTIONS is a HTTP method. It has nothing to do with SMB. If you launch smbrelayx.py (or ntlmrelayx.py) it will launch a Web Server so you can relay credentials that land there, but in a pure SMB Server (like the example you wrote @User65k) there's not HTTP Server listening.
  2. If OPTIONS is needed for a relay scenario, let me know and I'll add it to the HTTPRelayServer, but I'm not sure this is what we're talking about here.

@User65k
Copy link
Author

User65k commented Aug 7, 2017

Yes, sorry I got confused. I had a HTTP Server log into the same log as the SMB Server.
So the missing OPTIONS are not relevant and my bad.

However, the small SMB Server I wrote does not work with Windows 7.
The same Server works well with Nemo (File Explorer) and the impacket smb tooling.

The same goes for python smbserver.py SHARE ~/Downloads

I just took a look in Wireshark. My Win never even tries SMB but directly goes to port 80. So I guess my Windows Box is wired and you can close this 😕

@User65k User65k closed this as completed Aug 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants