Go implementation of SMB exec.
I couldn't find any smbexec implementations that allow you to pass an NTLM hash, so I decided to make my own.
- right now the maximum size of a command to execute is 4096 bytes
- doesn't support kerberos
All credits go to https://github.com/Kevin-Robertson/Invoke-TheHash. I got pretty much all the code from there and translated it into golang.
I still had to do a lot of troubleshooting, but not nearly as much as if I implemented it from scratch.
Install:
go install github.com/wadeking98/gosmbexec@latest
Usage:
gosmbexec -u Administrator -p 'Password!' -h 127.0.0.1 -d lab.local -c 'echo test C:\test.txt'
gosmbexec -u Administrator -hash fbdcd5041c96ddbd82224270b57f11fc -h 127.0.0.1 -d lab.local -c 'echo test C:\test.txt'