Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/stacktitan/smb
An SMB library in Go
https://github.com/stacktitan/smb
Last synced: 3 months ago
JSON representation
An SMB library in Go
- Host: GitHub
- URL: https://github.com/stacktitan/smb
- Owner: stacktitan
- License: mit
- Created: 2017-02-02T15:08:28.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2019-05-31T12:29:00.000Z (over 5 years ago)
- Last Synced: 2024-07-16T13:08:53.223Z (4 months ago)
- Language: Go
- Size: 18.6 KB
- Stars: 161
- Watchers: 10
- Forks: 36
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SMB
A Go package for communicating over SMB. Currently only minimal funcationality exists for client-side functions.Here is a sample client that establishes a session with a server:
```go
package mainimport (
"log""github.com/stacktitan/smb/smb"
)func main() {
host := "172.16.248.192"
options := smb.Options{
Host: host,
Port: 445,
User: "alice",
Domain: "corp",
Workstation: "",
Password: "Password123!",
}
debug := false
session, err := smb.NewSession(options, debug)
if err != nil {
log.Fatalln("[!]", err)
}
defer session.Close()if session.IsSigningRequired {
log.Println("[-] Signing is required")
} else {
log.Println("[+] Signing is NOT required")
}if session.IsAuthenticated {
log.Println("[+] Login successful")
} else {
log.Println("[-] Login failed")
}if err != nil {
log.Fatalln("[!]", err)
}
}```