profile
viewpoint

hirochachacha/go-smb2 50

SMB2/3 client library written in Go.

hirochachacha/graphql-auto-transformer 23

A custom transformer of the amplify-cli. It can control accessibility of auto generated fields.

hirochachacha/plua 7

Lua 5.3 implementation (WIP)

u16suzu/Reading-The-RSpec-Book 3

Reading The RSpec Book in English at Geekhouse Musashi-Kosugi

hirochachacha/p 1

experimental UI for google/pprof

hirochachacha/amplify-cli 0

A CLI toolchain for simplifying serverless web and mobile development.

hirochachacha/amplify-console 0

AWS Amplify Console - Hosting for fullstack serverless web apps

hirochachacha/apython 0

My personalized version of bpython. It's not for general purpose

fork hirochachacha/impacket

Impacket is a collection of Python classes for working with network protocols.

fork in 8 days

pull request commenthirochachacha/go-smb2

Support for older go versions.

👍

mertcelen

comment created time in 11 days

push eventhirochachacha/go-smb2

Mert ÇELEN

commit sha 80c4a8aa0f7afa0a919c6bf8ea40fab9c7fb58db

Support for older go versions.

view details

hirochachacha

commit sha fec9fc65e30344dc232dd74c42ca3e69134222bf

Merge pull request #38 from mertcelen/master Support for older go versions.

view details

push time in 11 days

PR merged hirochachacha/go-smb2

Support for older go versions.

Hello

I've just updated very simple string replace function to support older versions of go. Should be supported generally, I've tested with 1.11 which is in stable repository of Debian 10.

+1 -1

0 comment

1 changed file

mertcelen

pr closed time in 11 days

push eventhirochachacha/fileknock

Hiroshi Ioka

commit sha e5a5a796032d033a529d35b8ec78f23e532ed5a0

feat: support fetch retry

view details

push time in 20 days

create barnchhirochachacha/fileknock

branch : master

created branch time in 21 days

created repositoryhirochachacha/fileknock

created time in 21 days

issue commenthirochachacha/go-smb2

this is a error,when i download a file. how can I fix it ?

Never mind. In any case, solution wasn't hard.

carlye

comment created time in a month

created taghirochachacha/go-smb2

tagv1.0.2

SMB2/3 client library written in Go.

created time in a month

push eventhirochachacha/go-smb2

Hiroshi Ioka

commit sha ab8de331e002fa38f373c4d19a2b4e119f6083af

fix: Chmod and Remove

view details

Hiroshi Ioka

commit sha e14a2c5c2f06e9f1f22c57e6092d9452a294f1ad

fix: handle async response packet Fixes #37

view details

push time in a month

issue closedhirochachacha/go-smb2

this is a error,when i download a file. how can I fix it ?

2020/08/30 15:59:04 read onecloud\tddownload\Train.to.Busan.2.Peninsula.2020.KOREAN.1080p.WEBRip.DD5.1.x264-CM\Train.to.Busan.2.Peninsula.2020.KOREAN.1080p.WEBRip .DD5.1.x264-CM.mkv: invalid response error: expected tree id: 124982927, got 0

maybe is same reason for func ListSharenames

panic: listSharenames srvsvc: invalid response error: expected tree id: 1300213661, got 0

closed time in a month

carlye

issue commenthirochachacha/go-smb2

this is a error,when i download a file. how can I fix it ?

Hello, what's your server? Windows 10? Today I learned that windows 10 sometimes responds with async packet even though request is sync packet, crazy. I want to know whether this is standard behavior. Also, if possible, could you give me a packet capture? So that I can confirm this issue.

carlye

comment created time in a month

issue commenthirochachacha/go-smb2

feature request: add server version detection

I don't know how to detect OS in smb2. I just googled it, and it seems to me that nmap currently doesn't support OS detection in smb2.

It has get_os function for smb1. https://github.com/nmap/nmap/blob/ccdb81655208383fe5144bffcd77edf4f47c4bd0/nselib/smb.lua#L3383

But I couldn't find similar functionality for smb2. https://github.com/nmap/nmap/blob/ccdb81655208383fe5144bffcd77edf4f47c4bd0/nselib/smb2.lua

ilyapashuk

comment created time in a month

push eventhirochachacha/go-smb2

Hiroshi Ioka

commit sha 519ee96f0898ad20c1cb4935bec646ab106929b4

fix: Remove and RemoveAll

view details

push time in 2 months

created taghirochachacha/go-smb2

tagv1.0.1

SMB2/3 client library written in Go.

created time in 2 months

push eventhirochachacha/go-smb2

Hiroshi Ioka

commit sha fee5c0b12b4bd2cb1736ff4bd701d8af35f9030b

test: add TestServerSideCopy

view details

push time in 2 months

push eventhirochachacha/go-smb2

Hiroshi Ioka

commit sha f91dd85786354fdf51113e41bb77da0f2a862fe7

feat: change API signatures for v1.0.0 * remove IsXXX * remove MultipleError * add ContextError This change allows users to use os.IsXXX instead. * remove File.WithContext File starts to use underlying filesystem's context. Therefore should use Share.WithContext instead. * change DialContext's param order context should be the first parameter. * rename ListShareNames to ListSharenames

view details

push time in 2 months

created taghirochachacha/go-smb2

tagv1.0.0

SMB2/3 client library written in Go.

created time in 2 months

push eventhirochachacha/go-smb2

Hiroshi Ioka

commit sha d52fca3c32e57996bdfc5788c1ac504876a49f9c

feat: change API signatures for v1.0.0 * remove IsXXX * remove MultipleError * add ContextError This change allows users to use os.IsXXX instead. * remove File.WithContext File starts to use underlying filesystem's context. Therefore should use Share.WithContext instead. * change DialContext's param order context should be the first parameter.

view details

push time in 2 months

delete branch hirochachacha/go-smb2

delete branch : feat/list_share_name

delete time in 2 months

push eventhirochachacha/go-smb2

Hiroshi Ioka

commit sha 6569ee9e2547186eadde5cc7686551107183ec9e

feat: collection * refactor type names * refactor utf16 handling * replace '/' automatically * add ListShareNames method * fix guest login flow * simplify Mount path * add examples Fixes #17

view details

hirochachacha

commit sha 49b4666820c53707890c12e3275ccdb46daaf9f9

Merge pull request #35 from hirochachacha/feat/list_share_name feat: collection

view details

push time in 2 months

PR merged hirochachacha/go-smb2

feat: collection
  • refactor type names
  • refactor utf16 handling
  • replace '/' automatically
  • add ListShareNames method
  • fix guest login flow
  • simplify Mount path
  • add examples

Fixes #17

+943 -299

0 comment

26 changed files

hirochachacha

pr closed time in 2 months

issue closedhirochachacha/go-smb2

List files in a directory

Hey, How can I list files in a directory with Readdir() if I have a share entered by a user? What i'm really wondering and I have been trying to figure out how can I create a pointer for the type *RemoteFile in order to use other functions?

closed time in 2 months

Pch12

PR opened hirochachacha/go-smb2

feat: collection
  • refactor type names
  • refactor utf16 handling
  • replace '/' automatically
  • add ListShareNames method
  • fix guest login flow
  • simplify Mount path
  • add examples

Fixes #17

+943 -299

0 comment

26 changed files

pr created time in 2 months

push eventhirochachacha/go-smb2

Hiroshi Ioka

commit sha 6569ee9e2547186eadde5cc7686551107183ec9e

feat: collection * refactor type names * refactor utf16 handling * replace '/' automatically * add ListShareNames method * fix guest login flow * simplify Mount path * add examples Fixes #17

view details

push time in 2 months

push eventhirochachacha/go-smb2

Hiroshi Ioka

commit sha a3f24eceafd23e154b66d348e49ac18ec8b89cf7

feat: collection * refactor type names * refactor utf16 handling * replace '/' automatically * add ListShareNames method * fix guest login flow * simplify Mount path * add examples Fixes #17

view details

push time in 2 months

push eventhirochachacha/go-smb2

Hiroshi Ioka

commit sha e20fef4fa9d9ed61d46efba38b0e77bd4a274c4c

fadsf0

view details

