Skip to content

x/sys/windows: windows/svc/example is detected as malware #54394

@t00ts

Description

@t00ts

What version of Go are you using (go version)?

$ go version
go version go1.19 windows/amd64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
set GO111MODULE=
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\Akila\AppData\Local\go-build
set GOENV=C:\Users\Akila\AppData\Roaming\go\env
set GOEXE=.exe
set GOEXPERIMENT=
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=C:\Users\Akila\go\pkg\mod
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Users\Akila\go
set GOPRIVATE=
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=C:\Program Files\Go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=C:\Program Files\Go\pkg\tool\windows_amd64
set GOVCS=
set GOVERSION=go1.19
set GCCGO=gccgo
set GOAMD64=v1
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=C:\Users\Akila\Desktop\service tests\go.mod
set GOWORK=
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fno-caret-diagnostics -Qunused-arguments -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=C:\Users\Akila\AppData\Local\Temp\go-build4169214643=/tmp/go-build -gno-record-gcc-switches

What did you do?

  1. Download the example service.
  2. Build the example: go build .
  3. Run the example: Install and start the service
> win_svc.exe install
> win_svc.exe start

What did you expect to see?

The service running normally

What did you see instead?

Capture1
win_sec_detection
Capture3

Windows has stopped the service from running and uninstalled it from the registry. It cannot be run or re-installed:

> win_svc.exe start
failed to start myservice: could not access service: The specified service does not exist as an installed service.

> win_svc.exe install
failed to install myservice: SetupEventLogSource() failed: SYSTEM\CurrentControlSet\Services\EventLog\Application\myservice registry key already exists

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.compiler/runtimeIssues related to the Go compiler and/or runtime.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions