Skip to content

Problem executing Golang binaries  #152

@ghost

Description

I am testing donut using a simple go program:

package main

import (
	"fmt"
	"os"
)

func main() {
	fmt.Println("test")
	f, err := os.Create("test")
	if err != nil {
		panic(err)
	}
	n, err := f.WriteString("test")
	if err != nil {
		panic(err)
	}
	fmt.Println(n)
	f.Close()
}

go environment

GO111MODULE=''
GOARCH='amd64'
GOBIN=''
GOCACHE='/home/*/.cache/go-build'
GOENV='/home/*/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='/home/*/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/home/*/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/usr/local/go'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/usr/local/go/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.22.2'
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='gcc'
CXX='g++'
CGO_ENABLED='1'
GOMOD='/dev/null'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build2062461114=/tmp/go-build -gno-record-gcc-switches'

go build command

GOOS=windows GOARCH=amd64 go build test.go

donut building

*@*:~/Desktop/donut$ ./donut -f 6 --input:../test.exe

  [ Donut shellcode generator v1 (built May 18 2024 16:09:18)
  [ Copyright (c) 2019-2021 TheWover, Odzhan

  [ Instance type : Embedded
  [ Module file   : "../test.exe"
  [ Entropy       : Random names + Encryption
  [ File type     : EXE
  [ Target CPU    : x86+amd64
  [ AMSI/WDLP/ETW : continue
  [ PE Headers    : overwrite
  [ Shellcode     : "loader.ps1"
  [ Exit          : Thread

expected behaviour:
a named "test" is created containing the content "test".

what actually happens:
powershell script hangs for a moment then exits.

additional information:
windows defender is disabled

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions