Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Service Payload Name #449

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion teamserver/cmd/server/dispatch.go
Original file line number Diff line number Diff line change
Expand Up @@ -873,6 +873,9 @@ func (t *Teamserver) DispatchEvent(pk packager.Package) {
PayloadBuilder.SetArch(builder.ARCHITECTURE_X86)
}

var Name string
Name = "demon"

var Ext string
if Arch == "x64" {
Ext = ".x64"
Expand All @@ -886,6 +889,7 @@ func (t *Teamserver) DispatchEvent(pk packager.Package) {
} else if Format == "Windows Service Exe" {
PayloadBuilder.SetFormat(builder.FILETYPE_WINDOWS_SERVICE_EXE)
Ext += ".exe"
Name += "_svc"
} else if Format == "Windows Dll" {
PayloadBuilder.SetFormat(builder.FILETYPE_WINDOWS_DLL)
Ext += ".dll"
Expand Down Expand Up @@ -915,7 +919,7 @@ func (t *Teamserver) DispatchEvent(pk packager.Package) {
if PayloadBuilder.Build() {
pal := PayloadBuilder.GetPayloadBytes()
if len(pal) > 0 {
err := t.SendEvent(PayloadBuilder.ClientId, events.Gate.SendStageless("demon"+Ext, pal))
err := t.SendEvent(PayloadBuilder.ClientId, events.Gate.SendStageless(Name+Ext, pal))
if err != nil {
logger.Error("Error while sending event: " + err.Error())
return
Expand Down