hirochachacha / go-smb2

SMB2/3 client library written in Go.
BSD 2-Clause "Simplified" License
350 stars 94 forks source link

Better Documentation for use of Hash instead of Password #46

Closed ToasterUwU closed 3 years ago

ToasterUwU commented 3 years ago

First of all: Thanks for making this library.

I read that you can use "the Hash" instead of the Password. And I would like to do that. But for me as someone that doesn't know smb or Go too well, I'm like: "What hash?"

I searched for the word hash in the docs, and it was never explained anywhere. Thanks to issue #24 I think I know that it would be an "NTML Hash" and that people can get it with an online converter.

So I figured I found what I need and filled the thing with:

d := &smb2.Dialer{
    Initiator: &smb2.NTLMInitiator{
        User: "My Username",
        Hash: []byte("77D446E301C7F0C07712AF296C41AE45"),
    },
}

But then I just got an error saying that my login info is wrong.

I would much appreciate an explanation and an explaining note in the docs.

Thanks in advance!

hirochachacha commented 3 years ago

try https://golang.org/pkg/encoding/hex/#DecodeString

ToasterUwU commented 3 years ago

Yes, that worked, thanks.

Would be nice if you can make a note in the docs, so people don't have to start googling what kind of Hash they need to use. Not everyone knows the NTLM Hash thing.

Have a nice day, and thank you.