push time in 2 months

push eventhirochachacha/go-smb2

Hiroshi Ioka

commit sha 7fc907cf6602872b5e0f43e90f6a557ad0fe8c06

fdasf

view details

push time in 2 months

push eventhirochachacha/go-smb2

Hiroshi Ioka

commit sha d0e806ddbac57bea9dc82698225a94d030f793f7

fadsf

view details

push time in 2 months

push eventhirochachacha/go-smb2

Hiroshi Ioka

commit sha c51bd6c99dd0a218741c9a00cd77f667e20e1e5b

fdsf

view details

push time in 2 months

push eventhirochachacha/go-smb2

Hiroshi Ioka

commit sha 5736f8e83222768ee74daf8c7a33394654098a12

fdasf

view details

push time in 2 months

create barnchhirochachacha/go-smb2

branch : feat/list_share_name

created branch time in 2 months

Pull request review commenthirochachacha/go-smb2

Fixing ASN.1 BER decryption when connecting to cDOT SMB server

 func DecodeNegTokenResp(bs []byte) (*NegTokenResp, error) {  	_, err := asn1.UnmarshalWithParams(bs, &resp, "explicit,tag:1") 	if err != nil {-		return nil, err+		_, err = ber.UnmarshalWithParams(bs, &resp, "explicit,tag:1")

I don't know much about LDAP, but we're trying to change SPNEGO code. So let's focus on it.

According to https://tools.ietf.org/html/rfc4178:

  • DER encoding is required.

Therefore, if some SMB server responds with BER encoding on SPNEGO protocol, that's probably a bug. That being said, I'm fine with making this library permissive to accept those responses. But still I want some test code.

To be clear, what I'm asking is following data. If it contains sensitive data, you can give me a redacted version. Will that action be prohibited by the company? Sorry for the repeated request. image

dragoscirjan

comment created time in 2 months

Pull request review commenthirochachacha/go-smb2

Fixing ASN.1 BER decryption when connecting to cDOT SMB server

 func DecodeNegTokenResp(bs []byte) (*NegTokenResp, error) {  	_, err := asn1.UnmarshalWithParams(bs, &resp, "explicit,tag:1") 	if err != nil {-		return nil, err+		_, err = ber.UnmarshalWithParams(bs, &resp, "explicit,tag:1")

Thank you for the explanation. But honestly I can't understand connection between SPNEGO and certificates. Since we're dealing with de/serialization, an unit test with real data is decisive.

dragoscirjan

comment created time in 2 months

Pull request review commenthirochachacha/go-smb2

Fixing ASN.1 BER decryption when connecting to cDOT SMB server

 func DecodeNegTokenResp(bs []byte) (*NegTokenResp, error) {  	_, err := asn1.UnmarshalWithParams(bs, &resp, "explicit,tag:1") 	if err != nil {-		return nil, err+		_, err = ber.UnmarshalWithParams(bs, &resp, "explicit,tag:1")

I saw the comment on testing as well, but since NetApp is a proprietary, licensed tool, I have no way of adding some tests; you would just have to believe me it works.

Hmm, how do you found out that cDot is using BER encoding? I couldn't find any references. Is it difficult to get a packet capture? I don't think NegTokenResp contains sensitive data.

dragoscirjan

comment created time in 2 months

Pull request review commenthirochachacha/go-smb2

Fixing ASN.1 BER decryption when connecting to cDOT SMB server

 func DecodeNegTokenResp(bs []byte) (*NegTokenResp, error) {  	_, err := asn1.UnmarshalWithParams(bs, &resp, "explicit,tag:1") 	if err != nil {-		return nil, err+		_, err = ber.UnmarshalWithParams(bs, &resp, "explicit,tag:1")

DER encoding is restricted version of BER encoding, in other words, BER decoder should be able to decode DER encoding. So, instead of this, simple substitution maybe work:

s/asn1\.Unmarshal/ber.Unmarshal/g

I guess?

dragoscirjan

comment created time in 2 months

pull request commenthirochachacha/go-smb2

add NTLM Target Info; return broken session with error

Sorry for the late reply. I'm still unsure of the right approach here. Because I want to provide hight-level abstraction in this library, I don't want to reveal whole low-level properties. If the main purpose is improving error messages, we might want to consider extending error structures rather than adding new API.

ropnop

comment created time in 2 months

pull request commenthirochachacha/go-smb2

Fixing ASN.1 BER decryption when connecting to cDOT SMB server

Thank you. That sounds good to me. Could you add test code?

dragoscirjan

comment created time in 2 months

issue closedhirochachacha/go-smb2

Mac OS: invalid response error: asn1: structure error: superfluous leading zeros in length

Hi

platform: macos

I am getting this error

panic: invalid response error: asn1: structure error: superfluous leading zeros in length

code is pasted below

I am interested in the filename.

closed time in 2 months

kshetty1990

issue commenthirochachacha/go-smb2

Mac OS: invalid response error: asn1: structure error: superfluous leading zeros in length

I couldn't reproduce the exact same error message, but I think following code is culprit.

	fs, err := c.Mount(`\\<IP>\<path>\<folder1>\<folder2>\<filename>`)
	if err != nil {
		panic(err) // panic here
	}

The mount path should be a valid UNC root path like \\<server>\<share>. You can't specify <folder> and <filename>

If that's not your case, please let me know, so I'll reopen this.

kshetty1990

comment created time in 2 months

push eventhirochachacha/go-smb2

Hiroshi Ioka

commit sha f1939d78dcb176277dfcf89504e41e777e9cd639

chore: improve validation for mount path

view details

push time in 2 months

issue closedhirochachacha/go-smb2

Mac OS con.Mount(`\\ip\dir`) have ERR :unverified packet returned

GO version:

go version go1.13.8 darwin/amd64

OS version:

MacOS 10.15.6

show me code:

conn, err := net.Dial("tcp", "192.168.1.200:445")
	if err != nil {
		panic(err)
	}
	defer conn.Close()

	d := &smb2.Dialer{
		Initiator: &smb2.NTLMInitiator{
			User:     "Guest",
		},
	}
	c, err := d.Dial(conn)
	if err != nil {
		panic(err)
	}
	defer c.Logoff()
	fs, err := c.Mount(`\\192.168.1.200`)
	if err != nil {
		panic(err)
	}
	defer fs.Umount()

console

panic: invalid response error: unverified packet returned

goroutine 1 [running]:
main.main()
        /Users/<USER>/go/src/sbm/main/main.go:28 +0x3e5

Help,,,,,,How do I need to correct it???

closed time in 2 months

ltto

issue commenthirochachacha/go-smb2

Mac OS con.Mount(`\\ip\dir`) have ERR :unverified packet returned

You cannot mount your host directly. You have to specify share name.

fs, err := c.Mount(`\\<host>\<share>`)
ltto

comment created time in 2 months

issue closedhirochachacha/go-smb2

Function ReadFile() tries to read a local file.

I am experimenting with the library and found that the ReadFile function tries to read a local file instead of the file of the remote server. Should the call in client.go::618 os.Open(filename) be changed to fs.Open(filename) ?

When I changed it locally, I could read remote files in one go as I suspect this is what the call are suppose to do.

closed time in 2 months

joshartman

pull request commenthirochachacha/go-smb2

BUGFIX: ReadFile should read from the RemoteFileSystem

Thank you!

AlyssaDaemon

comment created time in 2 months

push eventhirochachacha/go-smb2

Alyssa Herzog

commit sha b383ac235036f5b8b7a8baed579dfa13c7aa7988

BUGFIX: ReadFile should read from the RemoteFileSystem

view details

hirochachacha

commit sha 739edc24f0f40ed447b0a2735c2a5675a0e97824

Merge pull request #33 from AlyssaDaemon/read_file_fix BUGFIX: ReadFile should read from the RemoteFileSystem

view details

push time in 2 months

PR merged hirochachacha/go-smb2

BUGFIX: ReadFile should read from the RemoteFileSystem

PR to address #32

Changes the ReadFile function to read from fs / RemoteFileSystem instead of the local filesystem.

+1 -1

1 comment

1 changed file

AlyssaDaemon

pr closed time in 2 months

more