From 7aa6c571c35deb67ee478f8297a2047502d6e71a Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Thu, 7 Jul 2022 22:35:34 -0700 Subject: [PATCH 001/113] back to dev --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index ce69cfb..0dc1bbe 100644 --- a/main.go +++ b/main.go @@ -25,7 +25,7 @@ import ( ) var ( - version = "2.1.0" + version = "2.1.1-dev" log = logrus.New() logFile *os.File ) From 480ee21785b52537e94db57f3b9c9b409ecef3db Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Thu, 7 Jul 2022 22:35:48 -0700 Subject: [PATCH 002/113] update reqs --- go.mod | 8 ++++---- go.sum | 19 +++++++++++-------- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/go.mod b/go.mod index c889a07..dcedfd4 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.18 require ( github.com/StackExchange/wmi v1.2.1 - github.com/elastic/go-sysinfo v1.8.0 + github.com/elastic/go-sysinfo v1.8.1 github.com/go-ole/go-ole v1.2.6 github.com/go-ping/ping v1.1.0 github.com/go-resty/resty/v2 v2.7.0 @@ -13,13 +13,13 @@ require ( github.com/nats-io/nats-server/v2 v2.8.4 // indirect github.com/nats-io/nats.go v1.16.0 github.com/rickb777/date v1.19.1 - github.com/shirou/gopsutil/v3 v3.22.5 + github.com/shirou/gopsutil/v3 v3.22.6 github.com/sirupsen/logrus v1.8.1 github.com/ugorji/go/codec v1.2.7 github.com/wh1te909/go-win64api v0.0.0-20210906074314-ab23795a6ae5 github.com/wh1te909/trmm-shared v0.0.0-20220227075846-f9f757361139 - golang.org/x/net v0.0.0-20220531201128-c960675eff93 // indirect - golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a + golang.org/x/net v0.0.0-20220706163947-c90051bbdb60 // indirect + golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e ) require ( diff --git a/go.sum b/go.sum index 17e72d9..cd81c8b 100644 --- a/go.sum +++ b/go.sum @@ -57,8 +57,8 @@ github.com/creachadair/staticfile v0.1.3/go.mod h1:a3qySzCIXEprDGxk6tSxSI+dBBdLz github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/elastic/go-sysinfo v1.8.0 h1:hwmVlZLfTVTP+L0hSS2BD/G8GNPmcl4JEMoOktSw/wc= -github.com/elastic/go-sysinfo v1.8.0/go.mod h1:JfllUnzoQV/JRYymbH3dO1yggI3mV2oTKSXsDHM+uIM= +github.com/elastic/go-sysinfo v1.8.1 h1:4Yhj+HdV6WjbCRgGdZpPJ8lZQlXZLKDAeIkmQ/VRvi4= +github.com/elastic/go-sysinfo v1.8.1/go.mod h1:JfllUnzoQV/JRYymbH3dO1yggI3mV2oTKSXsDHM+uIM= github.com/elastic/go-windows v1.0.1 h1:AlYZOldA+UJ0/2nBuqWdo90GFCgG9xuyw9SYzGUtJm0= github.com/elastic/go-windows v1.0.1/go.mod h1:FoVvqWSun28vaDQPbj2Elfc0JahhPB7WQEGa3c814Ss= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= @@ -255,8 +255,8 @@ github.com/rogpeppe/go-internal v1.8.1 h1:geMPLpDpQOgVyCg5z5GoRwLHepNdb71NXb67XF github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= github.com/scjalliance/comshim v0.0.0-20190308082608-cf06d2532c4e h1:+/AzLkOdIXEPrAQtwAeWOBnPQ0BnYlBW0aCZmSb47u4= github.com/scjalliance/comshim v0.0.0-20190308082608-cf06d2532c4e/go.mod h1:9Tc1SKnfACJb9N7cw2eyuI6xzy845G7uZONBsi5uPEA= -github.com/shirou/gopsutil/v3 v3.22.5 h1:atX36I/IXgFiB81687vSiBI5zrMsxcIBkP9cQMJQoJA= -github.com/shirou/gopsutil/v3 v3.22.5/go.mod h1:so9G9VzeHt/hsd0YwqprnjHnfARAUktauykSbr+y2gA= +github.com/shirou/gopsutil/v3 v3.22.6 h1:FnHOFOh+cYAM0C30P+zysPISzlknLC5Z1G4EAElznfQ= +github.com/shirou/gopsutil/v3 v3.22.6/go.mod h1:EdIubSnZhbAvBS1yJ7Xi+AShB/hxwLHOMz4MCYz7yMs= github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE= github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/spf13/afero v1.8.2 h1:xehSyVa0YnHWsJ49JFljMpg1HX19V6NDZ1fkm1Xznbo= @@ -272,13 +272,15 @@ github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An github.com/spf13/viper v1.12.0 h1:CZ7eSOd3kZoaYDLbXnmzgQI5RlciuXBMA+18HwHRfZQ= github.com/spf13/viper v1.12.0/go.mod h1:b6COn30jlNxbm/V2IqWiNWkJ+vZNiMNksliPCiuKtSI= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.5 h1:s5PTfem8p8EbKQOctVV53k6jCJt3UX4IEJzwh+C324Q= +github.com/stretchr/testify v1.7.5/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/subosito/gotenv v1.4.0 h1:yAzM1+SmVcz5R4tXGsNMu1jUl2aOJXoiWUCEwwnGrvs= github.com/subosito/gotenv v1.4.0/go.mod h1:mZd6rFysKEcUhUHXJk0C/08wAgyDBFuwEYL7vWWGaGo= github.com/tklauser/go-sysconf v0.3.10 h1:IJ1AZGZRWbY8T5Vfk04D9WOA5WSejdflXxP03OUqALw= @@ -385,8 +387,8 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211029224645-99673261e6eb/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220531201128-c960675eff93 h1:MYimHLfoXEpOhqd/zgoA/uoXzHB86AEky4LAx5ij9xA= -golang.org/x/net v0.0.0-20220531201128-c960675eff93/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.0.0-20220706163947-c90051bbdb60 h1:8NSylCMxLW4JvserAndSgFL7aPli6A68yf0bYFTcWCM= +golang.org/x/net v0.0.0-20220706163947-c90051bbdb60/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -464,8 +466,9 @@ golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220319134239-a9b59b0215f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a h1:dGzPydgVsqGcTRVwiLJ1jVbufYwmzD3LfVPLKsKg+0k= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e h1:CsOuNlbOuf0mzxJIefr6Q4uAUetRUwZE4qt7VfzP+xo= +golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= From be050ea16f615d560d7f6996dca3f461f877c968 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Thu, 7 Jul 2022 22:51:16 -0700 Subject: [PATCH 003/113] fix panic on windows 7/2008R2 caused by NetCreateProvisioningPackage which is only avail on windows 8+ --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index dcedfd4..639bad3 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/go-ping/ping v1.1.0 github.com/go-resty/resty/v2 v2.7.0 github.com/gonutz/w32/v2 v2.4.0 - github.com/iamacarpet/go-win64api v0.0.0-20220531152116-0aa0ec10b240 + github.com/iamacarpet/go-win64api v0.0.0-20220531131246-e84054eb584d github.com/nats-io/nats-server/v2 v2.8.4 // indirect github.com/nats-io/nats.go v1.16.0 github.com/rickb777/date v1.19.1 diff --git a/go.sum b/go.sum index cd81c8b..e76ffdb 100644 --- a/go.sum +++ b/go.sum @@ -172,8 +172,8 @@ github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/iamacarpet/go-win64api v0.0.0-20210311141720-fe38760bed28/go.mod h1:oGJx9dz0Ny7HC7U55RZ0Smd6N9p3hXP/+hOFtuYrAxM= -github.com/iamacarpet/go-win64api v0.0.0-20220531152116-0aa0ec10b240 h1:JriAj2o4kv6oD4mo4Cpfp7K8vjN7uueEUriSOXhybhI= -github.com/iamacarpet/go-win64api v0.0.0-20220531152116-0aa0ec10b240/go.mod h1:B7zFQPAznj+ujXel5X+LUoK3LgY6VboCdVYHZNn7gpg= +github.com/iamacarpet/go-win64api v0.0.0-20220531131246-e84054eb584d h1:oEqcxSYuVSzQiXfTdp1BTJoowIUTPLCA3fOnfyZO50w= +github.com/iamacarpet/go-win64api v0.0.0-20220531131246-e84054eb584d/go.mod h1:B7zFQPAznj+ujXel5X+LUoK3LgY6VboCdVYHZNn7gpg= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= From f60be3deedbf5632c5f5da864a2e81aca46e35e3 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Thu, 7 Jul 2022 23:19:15 -0700 Subject: [PATCH 004/113] bump version --- build/rmm.exe.manifest | 2 +- build/setup.iss | 2 +- main.go | 2 +- versioninfo.json | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/build/rmm.exe.manifest b/build/rmm.exe.manifest index 243bb4d..523b17c 100644 --- a/build/rmm.exe.manifest +++ b/build/rmm.exe.manifest @@ -3,7 +3,7 @@ diff --git a/build/setup.iss b/build/setup.iss index 3a10b72..1744880 100644 --- a/build/setup.iss +++ b/build/setup.iss @@ -1,5 +1,5 @@ #define MyAppName "Tactical RMM Agent" -#define MyAppVersion "2.1.0" +#define MyAppVersion "2.1.1" #define MyAppPublisher "AmidaWare LLC" #define MyAppURL "https://github.com/amidaware" #define MyAppExeName "tacticalrmm.exe" diff --git a/main.go b/main.go index 0dc1bbe..0e10538 100644 --- a/main.go +++ b/main.go @@ -25,7 +25,7 @@ import ( ) var ( - version = "2.1.1-dev" + version = "2.1.1" log = logrus.New() logFile *os.File ) diff --git a/versioninfo.json b/versioninfo.json index ef230db..0eca85a 100644 --- a/versioninfo.json +++ b/versioninfo.json @@ -3,13 +3,13 @@ "FileVersion": { "Major": 2, "Minor": 1, - "Patch": 0, + "Patch": 1, "Build": 0 }, "ProductVersion": { "Major": 2, "Minor": 1, - "Patch": 0, + "Patch": 1, "Build": 0 }, "FileFlagsMask": "3f", @@ -22,14 +22,14 @@ "Comments": "", "CompanyName": "AmidaWare LLC", "FileDescription": "Tactical RMM Agent", - "FileVersion": "v2.1.0.0", + "FileVersion": "v2.1.1.0", "InternalName": "tacticalrmm.exe", "LegalCopyright": "Copyright (c) 2022 AmidaWare LLC", "LegalTrademarks": "", "OriginalFilename": "tacticalrmm.exe", "PrivateBuild": "", "ProductName": "Tactical RMM Agent", - "ProductVersion": "v2.1.0.0", + "ProductVersion": "v2.1.1.0", "SpecialBuild": "" }, "VarFileInfo": { From 1fbf2be5620c71aa90d618ee685f9d40204ee8b1 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Mon, 25 Jul 2022 21:31:52 -0700 Subject: [PATCH 005/113] only log the url during debug --- agent/agent_unix.go | 2 +- agent/agent_windows.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/agent/agent_unix.go b/agent/agent_unix.go index 037b112..0650512 100644 --- a/agent/agent_unix.go +++ b/agent/agent_unix.go @@ -225,7 +225,7 @@ func (a *Agent) AgentUpdate(url, inno, version string) { defer os.Remove(f.Name()) a.Logger.Infof("Agent updating from %s to %s", a.Version, version) - a.Logger.Infoln("Downloading agent update from", url) + a.Logger.Debugln("Downloading agent update from", url) rClient := resty.New() rClient.SetCloseConnection(true) diff --git a/agent/agent_windows.go b/agent/agent_windows.go index 70367c7..6637e7b 100644 --- a/agent/agent_windows.go +++ b/agent/agent_windows.go @@ -565,7 +565,7 @@ func (a *Agent) AgentUpdate(url, inno, version string) { a.CleanupAgentUpdates() updater := filepath.Join(a.ProgramDir, inno) a.Logger.Infof("Agent updating from %s to %s", a.Version, version) - a.Logger.Infoln("Downloading agent update from", url) + a.Logger.Debugln("Downloading agent update from", url) rClient := resty.New() rClient.SetCloseConnection(true) From eb386a4ee2386f2c70a9cfc4a77de54f9c0481cd Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Mon, 25 Jul 2022 21:33:13 -0700 Subject: [PATCH 006/113] update logrus --- go.mod | 4 ++-- go.sum | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index 639bad3..496cbbf 100644 --- a/go.mod +++ b/go.mod @@ -14,12 +14,12 @@ require ( github.com/nats-io/nats.go v1.16.0 github.com/rickb777/date v1.19.1 github.com/shirou/gopsutil/v3 v3.22.6 - github.com/sirupsen/logrus v1.8.1 + github.com/sirupsen/logrus v1.9.0 github.com/ugorji/go/codec v1.2.7 github.com/wh1te909/go-win64api v0.0.0-20210906074314-ab23795a6ae5 github.com/wh1te909/trmm-shared v0.0.0-20220227075846-f9f757361139 golang.org/x/net v0.0.0-20220706163947-c90051bbdb60 // indirect - golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e + golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8 ) require ( diff --git a/go.sum b/go.sum index e76ffdb..2402230 100644 --- a/go.sum +++ b/go.sum @@ -259,6 +259,8 @@ github.com/shirou/gopsutil/v3 v3.22.6 h1:FnHOFOh+cYAM0C30P+zysPISzlknLC5Z1G4EAEl github.com/shirou/gopsutil/v3 v3.22.6/go.mod h1:EdIubSnZhbAvBS1yJ7Xi+AShB/hxwLHOMz4MCYz7yMs= github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE= github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= +github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= +github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/spf13/afero v1.8.2 h1:xehSyVa0YnHWsJ49JFljMpg1HX19V6NDZ1fkm1Xznbo= github.com/spf13/afero v1.8.2/go.mod h1:CtAatgMJh6bJEIs48Ay/FOnkljP3WeGUG0MC1RfAqwo= github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w= @@ -469,6 +471,8 @@ golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e h1:CsOuNlbOuf0mzxJIefr6Q4uAUetRUwZE4qt7VfzP+xo= golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8 h1:0A+M6Uqn+Eje4kHMK80dtF3JCXC4ykBgQG4Fe06QRhQ= +golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= From ad1ae2a6a110ad7fe2498690b6f6b348e0535e51 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Tue, 26 Jul 2022 23:20:39 -0700 Subject: [PATCH 007/113] bump version --- build/rmm.exe.manifest | 2 +- build/setup.iss | 2 +- main.go | 2 +- versioninfo.json | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/build/rmm.exe.manifest b/build/rmm.exe.manifest index 523b17c..2b4d1a7 100644 --- a/build/rmm.exe.manifest +++ b/build/rmm.exe.manifest @@ -3,7 +3,7 @@ diff --git a/build/setup.iss b/build/setup.iss index 1744880..307a3db 100644 --- a/build/setup.iss +++ b/build/setup.iss @@ -1,5 +1,5 @@ #define MyAppName "Tactical RMM Agent" -#define MyAppVersion "2.1.1" +#define MyAppVersion "2.1.2" #define MyAppPublisher "AmidaWare LLC" #define MyAppURL "https://github.com/amidaware" #define MyAppExeName "tacticalrmm.exe" diff --git a/main.go b/main.go index 0e10538..3ebfb87 100644 --- a/main.go +++ b/main.go @@ -25,7 +25,7 @@ import ( ) var ( - version = "2.1.1" + version = "2.1.2" log = logrus.New() logFile *os.File ) diff --git a/versioninfo.json b/versioninfo.json index 0eca85a..15121e8 100644 --- a/versioninfo.json +++ b/versioninfo.json @@ -3,13 +3,13 @@ "FileVersion": { "Major": 2, "Minor": 1, - "Patch": 1, + "Patch": 2, "Build": 0 }, "ProductVersion": { "Major": 2, "Minor": 1, - "Patch": 1, + "Patch": 2, "Build": 0 }, "FileFlagsMask": "3f", @@ -22,14 +22,14 @@ "Comments": "", "CompanyName": "AmidaWare LLC", "FileDescription": "Tactical RMM Agent", - "FileVersion": "v2.1.1.0", + "FileVersion": "v2.1.2.0", "InternalName": "tacticalrmm.exe", "LegalCopyright": "Copyright (c) 2022 AmidaWare LLC", "LegalTrademarks": "", "OriginalFilename": "tacticalrmm.exe", "PrivateBuild": "", "ProductName": "Tactical RMM Agent", - "ProductVersion": "v2.1.1.0", + "ProductVersion": "v2.1.2.0", "SpecialBuild": "" }, "VarFileInfo": { From 50cebb950dcdb0e1ce72ed9d440832a23146216a Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Sun, 31 Jul 2022 15:14:05 -0700 Subject: [PATCH 008/113] run as user --- agent/agent_unix.go | 4 +-- agent/agent_windows.go | 55 ++++++++++++++++++++++++++++-------------- agent/checks.go | 2 +- agent/choco_windows.go | 2 +- agent/rpc.go | 7 +++--- agent/tasks_windows.go | 4 +-- build/setup.iss | 2 +- go.mod | 3 ++- go.sum | 10 +++----- main.go | 2 +- shared/types.go | 6 +++-- 11 files changed, 59 insertions(+), 38 deletions(-) diff --git a/agent/agent_unix.go b/agent/agent_unix.go index 0650512..993b446 100644 --- a/agent/agent_unix.go +++ b/agent/agent_unix.go @@ -162,7 +162,7 @@ func NewAgentConfig() *rmm.AgentConfig { return ret } -func (a *Agent) RunScript(code string, shell string, args []string, timeout int) (stdout, stderr string, exitcode int, e error) { +func (a *Agent) RunScript(code string, shell string, args []string, timeout int, runasuser bool) (stdout, stderr string, exitcode int, e error) { code = removeWinNewLines(code) content := []byte(code) @@ -507,7 +507,7 @@ func (a *Agent) installMesh(meshbin, exe, proxy string) (string, error) { return "not implemented", nil } -func CMDShell(shell string, cmdArgs []string, command string, timeout int, detached bool) (output [2]string, e error) { +func CMDShell(shell string, cmdArgs []string, command string, timeout int, detached bool, runasuser bool) (output [2]string, e error) { return [2]string{"", ""}, nil } diff --git a/agent/agent_windows.go b/agent/agent_windows.go index 6637e7b..306b969 100644 --- a/agent/agent_windows.go +++ b/agent/agent_windows.go @@ -30,6 +30,7 @@ import ( rmm "github.com/amidaware/rmmagent/shared" ps "github.com/elastic/go-sysinfo" + "github.com/fourcorelabs/wintoken" "github.com/go-ole/go-ole" "github.com/go-ole/go-ole/oleutil" "github.com/go-resty/resty/v2" @@ -81,7 +82,7 @@ func NewAgentConfig() *rmm.AgentConfig { } } -func (a *Agent) RunScript(code string, shell string, args []string, timeout int) (stdout, stderr string, exitcode int, e error) { +func (a *Agent) RunScript(code string, shell string, args []string, timeout int, runasuser bool) (stdout, stderr string, exitcode int, e error) { content := []byte(code) @@ -143,8 +144,16 @@ func (a *Agent) RunScript(code string, shell string, args []string, timeout int) ctx, cancel := context.WithTimeout(context.Background(), time.Duration(timeout)*time.Second) defer cancel() - var timedOut bool = false + var timedOut = false cmd := exec.Command(exe, cmdArgs...) + if runasuser { + token, err := wintoken.GetInteractiveToken(wintoken.TokenLinked) + if err != nil { + return "", err.Error(), 66, err + } + defer token.Close() + cmd.SysProcAttr = &syscall.SysProcAttr{Token: syscall.Token(token.Token()), HideWindow: true} + } cmd.Stdout = &outb cmd.Stderr = &errb @@ -230,7 +239,7 @@ func CMD(exe string, args []string, timeout int, detached bool) (output [2]strin return [2]string{CleanString(outb.String()), CleanString(errb.String())}, nil } -func CMDShell(shell string, cmdArgs []string, command string, timeout int, detached bool) (output [2]string, e error) { +func CMDShell(shell string, cmdArgs []string, command string, timeout int, detached bool, runasuser bool) (output [2]string, e error) { var ( outb bytes.Buffer errb bytes.Buffer @@ -241,6 +250,8 @@ func CMDShell(shell string, cmdArgs []string, command string, timeout int, detac ctx, cancel := context.WithTimeout(context.Background(), time.Duration(timeout)*time.Second) defer cancel() + sysProcAttr := &windows.SysProcAttr{} + if len(cmdArgs) > 0 && command == "" { switch shell { case "cmd": @@ -254,9 +265,7 @@ func CMDShell(shell string, cmdArgs []string, command string, timeout int, detac switch shell { case "cmd": cmd = exec.Command("cmd.exe") - cmd.SysProcAttr = &windows.SysProcAttr{ - CmdLine: fmt.Sprintf("cmd.exe /C %s", command), - } + sysProcAttr.CmdLine = fmt.Sprintf("cmd.exe /C %s", command) case "powershell": cmd = exec.Command("Powershell", "-NonInteractive", "-NoProfile", command) } @@ -264,10 +273,20 @@ func CMDShell(shell string, cmdArgs []string, command string, timeout int, detac // https://docs.microsoft.com/en-us/windows/win32/procthread/process-creation-flags if detached { - cmd.SysProcAttr = &windows.SysProcAttr{ - CreationFlags: windows.DETACHED_PROCESS | windows.CREATE_NEW_PROCESS_GROUP, - } + sysProcAttr.CreationFlags = windows.DETACHED_PROCESS | windows.CREATE_NEW_PROCESS_GROUP } + + if runasuser { + token, err := wintoken.GetInteractiveToken(wintoken.TokenLinked) + if err != nil { + return [2]string{"", CleanString(err.Error())}, err + } + defer token.Close() + sysProcAttr.Token = syscall.Token(token.Token()) + sysProcAttr.HideWindow = true + } + + cmd.SysProcAttr = sysProcAttr cmd.Stdout = &outb cmd.Stderr = &errb cmd.Start() @@ -449,7 +468,7 @@ func (a *Agent) PlatVer() (string, error) { func EnablePing() { args := make([]string, 0) cmd := `netsh advfirewall firewall add rule name="ICMP Allow incoming V4 echo request" protocol=icmpv4:8,any dir=in action=allow` - _, err := CMDShell("cmd", args, cmd, 10, false) + _, err := CMDShell("cmd", args, cmd, 10, false, false) if err != nil { fmt.Println(err) } @@ -470,7 +489,7 @@ func EnableRDP() { args := make([]string, 0) cmd := `netsh advfirewall firewall set rule group="remote desktop" new enable=Yes` - _, cerr := CMDShell("cmd", args, cmd, 10, false) + _, cerr := CMDShell("cmd", args, cmd, 10, false, false) if cerr != nil { fmt.Println(cerr) } @@ -497,15 +516,15 @@ func DisableSleepHibernate() { wg.Add(1) go func(c string) { defer wg.Done() - _, _ = CMDShell("cmd", args, fmt.Sprintf("powercfg /set%svalueindex scheme_current sub_buttons lidaction 0", c), 5, false) - _, _ = CMDShell("cmd", args, fmt.Sprintf("powercfg /x -standby-timeout-%s 0", c), 5, false) - _, _ = CMDShell("cmd", args, fmt.Sprintf("powercfg /x -hibernate-timeout-%s 0", c), 5, false) - _, _ = CMDShell("cmd", args, fmt.Sprintf("powercfg /x -disk-timeout-%s 0", c), 5, false) - _, _ = CMDShell("cmd", args, fmt.Sprintf("powercfg /x -monitor-timeout-%s 0", c), 5, false) + _, _ = CMDShell("cmd", args, fmt.Sprintf("powercfg /set%svalueindex scheme_current sub_buttons lidaction 0", c), 5, false, false) + _, _ = CMDShell("cmd", args, fmt.Sprintf("powercfg /x -standby-timeout-%s 0", c), 5, false, false) + _, _ = CMDShell("cmd", args, fmt.Sprintf("powercfg /x -hibernate-timeout-%s 0", c), 5, false, false) + _, _ = CMDShell("cmd", args, fmt.Sprintf("powercfg /x -disk-timeout-%s 0", c), 5, false, false) + _, _ = CMDShell("cmd", args, fmt.Sprintf("powercfg /x -monitor-timeout-%s 0", c), 5, false, false) }(i) } wg.Wait() - _, _ = CMDShell("cmd", args, "powercfg -S SCHEME_CURRENT", 5, false) + _, _ = CMDShell("cmd", args, "powercfg -S SCHEME_CURRENT", 5, false, false) } // NewCOMObject creates a new COM object for the specifed ProgramID. @@ -645,7 +664,7 @@ Add-MpPreference -ExclusionPath 'C:\Windows\Temp\tacticalagent-v*.exe' Add-MpPreference -ExclusionPath 'C:\Windows\Temp\trmm\*' Add-MpPreference -ExclusionPath 'C:\Program Files\Mesh Agent\*' ` - _, _, _, err := a.RunScript(code, "powershell", []string{}, 20) + _, _, _, err := a.RunScript(code, "powershell", []string{}, 20, false) if err != nil { a.Logger.Debugln(err) } diff --git a/agent/checks.go b/agent/checks.go index 3fb9ed8..531bf74 100644 --- a/agent/checks.go +++ b/agent/checks.go @@ -169,7 +169,7 @@ type ScriptCheckResult struct { // ScriptCheck runs either bat, powershell or python script func (a *Agent) ScriptCheck(data rmm.Check, r *resty.Client) { start := time.Now() - stdout, stderr, retcode, _ := a.RunScript(data.Script.Code, data.Script.Shell, data.ScriptArgs, data.Timeout) + stdout, stderr, retcode, _ := a.RunScript(data.Script.Code, data.Script.Shell, data.ScriptArgs, data.Timeout, data.Script.RunAsUser) payload := ScriptCheckResult{ ID: data.CheckPK, diff --git a/agent/choco_windows.go b/agent/choco_windows.go index 2d13f3b..c37f025 100644 --- a/agent/choco_windows.go +++ b/agent/choco_windows.go @@ -42,7 +42,7 @@ func (a *Agent) InstallChoco() { return } - _, _, exitcode, err := a.RunScript(string(r.Body()), "powershell", []string{}, 900) + _, _, exitcode, err := a.RunScript(string(r.Body()), "powershell", []string{}, 900, false) if err != nil { a.Logger.Debugln(err) a.rClient.R().SetBody(result).Post(url) diff --git a/agent/rpc.go b/agent/rpc.go index e457ecd..ce2a89c 100644 --- a/agent/rpc.go +++ b/agent/rpc.go @@ -40,6 +40,7 @@ type NatsMsg struct { PatchMgmt bool `json:"patch_mgmt"` ID int `json:"id"` Code string `json:"code"` + RunAsUser bool `json:"run_as_user"` } var ( @@ -177,7 +178,7 @@ func (a *Agent) RunRPC() { switch runtime.GOOS { case "windows": - out, _ := CMDShell(p.Data["shell"], []string{}, p.Data["command"], p.Timeout, false) + out, _ := CMDShell(p.Data["shell"], []string{}, p.Data["command"], p.Timeout, false, p.RunAsUser) a.Logger.Debugln(out) if out[1] != "" { ret.Encode(out[1]) @@ -257,7 +258,7 @@ func (a *Agent) RunRPC() { var resultData rmm.RunScriptResp ret := codec.NewEncoderBytes(&resp, new(codec.MsgpackHandle)) start := time.Now() - stdout, stderr, retcode, err := a.RunScript(p.Data["code"], p.Data["shell"], p.ScriptArgs, p.Timeout) + stdout, stderr, retcode, err := a.RunScript(p.Data["code"], p.Data["shell"], p.ScriptArgs, p.Timeout, p.RunAsUser) resultData.ExecTime = time.Since(start).Seconds() resultData.ID = p.ID @@ -287,7 +288,7 @@ func (a *Agent) RunRPC() { var retData rmm.RunScriptResp ret := codec.NewEncoderBytes(&resp, new(codec.MsgpackHandle)) start := time.Now() - stdout, stderr, retcode, err := a.RunScript(p.Data["code"], p.Data["shell"], p.ScriptArgs, p.Timeout) + stdout, stderr, retcode, err := a.RunScript(p.Data["code"], p.Data["shell"], p.ScriptArgs, p.Timeout, p.RunAsUser) retData.ExecTime = time.Since(start).Seconds() if err != nil { diff --git a/agent/tasks_windows.go b/agent/tasks_windows.go index dabf1a3..da3d7a2 100644 --- a/agent/tasks_windows.go +++ b/agent/tasks_windows.go @@ -59,7 +59,7 @@ func (a *Agent) RunTask(id int) error { action_start := time.Now() if action.ActionType == "script" { - stdout, stderr, retcode, err := a.RunScript(action.Code, action.Shell, action.Args, action.Timeout) + stdout, stderr, retcode, err := a.RunScript(action.Code, action.Shell, action.Args, action.Timeout, action.RunAsUser) if err != nil { a.Logger.Debugln(err) @@ -83,7 +83,7 @@ func (a *Agent) RunTask(id int) error { } else if action.ActionType == "cmd" { // out[0] == stdout, out[1] == stderr - out, err := CMDShell(action.Shell, []string{}, action.Command, action.Timeout, false) + out, err := CMDShell(action.Shell, []string{}, action.Command, action.Timeout, false, action.RunAsUser) if err != nil { a.Logger.Debugln(err) diff --git a/build/setup.iss b/build/setup.iss index 307a3db..470310a 100644 --- a/build/setup.iss +++ b/build/setup.iss @@ -1,5 +1,5 @@ #define MyAppName "Tactical RMM Agent" -#define MyAppVersion "2.1.2" +#define MyAppVersion "2.2.0-dev" #define MyAppPublisher "AmidaWare LLC" #define MyAppURL "https://github.com/amidaware" #define MyAppExeName "tacticalrmm.exe" diff --git a/go.mod b/go.mod index 496cbbf..1b3f190 100644 --- a/go.mod +++ b/go.mod @@ -19,7 +19,7 @@ require ( github.com/wh1te909/go-win64api v0.0.0-20210906074314-ab23795a6ae5 github.com/wh1te909/trmm-shared v0.0.0-20220227075846-f9f757361139 golang.org/x/net v0.0.0-20220706163947-c90051bbdb60 // indirect - golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8 + golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10 ) require ( @@ -28,6 +28,7 @@ require ( ) require ( + github.com/fourcorelabs/wintoken v1.0.0 github.com/jaypipes/ghw v0.9.0 github.com/kardianos/service v1.2.1 github.com/spf13/viper v1.12.0 diff --git a/go.sum b/go.sum index 2402230..a59b705 100644 --- a/go.sum +++ b/go.sum @@ -67,6 +67,8 @@ github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1m github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/fourcorelabs/wintoken v1.0.0 h1:dskUYLAFHNy1cbS5MXsNFXauQzxieTrZlffQZ0Yu19I= +github.com/fourcorelabs/wintoken v1.0.0/go.mod h1:jKyXHt079W09KwEMbUC9g+R2KDs5kVvSKPUiF5p0ejs= github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= @@ -257,8 +259,6 @@ github.com/scjalliance/comshim v0.0.0-20190308082608-cf06d2532c4e h1:+/AzLkOdIXE github.com/scjalliance/comshim v0.0.0-20190308082608-cf06d2532c4e/go.mod h1:9Tc1SKnfACJb9N7cw2eyuI6xzy845G7uZONBsi5uPEA= github.com/shirou/gopsutil/v3 v3.22.6 h1:FnHOFOh+cYAM0C30P+zysPISzlknLC5Z1G4EAElznfQ= github.com/shirou/gopsutil/v3 v3.22.6/go.mod h1:EdIubSnZhbAvBS1yJ7Xi+AShB/hxwLHOMz4MCYz7yMs= -github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE= -github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/spf13/afero v1.8.2 h1:xehSyVa0YnHWsJ49JFljMpg1HX19V6NDZ1fkm1Xznbo= @@ -428,7 +428,6 @@ golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -469,10 +468,9 @@ golang.org/x/sys v0.0.0-20220319134239-a9b59b0215f8/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e h1:CsOuNlbOuf0mzxJIefr6Q4uAUetRUwZE4qt7VfzP+xo= -golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8 h1:0A+M6Uqn+Eje4kHMK80dtF3JCXC4ykBgQG4Fe06QRhQ= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10 h1:WIoqL4EROvwiPdUtaip4VcDdpZ4kha7wBWZrbVKCIZg= +golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= diff --git a/main.go b/main.go index 3ebfb87..20a352a 100644 --- a/main.go +++ b/main.go @@ -25,7 +25,7 @@ import ( ) var ( - version = "2.1.2" + version = "2.2.0-dev" log = logrus.New() logFile *os.File ) diff --git a/shared/types.go b/shared/types.go index 2038f5e..b2cb258 100644 --- a/shared/types.go +++ b/shared/types.go @@ -141,8 +141,9 @@ type AssignedTask struct { } type Script struct { - Shell string `json:"shell"` - Code string `json:"code"` + Shell string `json:"shell"` + Code string `json:"code"` + RunAsUser bool `json:"run_as_user"` } type CheckInfo struct { @@ -188,6 +189,7 @@ type TaskAction struct { Code string `json:"code"` Args []string `json:"script_args"` Timeout int `json:"timeout"` + RunAsUser bool `json:"run_as_user"` } type AutomatedTask struct { From 5bf3ef5356abf0c1010f925c33843e014048b346 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Mon, 1 Aug 2022 10:13:58 -0700 Subject: [PATCH 009/113] bump version --- build/rmm.exe.manifest | 2 +- build/setup.iss | 2 +- main.go | 2 +- versioninfo.json | 12 ++++++------ 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/build/rmm.exe.manifest b/build/rmm.exe.manifest index 2b4d1a7..9554d43 100644 --- a/build/rmm.exe.manifest +++ b/build/rmm.exe.manifest @@ -3,7 +3,7 @@ diff --git a/build/setup.iss b/build/setup.iss index 470310a..3d93d10 100644 --- a/build/setup.iss +++ b/build/setup.iss @@ -1,5 +1,5 @@ #define MyAppName "Tactical RMM Agent" -#define MyAppVersion "2.2.0-dev" +#define MyAppVersion "2.2.0" #define MyAppPublisher "AmidaWare LLC" #define MyAppURL "https://github.com/amidaware" #define MyAppExeName "tacticalrmm.exe" diff --git a/main.go b/main.go index 20a352a..e0a971f 100644 --- a/main.go +++ b/main.go @@ -25,7 +25,7 @@ import ( ) var ( - version = "2.2.0-dev" + version = "2.2.0" log = logrus.New() logFile *os.File ) diff --git a/versioninfo.json b/versioninfo.json index 15121e8..b64f328 100644 --- a/versioninfo.json +++ b/versioninfo.json @@ -2,14 +2,14 @@ "FixedFileInfo": { "FileVersion": { "Major": 2, - "Minor": 1, - "Patch": 2, + "Minor": 2, + "Patch": 0, "Build": 0 }, "ProductVersion": { "Major": 2, - "Minor": 1, - "Patch": 2, + "Minor": 2, + "Patch": 0, "Build": 0 }, "FileFlagsMask": "3f", @@ -22,14 +22,14 @@ "Comments": "", "CompanyName": "AmidaWare LLC", "FileDescription": "Tactical RMM Agent", - "FileVersion": "v2.1.2.0", + "FileVersion": "v2.2.0.0", "InternalName": "tacticalrmm.exe", "LegalCopyright": "Copyright (c) 2022 AmidaWare LLC", "LegalTrademarks": "", "OriginalFilename": "tacticalrmm.exe", "PrivateBuild": "", "ProductName": "Tactical RMM Agent", - "ProductVersion": "v2.1.2.0", + "ProductVersion": "v2.2.0.0", "SpecialBuild": "" }, "VarFileInfo": { From 0c536f13b0cac178ced57c4725ef3b35bf951d4b Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Mon, 1 Aug 2022 15:42:01 -0700 Subject: [PATCH 010/113] fix wrong token type --- agent/agent_windows.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/agent/agent_windows.go b/agent/agent_windows.go index 306b969..a3dd2f5 100644 --- a/agent/agent_windows.go +++ b/agent/agent_windows.go @@ -147,7 +147,7 @@ func (a *Agent) RunScript(code string, shell string, args []string, timeout int, var timedOut = false cmd := exec.Command(exe, cmdArgs...) if runasuser { - token, err := wintoken.GetInteractiveToken(wintoken.TokenLinked) + token, err := wintoken.GetInteractiveToken(wintoken.TokenImpersonation) if err != nil { return "", err.Error(), 66, err } @@ -277,7 +277,7 @@ func CMDShell(shell string, cmdArgs []string, command string, timeout int, detac } if runasuser { - token, err := wintoken.GetInteractiveToken(wintoken.TokenLinked) + token, err := wintoken.GetInteractiveToken(wintoken.TokenImpersonation) if err != nil { return [2]string{"", CleanString(err.Error())}, err } From adee74ffd05d80aa5e9192108318e35cc442e84e Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Mon, 1 Aug 2022 15:42:28 -0700 Subject: [PATCH 011/113] bump version --- build/rmm.exe.manifest | 2 +- build/setup.iss | 2 +- main.go | 2 +- versioninfo.json | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/build/rmm.exe.manifest b/build/rmm.exe.manifest index 9554d43..3ce8a05 100644 --- a/build/rmm.exe.manifest +++ b/build/rmm.exe.manifest @@ -3,7 +3,7 @@ diff --git a/build/setup.iss b/build/setup.iss index 3d93d10..9f236b9 100644 --- a/build/setup.iss +++ b/build/setup.iss @@ -1,5 +1,5 @@ #define MyAppName "Tactical RMM Agent" -#define MyAppVersion "2.2.0" +#define MyAppVersion "2.2.1" #define MyAppPublisher "AmidaWare LLC" #define MyAppURL "https://github.com/amidaware" #define MyAppExeName "tacticalrmm.exe" diff --git a/main.go b/main.go index e0a971f..eb2e193 100644 --- a/main.go +++ b/main.go @@ -25,7 +25,7 @@ import ( ) var ( - version = "2.2.0" + version = "2.2.1" log = logrus.New() logFile *os.File ) diff --git a/versioninfo.json b/versioninfo.json index b64f328..d993149 100644 --- a/versioninfo.json +++ b/versioninfo.json @@ -3,13 +3,13 @@ "FileVersion": { "Major": 2, "Minor": 2, - "Patch": 0, + "Patch": 1, "Build": 0 }, "ProductVersion": { "Major": 2, "Minor": 2, - "Patch": 0, + "Patch": 1, "Build": 0 }, "FileFlagsMask": "3f", @@ -22,14 +22,14 @@ "Comments": "", "CompanyName": "AmidaWare LLC", "FileDescription": "Tactical RMM Agent", - "FileVersion": "v2.2.0.0", + "FileVersion": "v2.2.1.0", "InternalName": "tacticalrmm.exe", "LegalCopyright": "Copyright (c) 2022 AmidaWare LLC", "LegalTrademarks": "", "OriginalFilename": "tacticalrmm.exe", "PrivateBuild": "", "ProductName": "Tactical RMM Agent", - "ProductVersion": "v2.2.0.0", + "ProductVersion": "v2.2.1.0", "SpecialBuild": "" }, "VarFileInfo": { From 381f9696ebfe1e1665c982d7f9344c1d044bf36a Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Mon, 8 Aug 2022 23:07:34 +0000 Subject: [PATCH 012/113] fix agent update when selinux is enforcing fixes amidaware/tacticalrmm#1239 --- agent/agent_unix.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/agent/agent_unix.go b/agent/agent_unix.go index 993b446..9d23590 100644 --- a/agent/agent_unix.go +++ b/agent/agent_unix.go @@ -209,6 +209,13 @@ func SetDetached() *syscall.SysProcAttr { return &syscall.SysProcAttr{Setpgid: true} } +func (a *Agent) seEnforcing() bool { + opts := a.NewCMDOpts() + opts.Command = "getenforce" + out := a.CmdV2(opts) + return out.Status.Exit == 0 && strings.Contains(out.Stdout, "Enforcing") +} + func (a *Agent) AgentUpdate(url, inno, version string) { self, err := os.Executable() @@ -276,6 +283,13 @@ func (a *Agent) AgentUpdate(url, inno, version string) { } } + if a.seEnforcing() { + se := a.NewCMDOpts() + se.Command = fmt.Sprintf("restorecon -rv %s", self) + out := a.CmdV2(se) + a.Logger.Debugln("%+v\n", out) + } + opts := a.NewCMDOpts() opts.Detached = true opts.Command = "systemctl restart tacticalagent.service" From 41597d7d26cb84c577fe14fab33c0c9c724c300c Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Tue, 9 Aug 2022 10:33:30 -0700 Subject: [PATCH 013/113] standardize windows temp dir fixes amidaware/tacticalrmm#1238 --- agent/agent.go | 71 +++++++++++++++++++----------------------- agent/agent_windows.go | 31 +++++++----------- agent/install.go | 7 +++-- agent/svc.go | 5 ++- 4 files changed, 53 insertions(+), 61 deletions(-) diff --git a/agent/agent.go b/agent/agent.go index 2e465e0..e7ae4a9 100644 --- a/agent/agent.go +++ b/agent/agent.go @@ -78,6 +78,8 @@ const ( meshSvcName = "mesh agent" ) +var winTempDir = filepath.Join(os.Getenv("PROGRAMDATA"), "TacticalRMM") +var winMeshDir = filepath.Join(os.Getenv("PROGRAMFILES"), "Mesh Agent") var natsCheckin = []string{"agent-hello", "agent-agentinfo", "agent-disks", "agent-winsvc", "agent-publicip", "agent-wmi"} func New(logger *logrus.Logger, version string) *Agent { @@ -402,50 +404,42 @@ func (a *Agent) GetUninstallExe() string { } func (a *Agent) CleanupAgentUpdates() { - cderr := os.Chdir(a.ProgramDir) - if cderr != nil { - a.Logger.Errorln(cderr) - return - } + // TODO remove a.ProgramDir, updates are now in winTempDir + dirs := [2]string{winTempDir, a.ProgramDir} + for _, dir := range dirs { + err := os.Chdir(dir) + if err != nil { + a.Logger.Debugln("CleanupAgentUpdates()", dir, err) + continue + } - // winagent-v* is deprecated - files, err := filepath.Glob("winagent-v*.exe") - if err == nil { - for _, f := range files { - os.Remove(f) + // TODO winagent-v* is deprecated + globs := [2]string{"tacticalagent-v*", "winagent-v*"} + for _, glob := range globs { + files, err := filepath.Glob(glob) + if err == nil { + for _, f := range files { + a.Logger.Debugln("CleanupAgentUpdates() Removing file:", f) + os.Remove(f) + } + } } } - agents, err := filepath.Glob("tacticalagent-v*.exe") + err := os.Chdir(os.Getenv("TMP")) if err == nil { - for _, f := range agents { - os.Remove(f) - } - } - - cderr = os.Chdir(os.Getenv("TMP")) - if cderr != nil { - a.Logger.Errorln(cderr) - return - } - folders, err := filepath.Glob("tacticalrmm*") - if err == nil { - for _, f := range folders { - os.RemoveAll(f) + dirs, err := filepath.Glob("tacticalrmm*") + if err == nil { + for _, f := range dirs { + os.RemoveAll(f) + } } } } func (a *Agent) RunPythonCode(code string, timeout int, args []string) (string, error) { content := []byte(code) - dir, err := ioutil.TempDir("", "tacticalpy") - if err != nil { - a.Logger.Debugln(err) - return "", err - } - defer os.RemoveAll(dir) - - tmpfn, _ := ioutil.TempFile(dir, "*.py") + tmpfn, _ := ioutil.TempFile(winTempDir, "*.py") if _, err := tmpfn.Write(content); err != nil { a.Logger.Debugln(err) return "", err @@ -489,13 +483,12 @@ func (a *Agent) RunPythonCode(code string, timeout int, args []string) (string, } -func (a *Agent) CreateTRMMTempDir() { - // create the temp dir for running scripts - dir := filepath.Join(os.TempDir(), "trmm") - if !trmm.FileExists(dir) { - err := os.Mkdir(dir, 0775) +func createWinTempDir() error { + if !trmm.FileExists(winTempDir) { + err := os.Mkdir(winTempDir, 0775) if err != nil { - a.Logger.Errorln(err) + return err } } + return nil } diff --git a/agent/agent_windows.go b/agent/agent_windows.go index a3dd2f5..6b3ab87 100644 --- a/agent/agent_windows.go +++ b/agent/agent_windows.go @@ -86,9 +86,10 @@ func (a *Agent) RunScript(code string, shell string, args []string, timeout int, content := []byte(code) - dir := filepath.Join(os.TempDir(), "trmm") - if !trmm.FileExists(dir) { - a.CreateTRMMTempDir() + err := createWinTempDir() + if err != nil { + a.Logger.Errorln(err) + return "", err.Error(), 85, err } const defaultExitCode = 1 @@ -110,7 +111,7 @@ func (a *Agent) RunScript(code string, shell string, args []string, timeout int, ext = "*.bat" } - tmpfn, err := ioutil.TempFile(dir, ext) + tmpfn, err := ioutil.TempFile(winTempDir, ext) if err != nil { a.Logger.Errorln(err) return "", err.Error(), 85, err @@ -581,8 +582,9 @@ func (a *Agent) UninstallCleanup() { func (a *Agent) AgentUpdate(url, inno, version string) { time.Sleep(time.Duration(randRange(1, 15)) * time.Second) a.KillHungUpdates() + time.Sleep(1 * time.Second) a.CleanupAgentUpdates() - updater := filepath.Join(a.ProgramDir, inno) + updater := filepath.Join(winTempDir, inno) a.Logger.Infof("Agent updating from %s to %s", a.Version, version) a.Logger.Debugln("Downloading agent update from", url) @@ -605,14 +607,7 @@ func (a *Agent) AgentUpdate(url, inno, version string) { return } - dir, err := ioutil.TempDir("", "tacticalrmm") - if err != nil { - a.Logger.Errorln("Agentupdate create tempdir:", err) - CMD("net", []string{"start", winSvcName}, 10, false) - return - } - - innoLogFile := filepath.Join(dir, "tacticalrmm.txt") + innoLogFile := filepath.Join(winTempDir, fmt.Sprintf("tacticalagent_update_v%s.txt", version)) args := []string{"/C", updater, "/VERYSILENT", fmt.Sprintf("/LOG=%s", innoLogFile)} cmd := exec.Command("cmd.exe", args...) @@ -658,12 +653,10 @@ func (a *Agent) AgentUninstall(code string) { } func (a *Agent) addDefenderExlusions() { - code := ` -Add-MpPreference -ExclusionPath 'C:\Program Files\TacticalAgent\*' -Add-MpPreference -ExclusionPath 'C:\Windows\Temp\tacticalagent-v*.exe' -Add-MpPreference -ExclusionPath 'C:\Windows\Temp\trmm\*' -Add-MpPreference -ExclusionPath 'C:\Program Files\Mesh Agent\*' -` + code := fmt.Sprintf(` +Add-MpPreference -ExclusionPath '%s\*' +Add-MpPreference -ExclusionPath '%s\*' +`, winTempDir, winMeshDir) _, _, _, err := a.RunScript(code, "powershell", []string{}, 20, false) if err != nil { a.Logger.Debugln(err) diff --git a/agent/install.go b/agent/install.go index a975581..b03518c 100644 --- a/agent/install.go +++ b/agent/install.go @@ -224,13 +224,16 @@ func (a *Agent) Install(i *Installer) { a.SendSoftware() a.Logger.Debugln("Creating temp dir") - a.CreateTRMMTempDir() + err := createWinTempDir() + if err != nil { + a.Logger.Errorln("Install() createWinTempDir():", err) + } a.Logger.Debugln("Disabling automatic windows updates") a.PatchMgmnt(true) a.Logger.Infoln("Installing service...") - err := a.InstallService() + err = a.InstallService() if err != nil { a.installerMsg(err.Error(), "error", i.Silent) } diff --git a/agent/svc.go b/agent/svc.go index e360ebf..4ca85c2 100644 --- a/agent/svc.go +++ b/agent/svc.go @@ -29,7 +29,10 @@ func (a *Agent) RunAsService() { func (a *Agent) AgentSvc() { go a.GetPython(false) - a.CreateTRMMTempDir() + err := createWinTempDir() + if err != nil { + a.Logger.Errorln("AgentSvc() createWinTempDir():", err) + } a.RunMigrations() sleepDelay := randRange(14, 22) From 607a5283acf7d90aea20e40b987ca0ae3f751036 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Tue, 9 Aug 2022 12:40:42 -0700 Subject: [PATCH 014/113] add helper func to get env --- main.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/main.go b/main.go index eb2e193..2c71b43 100644 --- a/main.go +++ b/main.go @@ -85,6 +85,8 @@ func main() { a.Logger.Debugf("%+v\n", a) switch *mode { + case "getenv": + fmt.Println(os.Getenv(flag.Arg(0))) case "nixmeshnodeid": fmt.Print(a.NixMeshNodeID()) case "installsvc": From 662c41794b34f59ed357183d2bd57cace090ae9c Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Tue, 9 Aug 2022 12:41:07 -0700 Subject: [PATCH 015/113] better cleanup --- agent/agent.go | 1 + agent/agent_windows.go | 1 + 2 files changed, 2 insertions(+) diff --git a/agent/agent.go b/agent/agent.go index e7ae4a9..84f1889 100644 --- a/agent/agent.go +++ b/agent/agent.go @@ -444,6 +444,7 @@ func (a *Agent) RunPythonCode(code string, timeout int, args []string) (string, a.Logger.Debugln(err) return "", err } + defer os.Remove(tmpfn.Name()) if err := tmpfn.Close(); err != nil { a.Logger.Debugln(err) return "", err diff --git a/agent/agent_windows.go b/agent/agent_windows.go index 6b3ab87..e99af6b 100644 --- a/agent/agent_windows.go +++ b/agent/agent_windows.go @@ -577,6 +577,7 @@ func (a *Agent) UninstallCleanup() { a.PatchMgmnt(false) a.CleanupAgentUpdates() CleanupSchedTasks() + os.RemoveAll(winTempDir) } func (a *Agent) AgentUpdate(url, inno, version string) { From 7b8d524a8135741e243c735d21a1e96d5dff8344 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Tue, 9 Aug 2022 13:07:25 -0700 Subject: [PATCH 016/113] still need program files --- agent/agent_windows.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/agent/agent_windows.go b/agent/agent_windows.go index e99af6b..00e489c 100644 --- a/agent/agent_windows.go +++ b/agent/agent_windows.go @@ -657,7 +657,8 @@ func (a *Agent) addDefenderExlusions() { code := fmt.Sprintf(` Add-MpPreference -ExclusionPath '%s\*' Add-MpPreference -ExclusionPath '%s\*' -`, winTempDir, winMeshDir) +Add-MpPreference -ExclusionPath '%s\*' +`, winTempDir, a.ProgramDir, winMeshDir) _, _, _, err := a.RunScript(code, "powershell", []string{}, 20, false) if err != nil { a.Logger.Debugln(err) From 89d7ec8242811b3cbe0f5f425b597c1ef8458175 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Tue, 9 Aug 2022 13:17:02 -0700 Subject: [PATCH 017/113] bump versions --- build/rmm.exe.manifest | 2 +- build/setup.iss | 2 +- main.go | 2 +- versioninfo.json | 12 ++++++------ 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/build/rmm.exe.manifest b/build/rmm.exe.manifest index 3ce8a05..df6fc51 100644 --- a/build/rmm.exe.manifest +++ b/build/rmm.exe.manifest @@ -3,7 +3,7 @@ diff --git a/build/setup.iss b/build/setup.iss index 9f236b9..cae5a3e 100644 --- a/build/setup.iss +++ b/build/setup.iss @@ -1,5 +1,5 @@ #define MyAppName "Tactical RMM Agent" -#define MyAppVersion "2.2.1" +#define MyAppVersion "2.3.0" #define MyAppPublisher "AmidaWare LLC" #define MyAppURL "https://github.com/amidaware" #define MyAppExeName "tacticalrmm.exe" diff --git a/main.go b/main.go index 2c71b43..21f4d6e 100644 --- a/main.go +++ b/main.go @@ -25,7 +25,7 @@ import ( ) var ( - version = "2.2.1" + version = "2.3.0" log = logrus.New() logFile *os.File ) diff --git a/versioninfo.json b/versioninfo.json index d993149..b7064a2 100644 --- a/versioninfo.json +++ b/versioninfo.json @@ -2,14 +2,14 @@ "FixedFileInfo": { "FileVersion": { "Major": 2, - "Minor": 2, - "Patch": 1, + "Minor": 3, + "Patch": 0, "Build": 0 }, "ProductVersion": { "Major": 2, - "Minor": 2, - "Patch": 1, + "Minor": 3, + "Patch": 0, "Build": 0 }, "FileFlagsMask": "3f", @@ -22,14 +22,14 @@ "Comments": "", "CompanyName": "AmidaWare LLC", "FileDescription": "Tactical RMM Agent", - "FileVersion": "v2.2.1.0", + "FileVersion": "v2.3.0.0", "InternalName": "tacticalrmm.exe", "LegalCopyright": "Copyright (c) 2022 AmidaWare LLC", "LegalTrademarks": "", "OriginalFilename": "tacticalrmm.exe", "PrivateBuild": "", "ProductName": "Tactical RMM Agent", - "ProductVersion": "v2.2.1.0", + "ProductVersion": "v2.3.0.0", "SpecialBuild": "" }, "VarFileInfo": { From b21929d044c58fb58ce7e9c036f586ab393e9d93 Mon Sep 17 00:00:00 2001 From: redanthrax Date: Tue, 23 Aug 2022 13:55:25 -0700 Subject: [PATCH 018/113] added mesh location to agent --- agent/agent.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/agent/agent.go b/agent/agent.go index 84f1889..4f0f8e8 100644 --- a/agent/agent.go +++ b/agent/agent.go @@ -130,6 +130,10 @@ func New(logger *logrus.Logger, version string) *Agent { MeshSysExe = "/opt/tacticalmesh/meshagent" } + if runtime.GOOS == "darwin" { + MeshSysExe = "/usr/local/mesh_services/meshagent/meshagent_osx64" + } + svcConf := &service.Config{ Executable: exe, Name: winSvcName, From e8c743c19794dfabb7adefc1ae4e16fb3ad12897 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Sun, 11 Sep 2022 01:34:04 +0000 Subject: [PATCH 019/113] add env to exec --- agent/agent.go | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/agent/agent.go b/agent/agent.go index 84f1889..c28d945 100644 --- a/agent/agent.go +++ b/agent/agent.go @@ -205,6 +205,7 @@ type CmdOptions struct { IsScript bool IsExecutable bool Detached bool + Env []string } func (a *Agent) NewCMDOpts() *CmdOptions { @@ -228,11 +229,16 @@ func (a *Agent) CmdV2(c *CmdOptions) CmdStatus { // have a child process that is in a different process group so that // parent terminating doesn't kill child if c.Detached { - cmdOptions.BeforeExec = []func(cmd *exec.Cmd){ - func(cmd *exec.Cmd) { - cmd.SysProcAttr = SetDetached() - }, - } + cmdOptions.BeforeExec = append(cmdOptions.BeforeExec, func(cmd *exec.Cmd) { + cmd.SysProcAttr = SetDetached() + }) + } + + if len(c.Env) > 0 { + cmdOptions.BeforeExec = append(cmdOptions.BeforeExec, func(cmd *exec.Cmd) { + cmd.Env = os.Environ() + cmd.Env = append(cmd.Env, c.Env...) + }) } var envCmd *gocmd.Cmd From af040d18eec11f3040a195f1e53008a491c880c8 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Sun, 11 Sep 2022 19:57:01 +0000 Subject: [PATCH 020/113] update deps --- go.mod | 20 +++++++++----------- go.sum | 48 +++++++++++++++++++++++------------------------- 2 files changed, 32 insertions(+), 36 deletions(-) diff --git a/go.mod b/go.mod index 1b3f190..0c5f760 100644 --- a/go.mod +++ b/go.mod @@ -10,16 +10,16 @@ require ( github.com/go-resty/resty/v2 v2.7.0 github.com/gonutz/w32/v2 v2.4.0 github.com/iamacarpet/go-win64api v0.0.0-20220531131246-e84054eb584d - github.com/nats-io/nats-server/v2 v2.8.4 // indirect - github.com/nats-io/nats.go v1.16.0 + github.com/nats-io/nats-server/v2 v2.9.0 // indirect + github.com/nats-io/nats.go v1.16.1-0.20220906180156-a1017eec10b0 github.com/rickb777/date v1.19.1 - github.com/shirou/gopsutil/v3 v3.22.6 + github.com/shirou/gopsutil/v3 v3.22.8 github.com/sirupsen/logrus v1.9.0 github.com/ugorji/go/codec v1.2.7 github.com/wh1te909/go-win64api v0.0.0-20210906074314-ab23795a6ae5 github.com/wh1te909/trmm-shared v0.0.0-20220227075846-f9f757361139 golang.org/x/net v0.0.0-20220706163947-c90051bbdb60 // indirect - golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10 + golang.org/x/sys v0.0.0-20220906135438-9e1f76180b77 ) require ( @@ -31,7 +31,7 @@ require ( github.com/fourcorelabs/wintoken v1.0.0 github.com/jaypipes/ghw v0.9.0 github.com/kardianos/service v1.2.1 - github.com/spf13/viper v1.12.0 + github.com/spf13/viper v1.13.0 ) require ( @@ -44,7 +44,6 @@ require ( github.com/hashicorp/hcl v1.0.0 // indirect github.com/jaypipes/pcidb v1.0.0 // indirect github.com/joeshaw/multierror v0.0.0-20140124173710-69b34d4ec901 // indirect - github.com/klauspost/compress v1.15.6 // indirect github.com/lufia/plan9stats v0.0.0-20220517141722-cf486979b281 // indirect github.com/magiconair/properties v1.8.6 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect @@ -53,7 +52,7 @@ require ( github.com/nats-io/nuid v1.0.1 // indirect github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d // indirect github.com/pelletier/go-toml v1.9.5 // indirect - github.com/pelletier/go-toml/v2 v2.0.1 // indirect + github.com/pelletier/go-toml/v2 v2.0.5 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c // indirect github.com/prometheus/procfs v0.7.3 // indirect @@ -64,16 +63,15 @@ require ( github.com/spf13/cast v1.5.0 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect - github.com/subosito/gotenv v1.4.0 // indirect + github.com/subosito/gotenv v1.4.1 // indirect github.com/tklauser/go-sysconf v0.3.10 // indirect github.com/tklauser/numcpus v0.5.0 // indirect github.com/yusufpapurcu/wmi v1.2.2 // indirect - golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e // indirect + golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90 // indirect golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f // indirect golang.org/x/text v0.3.7 // indirect - golang.org/x/time v0.0.0-20220411224347-583f2d630306 // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect - gopkg.in/ini.v1 v1.66.6 // indirect + gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/toast.v1 v1.0.0-20180812000517-0a84660828b2 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/go.sum b/go.sum index a59b705..96c88a6 100644 --- a/go.sum +++ b/go.sum @@ -191,8 +191,7 @@ github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/X github.com/kardianos/service v1.2.1 h1:AYndMsehS+ywIS6RB9KOlcXzteWUzxgMgBymJD7+BYk= github.com/kardianos/service v1.2.1/go.mod h1:CIMRFEJVL+0DS1a3Nx06NaMn4Dz63Ng6O7dl0qH0zVM= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.15.6 h1:6D9PcO8QWu0JyaQ2zUMmu16T1T+zjjEpP91guRsvDfY= -github.com/klauspost/compress v1.15.6/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU= +github.com/klauspost/compress v1.15.9 h1:wKRjX6JRtDdrE9qwa4b/Cip7ACOshUI4smpCQanqjSY= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= @@ -211,11 +210,11 @@ github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/nats-io/jwt/v2 v2.2.1-0.20220330180145-442af02fd36a h1:lem6QCvxR0Y28gth9P+wV2K/zYUUAkJ+55U8cpS0p5I= -github.com/nats-io/nats-server/v2 v2.8.4 h1:0jQzze1T9mECg8YZEl8+WYUXb9JKluJfCBriPUtluB4= -github.com/nats-io/nats-server/v2 v2.8.4/go.mod h1:8zZa+Al3WsESfmgSs98Fi06dRWLH5Bnq90m5bKD/eT4= -github.com/nats-io/nats.go v1.16.0 h1:zvLE7fGBQYW6MWaFaRdsgm9qT39PJDQoju+DS8KsO1g= -github.com/nats-io/nats.go v1.16.0/go.mod h1:BPko4oXsySz4aSWeFgOHLZs3G4Jq4ZAyE6/zMCxRT6w= +github.com/nats-io/jwt/v2 v2.3.0 h1:z2mA1a7tIf5ShggOFlR1oBPgd6hGqcDYsISxZByUzdI= +github.com/nats-io/nats-server/v2 v2.9.0 h1:DLWu+7/VgGOoChcDKytnUZPAmudpv7o/MhKmNrnH1RE= +github.com/nats-io/nats-server/v2 v2.9.0/go.mod h1:BWKY6217RvhI+FDoOLZ2BH+hOC37xeKRBlQ1Lz7teKI= +github.com/nats-io/nats.go v1.16.1-0.20220906180156-a1017eec10b0 h1:dPUKD6Iv8M1y9MU8PK6H4a4/12yx5/CbaYWz/Z1arY8= +github.com/nats-io/nats.go v1.16.1-0.20220906180156-a1017eec10b0/go.mod h1:BPko4oXsySz4aSWeFgOHLZs3G4Jq4ZAyE6/zMCxRT6w= github.com/nats-io/nkeys v0.3.0 h1:cgM5tL53EvYRU+2YLXIK0G2mJtK12Ft9oeooSZMA2G8= github.com/nats-io/nkeys v0.3.0/go.mod h1:gvUNGjVcM2IPr5rCsRsC6Wb3Hr2CQAm08dsxtV6A5y4= github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw= @@ -230,8 +229,8 @@ github.com/onsi/gomega v1.10.2/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1y github.com/onsi/gomega v1.19.0 h1:4ieX6qQjPP/BfC3mpsAtIGGlxTWPeA3Inl/7DtXw1tw= github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8= github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= -github.com/pelletier/go-toml/v2 v2.0.1 h1:8e3L2cCQzLFi2CR4g7vGFuFxX7Jl1kKX8gW+iV0GUKU= -github.com/pelletier/go-toml/v2 v2.0.1/go.mod h1:r9LEWfGN8R5k0VXJ+0BkIe7MYkRdwZOjgMj2KwnJFUo= +github.com/pelletier/go-toml/v2 v2.0.5 h1:ipoSadvV8oGUjnUbMub59IDPPwfxF694nG/jwbMiyQg= +github.com/pelletier/go-toml/v2 v2.0.5/go.mod h1:OMHamSCAODeSsVrwwvcJOaoN0LIUIaFVNZzmWyNfXas= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -257,8 +256,8 @@ github.com/rogpeppe/go-internal v1.8.1 h1:geMPLpDpQOgVyCg5z5GoRwLHepNdb71NXb67XF github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= github.com/scjalliance/comshim v0.0.0-20190308082608-cf06d2532c4e h1:+/AzLkOdIXEPrAQtwAeWOBnPQ0BnYlBW0aCZmSb47u4= github.com/scjalliance/comshim v0.0.0-20190308082608-cf06d2532c4e/go.mod h1:9Tc1SKnfACJb9N7cw2eyuI6xzy845G7uZONBsi5uPEA= -github.com/shirou/gopsutil/v3 v3.22.6 h1:FnHOFOh+cYAM0C30P+zysPISzlknLC5Z1G4EAElznfQ= -github.com/shirou/gopsutil/v3 v3.22.6/go.mod h1:EdIubSnZhbAvBS1yJ7Xi+AShB/hxwLHOMz4MCYz7yMs= +github.com/shirou/gopsutil/v3 v3.22.8 h1:a4s3hXogo5mE2PfdfJIonDbstO/P+9JszdfhAHSzD9Y= +github.com/shirou/gopsutil/v3 v3.22.8/go.mod h1:s648gW4IywYzUfE/KjXxUsqrqx/T2xO5VqOXxONeRfI= github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/spf13/afero v1.8.2 h1:xehSyVa0YnHWsJ49JFljMpg1HX19V6NDZ1fkm1Xznbo= @@ -271,8 +270,8 @@ github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0 github.com/spf13/pflag v1.0.2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/viper v1.12.0 h1:CZ7eSOd3kZoaYDLbXnmzgQI5RlciuXBMA+18HwHRfZQ= -github.com/spf13/viper v1.12.0/go.mod h1:b6COn30jlNxbm/V2IqWiNWkJ+vZNiMNksliPCiuKtSI= +github.com/spf13/viper v1.13.0 h1:BWSJ/M+f+3nmdz9bxB+bWX28kkALN2ok11D0rSo8EJU= +github.com/spf13/viper v1.13.0/go.mod h1:Icm2xNL3/8uyh/wFuB1jI7TiTNKp8632Nwegu+zgdYw= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= @@ -281,10 +280,10 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.5 h1:s5PTfem8p8EbKQOctVV53k6jCJt3UX4IEJzwh+C324Q= -github.com/stretchr/testify v1.7.5/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/subosito/gotenv v1.4.0 h1:yAzM1+SmVcz5R4tXGsNMu1jUl2aOJXoiWUCEwwnGrvs= -github.com/subosito/gotenv v1.4.0/go.mod h1:mZd6rFysKEcUhUHXJk0C/08wAgyDBFuwEYL7vWWGaGo= +github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/subosito/gotenv v1.4.1 h1:jyEFiXpy21Wm81FBN71l9VoMMV8H8jG+qIK3GCpY6Qs= +github.com/subosito/gotenv v1.4.1/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= github.com/tklauser/go-sysconf v0.3.10 h1:IJ1AZGZRWbY8T5Vfk04D9WOA5WSejdflXxP03OUqALw= github.com/tklauser/go-sysconf v0.3.10/go.mod h1:C8XykCvCb+Gn0oNCWPIlcb0RuglQTYaQ2hGm7jmxEFk= github.com/tklauser/numcpus v0.4.0/go.mod h1:1+UI3pD8NW14VMwdgJNJ1ESk2UnwhAnz5hMwiKKqXCQ= @@ -317,8 +316,8 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20210314154223-e6e6c4f2bb5b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e h1:T8NU3HyQ8ClP4SEE+KbFlg6n0NhuTsN4MyznaarGsZM= -golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90 h1:Y/gsMcFOcR+6S6f3YeMKl5g+dZMEWqcz5Czj/GWYbkM= +golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -469,8 +468,8 @@ golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10 h1:WIoqL4EROvwiPdUtaip4VcDdpZ4kha7wBWZrbVKCIZg= -golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220906135438-9e1f76180b77 h1:C1tElbkWrsSkn3IRl1GCW/gETw1TywWIPgwZtXTZbYg= +golang.org/x/sys v0.0.0-20220906135438-9e1f76180b77/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -484,8 +483,7 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20220411224347-583f2d630306 h1:+gHMid33q6pen7kv9xvT+JRinntgeXO2AeZVd0AWD3w= -golang.org/x/time v0.0.0-20220411224347-583f2d630306/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20220722155302-e5dcc9cfc0b9 h1:ftMN5LMiBFjbzleLqtoBZk7KdJwhuybIU+FckUHgoyQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= @@ -632,8 +630,8 @@ gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntN gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/ini.v1 v1.66.6 h1:LATuAqN/shcYAOkv3wl2L4rkaKqkcgTBQjOyYDvcPKI= -gopkg.in/ini.v1 v1.66.6/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= +gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/toast.v1 v1.0.0-20180812000517-0a84660828b2 h1:MZF6J7CV6s/h0HBkfqebrYfKCVEo5iN+wzE4QhV3Evo= gopkg.in/toast.v1 v1.0.0-20180812000517-0a84660828b2/go.mod h1:s1Sn2yZos05Qfs7NKt867Xe18emOmtsO3eAKbDaon0o= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= From f746f78c639209fd832691f2d29e5c4ee65c923f Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Sun, 11 Sep 2022 22:58:48 -0700 Subject: [PATCH 021/113] bump versions --- build/rmm.exe.manifest | 2 +- build/setup.iss | 2 +- main.go | 2 +- versioninfo.json | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/build/rmm.exe.manifest b/build/rmm.exe.manifest index df6fc51..14c032d 100644 --- a/build/rmm.exe.manifest +++ b/build/rmm.exe.manifest @@ -3,7 +3,7 @@ diff --git a/build/setup.iss b/build/setup.iss index cae5a3e..bc559ac 100644 --- a/build/setup.iss +++ b/build/setup.iss @@ -1,5 +1,5 @@ #define MyAppName "Tactical RMM Agent" -#define MyAppVersion "2.3.0" +#define MyAppVersion "2.3.1" #define MyAppPublisher "AmidaWare LLC" #define MyAppURL "https://github.com/amidaware" #define MyAppExeName "tacticalrmm.exe" diff --git a/main.go b/main.go index 21f4d6e..d629a4d 100644 --- a/main.go +++ b/main.go @@ -25,7 +25,7 @@ import ( ) var ( - version = "2.3.0" + version = "2.3.1" log = logrus.New() logFile *os.File ) diff --git a/versioninfo.json b/versioninfo.json index b7064a2..0f64bcc 100644 --- a/versioninfo.json +++ b/versioninfo.json @@ -3,13 +3,13 @@ "FileVersion": { "Major": 2, "Minor": 3, - "Patch": 0, + "Patch": 1, "Build": 0 }, "ProductVersion": { "Major": 2, "Minor": 3, - "Patch": 0, + "Patch": 1, "Build": 0 }, "FileFlagsMask": "3f", @@ -22,14 +22,14 @@ "Comments": "", "CompanyName": "AmidaWare LLC", "FileDescription": "Tactical RMM Agent", - "FileVersion": "v2.3.0.0", + "FileVersion": "v2.3.1.0", "InternalName": "tacticalrmm.exe", "LegalCopyright": "Copyright (c) 2022 AmidaWare LLC", "LegalTrademarks": "", "OriginalFilename": "tacticalrmm.exe", "PrivateBuild": "", "ProductName": "Tactical RMM Agent", - "ProductVersion": "v2.3.0.0", + "ProductVersion": "v2.3.1.0", "SpecialBuild": "" }, "VarFileInfo": { From e0cfb7c90e6015bf771edb86afeb5e2aba0ff3b5 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Thu, 15 Sep 2022 18:36:55 -0700 Subject: [PATCH 022/113] remove defender exclusions --- agent/agent_windows.go | 12 ------------ agent/install.go | 3 --- agent/install_unix.go | 2 -- main.go | 2 +- 4 files changed, 1 insertion(+), 18 deletions(-) diff --git a/agent/agent_windows.go b/agent/agent_windows.go index 00e489c..26cb7b6 100644 --- a/agent/agent_windows.go +++ b/agent/agent_windows.go @@ -653,18 +653,6 @@ func (a *Agent) AgentUninstall(code string) { cmd.Start() } -func (a *Agent) addDefenderExlusions() { - code := fmt.Sprintf(` -Add-MpPreference -ExclusionPath '%s\*' -Add-MpPreference -ExclusionPath '%s\*' -Add-MpPreference -ExclusionPath '%s\*' -`, winTempDir, a.ProgramDir, winMeshDir) - _, _, _, err := a.RunScript(code, "powershell", []string{}, 20, false) - if err != nil { - a.Logger.Debugln(err) - } -} - // RunMigrations cleans up unused stuff from older agents func (a *Agent) RunMigrations() { for _, i := range []string{"nssm.exe", "nssm-x86.exe"} { diff --git a/agent/install.go b/agent/install.go index b03518c..228aa3b 100644 --- a/agent/install.go +++ b/agent/install.go @@ -245,9 +245,6 @@ func (a *Agent) Install(i *Installer) { a.installerMsg(out.ErrorMsg, "error", i.Silent) } - a.Logger.Infoln("Adding windows defender exclusions") - a.addDefenderExlusions() - if i.Power { a.Logger.Infoln("Disabling sleep/hibernate...") DisableSleepHibernate() diff --git a/agent/install_unix.go b/agent/install_unix.go index cf6a068..60cb7f1 100644 --- a/agent/install_unix.go +++ b/agent/install_unix.go @@ -51,8 +51,6 @@ func createAgentConfig(baseurl, agentid, apiurl, token, agentpk, cert, proxy, me } } -func (a *Agent) addDefenderExlusions() {} - func DisableSleepHibernate() {} func EnablePing() {} diff --git a/main.go b/main.go index d629a4d..eea4af3 100644 --- a/main.go +++ b/main.go @@ -25,7 +25,7 @@ import ( ) var ( - version = "2.3.1" + version = "2.4.0-dev" log = logrus.New() logFile *os.File ) From 852dfee29fdf8d3ae36695b3e7233a8bcf1414a2 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Fri, 23 Sep 2022 16:05:17 -0700 Subject: [PATCH 023/113] mac agent --- agent/agent.go | 29 ++++++++------ agent/agent_unix.go | 39 ++++++++++++++---- agent/install.go | 92 ++++++++++++++++++++++++++++++++++++------- agent/install_unix.go | 36 ++++++++++++++--- agent/svc.go | 17 +++++--- main.go | 2 +- 6 files changed, 170 insertions(+), 45 deletions(-) diff --git a/agent/agent.go b/agent/agent.go index 9b3cf8f..2fb9fd7 100644 --- a/agent/agent.go +++ b/agent/agent.go @@ -76,6 +76,12 @@ const ( winExeName = "tacticalrmm.exe" winSvcName = "tacticalrmm" meshSvcName = "mesh agent" + etcConfig = "/etc/tacticalagent" + nixAgentDir = "/opt/tacticalagent" + nixAgentBin = nixAgentDir + "/tacticalagent" + macPlistPath = "/Library/LaunchDaemons/tacticalagent.plist" + macPlistName = "tacticalagent" + macMeshSvcDir = "/usr/local/mesh_services" ) var winTempDir = filepath.Join(os.Getenv("PROGRAMDATA"), "TacticalRMM") @@ -120,18 +126,19 @@ func New(logger *logrus.Logger, version string) *Agent { } var MeshSysExe string - if len(ac.CustomMeshDir) > 0 { - MeshSysExe = filepath.Join(ac.CustomMeshDir, "MeshAgent.exe") - } else { - MeshSysExe = filepath.Join(os.Getenv("ProgramFiles"), "Mesh Agent", "MeshAgent.exe") - } - - if runtime.GOOS == "linux" { + switch runtime.GOOS { + case "windows": + if len(ac.CustomMeshDir) > 0 { + MeshSysExe = filepath.Join(ac.CustomMeshDir, "MeshAgent.exe") + } else { + MeshSysExe = filepath.Join(os.Getenv("ProgramFiles"), "Mesh Agent", "MeshAgent.exe") + } + case "linux": + MeshSysExe = "/opt/tacticalmesh/meshagent" + case "darwin": + MeshSysExe = "/usr/local/mesh_services/meshagent/meshagent" + default: MeshSysExe = "/opt/tacticalmesh/meshagent" - } - - if runtime.GOOS == "darwin" { - MeshSysExe = "/usr/local/mesh_services/meshagent/meshagent_osx64" } svcConf := &service.Config{ diff --git a/agent/agent_unix.go b/agent/agent_unix.go index 9d23590..f33a307 100644 --- a/agent/agent_unix.go +++ b/agent/agent_unix.go @@ -50,7 +50,7 @@ func (a *Agent) GetDisks() []trmm.Disk { } for _, p := range partitions { - if strings.Contains(p.Device, "dev/loop") { + if strings.Contains(p.Device, "dev/loop") || strings.Contains(p.Device, "devfs") { continue } usage, err := disk.Usage(p.Mountpoint) @@ -283,7 +283,7 @@ func (a *Agent) AgentUpdate(url, inno, version string) { } } - if a.seEnforcing() { + if runtime.GOOS == "linux" && a.seEnforcing() { se := a.NewCMDOpts() se.Command = fmt.Sprintf("restorecon -rv %s", self) out := a.CmdV2(se) @@ -292,7 +292,15 @@ func (a *Agent) AgentUpdate(url, inno, version string) { opts := a.NewCMDOpts() opts.Detached = true - opts.Command = "systemctl restart tacticalagent.service" + switch runtime.GOOS { + case "linux": + opts.Command = "systemctl restart tacticalagent.service" + case "darwin": + opts.Command = "launchctl kickstart -k system/tacticalagent" + default: + return + } + a.CmdV2(opts) } @@ -310,7 +318,9 @@ func (a *Agent) AgentUninstall(code string) { opts := a.NewCMDOpts() opts.IsScript = true opts.Shell = f.Name() - opts.Args = []string{"uninstall"} + if runtime.GOOS == "linux" { + opts.Args = []string{"uninstall"} + } opts.Detached = true a.CmdV2(opts) } @@ -354,7 +364,15 @@ func (a *Agent) getMeshNodeID() (string, error) { func (a *Agent) RecoverMesh() { a.Logger.Infoln("Attempting mesh recovery") opts := a.NewCMDOpts() - opts.Command = "systemctl restart meshagent.service" + def := "systemctl restart meshagent.service" + switch runtime.GOOS { + case "linux": + opts.Command = def + case "darwin": + opts.Command = "launchctl kickstart -k system/meshagent" + default: + opts.Command = def + } a.CmdV2(opts) a.SyncMeshNodeID() } @@ -413,18 +431,25 @@ func (a *Agent) GetWMIInfo() map[string]interface{} { wmiInfo["make_model"] = "" chassis, err := ghw.Chassis(ghw.WithDisableWarnings()) if err != nil { - a.Logger.Errorln("ghw.Chassis()", err) + a.Logger.Debugln("ghw.Chassis()", err) } else { if chassis.Vendor != "" || chassis.Version != "" { wmiInfo["make_model"] = fmt.Sprintf("%s %s", chassis.Vendor, chassis.Version) } } + if runtime.GOOS == "darwin" { + opts := a.NewCMDOpts() + opts.Command = "sysctl hw.model" + out := a.CmdV2(opts) + wmiInfo["make_model"] = strings.ReplaceAll(out.Stdout, "hw.model: ", "") + } + // gfx cards gpu, err := ghw.GPU(ghw.WithDisableWarnings()) if err != nil { - a.Logger.Errorln("ghw.GPU()", err) + a.Logger.Debugln("ghw.GPU()", err) } else { for _, i := range gpu.GraphicsCards { if i.DeviceInfo != nil { diff --git a/agent/install.go b/agent/install.go index 228aa3b..1cd45e4 100644 --- a/agent/install.go +++ b/agent/install.go @@ -140,34 +140,57 @@ func (a *Agent) Install(i *Installer) { installerMeshSystemEXE = a.MeshSystemEXE } - var meshNodeID string + var meshNodeID, meshOutput string - if runtime.GOOS == "windows" && !i.NoMesh { - mesh := filepath.Join(a.ProgramDir, a.MeshInstaller) - if i.LocalMesh == "" { + if !i.NoMesh && runtime.GOOS != "linux" { + switch runtime.GOOS { + case "windows": + meshOutput = filepath.Join(a.ProgramDir, a.MeshInstaller) + case "darwin": + tmp, err := createTmpFile() + if err != nil { + a.Logger.Fatalln("Failed to create mesh temp file", err) + } + meshOutput = tmp.Name() + os.Chmod(meshOutput, 0755) + defer os.Remove(meshOutput) + defer os.Remove(meshOutput + ".msh") + } + + if runtime.GOOS == "windows" && i.LocalMesh != "" { + err := copyFile(i.LocalMesh, meshOutput) + if err != nil { + a.installerMsg(err.Error(), "error", i.Silent) + } + } else { a.Logger.Infoln("Downloading mesh agent...") payload := map[string]string{"goarch": a.GoArch, "plat": a.Platform} - r, err := rClient.R().SetBody(payload).SetOutput(mesh).Post(fmt.Sprintf("%s/api/v3/meshexe/", baseURL)) + r, err := rClient.R().SetBody(payload).SetOutput(meshOutput).Post(fmt.Sprintf("%s/api/v3/meshexe/", baseURL)) if err != nil { a.installerMsg(fmt.Sprintf("Failed to download mesh agent: %s", err.Error()), "error", i.Silent) } if r.StatusCode() != 200 { a.installerMsg(fmt.Sprintf("Unable to download the mesh agent from the RMM. %s", r.String()), "error", i.Silent) } - } else { - err := copyFile(i.LocalMesh, mesh) - if err != nil { - a.installerMsg(err.Error(), "error", i.Silent) - } } a.Logger.Infoln("Installing mesh agent...") - a.Logger.Debugln("Mesh agent:", mesh) + a.Logger.Debugln("Mesh agent:", meshOutput) time.Sleep(1 * time.Second) - meshNodeID, err = a.installMesh(mesh, installerMeshSystemEXE, i.Proxy) - if err != nil { - a.installerMsg(fmt.Sprintf("Failed to install mesh agent: %s", err.Error()), "error", i.Silent) + if runtime.GOOS == "windows" { + meshNodeID, err = a.installMesh(meshOutput, installerMeshSystemEXE, i.Proxy) + if err != nil { + a.installerMsg(fmt.Sprintf("Failed to install mesh agent: %s", err.Error()), "error", i.Silent) + } + } else { + opts := a.NewCMDOpts() + opts.Command = fmt.Sprintf("%s -install", meshOutput) + out := a.CmdV2(opts) + if out.Status.Exit != 0 { + a.Logger.Fatalln("Error installing mesh agent:", out.Stderr) + } + fmt.Println(out.Stdout) } } @@ -219,6 +242,47 @@ func (a *Agent) Install(i *Installer) { // check in once a.DoNatsCheckIn() + if runtime.GOOS == "darwin" { + os.MkdirAll(nixAgentDir, 0755) + self, _ := os.Executable() + copyFile(self, nixAgentBin) + os.Chmod(nixAgentBin, 0755) + svc := fmt.Sprintf(` + + + + + Label + %s + + ServiceDescription + TacticalAgent Service + + ProgramArguments + + %s + -m + svc + + + WorkingDirectory + %s/ + + RunAtLoad + + + KeepAlive + + + +`, macPlistName, nixAgentBin, nixAgentDir) + + os.WriteFile(macPlistPath, []byte(svc), 0644) + opts := a.NewCMDOpts() + opts.Command = fmt.Sprintf("launchctl bootstrap system %s", macPlistPath) + a.CmdV2(opts) + } + if runtime.GOOS == "windows" { // send software api a.SendSoftware() diff --git a/agent/install_unix.go b/agent/install_unix.go index 60cb7f1..56f5f8f 100644 --- a/agent/install_unix.go +++ b/agent/install_unix.go @@ -15,17 +15,16 @@ https://license.tacticalrmm.com package agent import ( + "fmt" "log" + "os" + "runtime" + "time" "github.com/spf13/viper" + trmm "github.com/wh1te909/trmm-shared" ) -const ( - etcConfig = "/etc/tacticalagent" -) - -func (a *Agent) checkExistingAndRemove(silent bool) {} - func (a *Agent) installerMsg(msg, alert string, silent bool) { if alert == "error" { a.Logger.Fatalln(msg) @@ -51,6 +50,31 @@ func createAgentConfig(baseurl, agentid, apiurl, token, agentpk, cert, proxy, me } } +func (a *Agent) checkExistingAndRemove(silent bool) { + if runtime.GOOS == "darwin" { + if trmm.FileExists(a.MeshSystemEXE) { + a.Logger.Infoln("Existing meshagent found, attempting to remove...") + uopts := a.NewCMDOpts() + uopts.Command = fmt.Sprintf("%s -fulluninstall", a.MeshSystemEXE) + uout := a.CmdV2(uopts) + fmt.Println(uout.Stdout) + time.Sleep(1 * time.Second) + } + + if trmm.FileExists(macPlistPath) { + a.Logger.Infoln("Existing tacticalagent plist found, attempting to remove...") + opts := a.NewCMDOpts() + opts.Command = fmt.Sprintf("launchctl bootout system %s", macPlistPath) + a.CmdV2(opts) + } + + os.RemoveAll(macMeshSvcDir) + os.Remove(etcConfig) + os.RemoveAll(nixAgentDir) + os.Remove(macPlistPath) + } +} + func DisableSleepHibernate() {} func EnablePing() {} diff --git a/agent/svc.go b/agent/svc.go index 4ca85c2..e695ffd 100644 --- a/agent/svc.go +++ b/agent/svc.go @@ -12,6 +12,7 @@ https://license.tacticalrmm.com package agent import ( + "runtime" "sync" "time" @@ -27,11 +28,13 @@ func (a *Agent) RunAsService() { } func (a *Agent) AgentSvc() { - go a.GetPython(false) + if runtime.GOOS == "windows" { + go a.GetPython(false) - err := createWinTempDir() - if err != nil { - a.Logger.Errorln("AgentSvc() createWinTempDir():", err) + err := createWinTempDir() + if err != nil { + a.Logger.Errorln("AgentSvc() createWinTempDir():", err) + } } a.RunMigrations() @@ -53,8 +56,10 @@ func (a *Agent) AgentSvc() { go a.SyncMeshNodeID() time.Sleep(time.Duration(randRange(1, 3)) * time.Second) - a.AgentStartup() - a.SendSoftware() + if runtime.GOOS == "windows" { + a.AgentStartup() + a.SendSoftware() + } checkInHelloTicker := time.NewTicker(time.Duration(randRange(30, 60)) * time.Second) checkInAgentInfoTicker := time.NewTicker(time.Duration(randRange(200, 400)) * time.Second) diff --git a/main.go b/main.go index eea4af3..ea597e7 100644 --- a/main.go +++ b/main.go @@ -185,7 +185,7 @@ func setupLogging(level, to *string) { switch runtime.GOOS { case "windows": logFile, _ = os.OpenFile(filepath.Join(os.Getenv("ProgramFiles"), "TacticalAgent", "agent.log"), os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0664) - case "linux": + default: logFile, _ = os.OpenFile(filepath.Join("/var/log/", "tacticalagent.log"), os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0664) } log.SetOutput(logFile) From cd93ec12fab11e50bfa4ff5eb953cbf611af4561 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Fri, 23 Sep 2022 23:30:23 +0000 Subject: [PATCH 024/113] update reqs --- go.mod | 8 ++++---- go.sum | 20 ++++++++++---------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/go.mod b/go.mod index 0c5f760..db11b33 100644 --- a/go.mod +++ b/go.mod @@ -10,8 +10,8 @@ require ( github.com/go-resty/resty/v2 v2.7.0 github.com/gonutz/w32/v2 v2.4.0 github.com/iamacarpet/go-win64api v0.0.0-20220531131246-e84054eb584d - github.com/nats-io/nats-server/v2 v2.9.0 // indirect - github.com/nats-io/nats.go v1.16.1-0.20220906180156-a1017eec10b0 + github.com/nats-io/nats-server/v2 v2.9.1 // indirect + github.com/nats-io/nats.go v1.17.0 github.com/rickb777/date v1.19.1 github.com/shirou/gopsutil/v3 v3.22.8 github.com/sirupsen/logrus v1.9.0 @@ -19,7 +19,7 @@ require ( github.com/wh1te909/go-win64api v0.0.0-20210906074314-ab23795a6ae5 github.com/wh1te909/trmm-shared v0.0.0-20220227075846-f9f757361139 golang.org/x/net v0.0.0-20220706163947-c90051bbdb60 // indirect - golang.org/x/sys v0.0.0-20220906135438-9e1f76180b77 + golang.org/x/sys v0.0.0-20220919091848-fb04ddd9f9c8 ) require ( @@ -67,7 +67,7 @@ require ( github.com/tklauser/go-sysconf v0.3.10 // indirect github.com/tklauser/numcpus v0.5.0 // indirect github.com/yusufpapurcu/wmi v1.2.2 // indirect - golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90 // indirect + golang.org/x/crypto v0.0.0-20220919173607-35f4265a4bc0 // indirect golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f // indirect golang.org/x/text v0.3.7 // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect diff --git a/go.sum b/go.sum index 96c88a6..0b46d51 100644 --- a/go.sum +++ b/go.sum @@ -191,7 +191,7 @@ github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/X github.com/kardianos/service v1.2.1 h1:AYndMsehS+ywIS6RB9KOlcXzteWUzxgMgBymJD7+BYk= github.com/kardianos/service v1.2.1/go.mod h1:CIMRFEJVL+0DS1a3Nx06NaMn4Dz63Ng6O7dl0qH0zVM= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.15.9 h1:wKRjX6JRtDdrE9qwa4b/Cip7ACOshUI4smpCQanqjSY= +github.com/klauspost/compress v1.15.10 h1:Ai8UzuomSCDw90e1qNMtb15msBXsNpH6gzkkENQNcJo= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= @@ -211,10 +211,10 @@ github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrk github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/nats-io/jwt/v2 v2.3.0 h1:z2mA1a7tIf5ShggOFlR1oBPgd6hGqcDYsISxZByUzdI= -github.com/nats-io/nats-server/v2 v2.9.0 h1:DLWu+7/VgGOoChcDKytnUZPAmudpv7o/MhKmNrnH1RE= -github.com/nats-io/nats-server/v2 v2.9.0/go.mod h1:BWKY6217RvhI+FDoOLZ2BH+hOC37xeKRBlQ1Lz7teKI= -github.com/nats-io/nats.go v1.16.1-0.20220906180156-a1017eec10b0 h1:dPUKD6Iv8M1y9MU8PK6H4a4/12yx5/CbaYWz/Z1arY8= -github.com/nats-io/nats.go v1.16.1-0.20220906180156-a1017eec10b0/go.mod h1:BPko4oXsySz4aSWeFgOHLZs3G4Jq4ZAyE6/zMCxRT6w= +github.com/nats-io/nats-server/v2 v2.9.1 h1:JaP6NpCVmSu0AXgbnOkGtJovOxuf8mjNjlX3H+tSpyI= +github.com/nats-io/nats-server/v2 v2.9.1/go.mod h1:T5AEyzrnDGaseK/Y0G6e2IA5tLrHyjLOeGUALq+A8XE= +github.com/nats-io/nats.go v1.17.0 h1:1jp5BThsdGlN91hW0k3YEfJbfACjiOYtUiLXG0RL4IE= +github.com/nats-io/nats.go v1.17.0/go.mod h1:BPko4oXsySz4aSWeFgOHLZs3G4Jq4ZAyE6/zMCxRT6w= github.com/nats-io/nkeys v0.3.0 h1:cgM5tL53EvYRU+2YLXIK0G2mJtK12Ft9oeooSZMA2G8= github.com/nats-io/nkeys v0.3.0/go.mod h1:gvUNGjVcM2IPr5rCsRsC6Wb3Hr2CQAm08dsxtV6A5y4= github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw= @@ -316,8 +316,8 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20210314154223-e6e6c4f2bb5b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90 h1:Y/gsMcFOcR+6S6f3YeMKl5g+dZMEWqcz5Czj/GWYbkM= -golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20220919173607-35f4265a4bc0 h1:a5Yg6ylndHHYJqIPrdq0AhvR6KTvDTAvgBtaidhEevY= +golang.org/x/crypto v0.0.0-20220919173607-35f4265a4bc0/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -468,8 +468,8 @@ golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220906135438-9e1f76180b77 h1:C1tElbkWrsSkn3IRl1GCW/gETw1TywWIPgwZtXTZbYg= -golang.org/x/sys v0.0.0-20220906135438-9e1f76180b77/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220919091848-fb04ddd9f9c8 h1:h+EGohizhe9XlX18rfpa8k8RAc5XyaeamM+0VHRd4lc= +golang.org/x/sys v0.0.0-20220919091848-fb04ddd9f9c8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -483,7 +483,7 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20220722155302-e5dcc9cfc0b9 h1:ftMN5LMiBFjbzleLqtoBZk7KdJwhuybIU+FckUHgoyQ= +golang.org/x/time v0.0.0-20220920022843-2ce7c2934d45 h1:yuLAip3bfURHClMG9VBdzPrQvCWjWiWUTBGV+/fCbUs= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= From 43d13a78f21f25c8898c754d51b5cf24dd0292da Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Fri, 23 Sep 2022 19:16:43 -0700 Subject: [PATCH 025/113] bump version --- build/rmm.exe.manifest | 2 +- build/setup.iss | 2 +- main.go | 2 +- versioninfo.json | 12 ++++++------ 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/build/rmm.exe.manifest b/build/rmm.exe.manifest index 14c032d..2053207 100644 --- a/build/rmm.exe.manifest +++ b/build/rmm.exe.manifest @@ -3,7 +3,7 @@ diff --git a/build/setup.iss b/build/setup.iss index bc559ac..03671e2 100644 --- a/build/setup.iss +++ b/build/setup.iss @@ -1,5 +1,5 @@ #define MyAppName "Tactical RMM Agent" -#define MyAppVersion "2.3.1" +#define MyAppVersion "2.4.0" #define MyAppPublisher "AmidaWare LLC" #define MyAppURL "https://github.com/amidaware" #define MyAppExeName "tacticalrmm.exe" diff --git a/main.go b/main.go index ea597e7..21fa89f 100644 --- a/main.go +++ b/main.go @@ -25,7 +25,7 @@ import ( ) var ( - version = "2.4.0-dev" + version = "2.4.0" log = logrus.New() logFile *os.File ) diff --git a/versioninfo.json b/versioninfo.json index 0f64bcc..b985ad4 100644 --- a/versioninfo.json +++ b/versioninfo.json @@ -2,14 +2,14 @@ "FixedFileInfo": { "FileVersion": { "Major": 2, - "Minor": 3, - "Patch": 1, + "Minor": 4, + "Patch": 0, "Build": 0 }, "ProductVersion": { "Major": 2, - "Minor": 3, - "Patch": 1, + "Minor": 4, + "Patch": 0, "Build": 0 }, "FileFlagsMask": "3f", @@ -22,14 +22,14 @@ "Comments": "", "CompanyName": "AmidaWare LLC", "FileDescription": "Tactical RMM Agent", - "FileVersion": "v2.3.1.0", + "FileVersion": "v2.4.0.0", "InternalName": "tacticalrmm.exe", "LegalCopyright": "Copyright (c) 2022 AmidaWare LLC", "LegalTrademarks": "", "OriginalFilename": "tacticalrmm.exe", "PrivateBuild": "", "ProductName": "Tactical RMM Agent", - "ProductVersion": "v2.3.1.0", + "ProductVersion": "v2.4.0.0", "SpecialBuild": "" }, "VarFileInfo": { From 56d2356db2e28eb90a3157cda1664641ada20edd Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Wed, 19 Oct 2022 12:37:47 -0700 Subject: [PATCH 026/113] update reqs --- go.mod | 10 +++++----- go.sum | 24 ++++++++++++------------ 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/go.mod b/go.mod index db11b33..7ca658e 100644 --- a/go.mod +++ b/go.mod @@ -10,8 +10,8 @@ require ( github.com/go-resty/resty/v2 v2.7.0 github.com/gonutz/w32/v2 v2.4.0 github.com/iamacarpet/go-win64api v0.0.0-20220531131246-e84054eb584d - github.com/nats-io/nats-server/v2 v2.9.1 // indirect - github.com/nats-io/nats.go v1.17.0 + github.com/nats-io/nats-server/v2 v2.9.3 // indirect + github.com/nats-io/nats.go v1.18.0 github.com/rickb777/date v1.19.1 github.com/shirou/gopsutil/v3 v3.22.8 github.com/sirupsen/logrus v1.9.0 @@ -19,7 +19,7 @@ require ( github.com/wh1te909/go-win64api v0.0.0-20210906074314-ab23795a6ae5 github.com/wh1te909/trmm-shared v0.0.0-20220227075846-f9f757361139 golang.org/x/net v0.0.0-20220706163947-c90051bbdb60 // indirect - golang.org/x/sys v0.0.0-20220919091848-fb04ddd9f9c8 + golang.org/x/sys v0.0.0-20220928140112-f11e5e49a4ec ) require ( @@ -30,7 +30,7 @@ require ( require ( github.com/fourcorelabs/wintoken v1.0.0 github.com/jaypipes/ghw v0.9.0 - github.com/kardianos/service v1.2.1 + github.com/kardianos/service v1.2.2 github.com/spf13/viper v1.13.0 ) @@ -67,7 +67,7 @@ require ( github.com/tklauser/go-sysconf v0.3.10 // indirect github.com/tklauser/numcpus v0.5.0 // indirect github.com/yusufpapurcu/wmi v1.2.2 // indirect - golang.org/x/crypto v0.0.0-20220919173607-35f4265a4bc0 // indirect + golang.org/x/crypto v0.0.0-20220926161630-eccd6366d1be // indirect golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f // indirect golang.org/x/text v0.3.7 // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect diff --git a/go.sum b/go.sum index 0b46d51..d35e090 100644 --- a/go.sum +++ b/go.sum @@ -188,10 +188,10 @@ github.com/joeshaw/multierror v0.0.0-20140124173710-69b34d4ec901 h1:rp+c0RAYOWj8 github.com/joeshaw/multierror v0.0.0-20140124173710-69b34d4ec901/go.mod h1:Z86h9688Y0wesXCyonoVr47MasHilkuLMqGhRZ4Hpak= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= -github.com/kardianos/service v1.2.1 h1:AYndMsehS+ywIS6RB9KOlcXzteWUzxgMgBymJD7+BYk= -github.com/kardianos/service v1.2.1/go.mod h1:CIMRFEJVL+0DS1a3Nx06NaMn4Dz63Ng6O7dl0qH0zVM= +github.com/kardianos/service v1.2.2 h1:ZvePhAHfvo0A7Mftk/tEzqEZ7Q4lgnR8sGz4xu1YX60= +github.com/kardianos/service v1.2.2/go.mod h1:CIMRFEJVL+0DS1a3Nx06NaMn4Dz63Ng6O7dl0qH0zVM= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.15.10 h1:Ai8UzuomSCDw90e1qNMtb15msBXsNpH6gzkkENQNcJo= +github.com/klauspost/compress v1.15.11 h1:Lcadnb3RKGin4FYM/orgq0qde+nc15E5Cbqg4B9Sx9c= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= @@ -211,10 +211,10 @@ github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrk github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/nats-io/jwt/v2 v2.3.0 h1:z2mA1a7tIf5ShggOFlR1oBPgd6hGqcDYsISxZByUzdI= -github.com/nats-io/nats-server/v2 v2.9.1 h1:JaP6NpCVmSu0AXgbnOkGtJovOxuf8mjNjlX3H+tSpyI= -github.com/nats-io/nats-server/v2 v2.9.1/go.mod h1:T5AEyzrnDGaseK/Y0G6e2IA5tLrHyjLOeGUALq+A8XE= -github.com/nats-io/nats.go v1.17.0 h1:1jp5BThsdGlN91hW0k3YEfJbfACjiOYtUiLXG0RL4IE= -github.com/nats-io/nats.go v1.17.0/go.mod h1:BPko4oXsySz4aSWeFgOHLZs3G4Jq4ZAyE6/zMCxRT6w= +github.com/nats-io/nats-server/v2 v2.9.3 h1:HrfzA7G9LNetKkm1z+jU/e9kuAe+E6uaBuuq9EB5sQQ= +github.com/nats-io/nats-server/v2 v2.9.3/go.mod h1:4sq8wvrpbvSzL1n3ZfEYnH4qeUuIl5W990j3kw13rRk= +github.com/nats-io/nats.go v1.18.0 h1:o480Ao6kuSSFyJO75rGTXCEPj7LGkY84C1Ye+Uhm4c0= +github.com/nats-io/nats.go v1.18.0/go.mod h1:BPko4oXsySz4aSWeFgOHLZs3G4Jq4ZAyE6/zMCxRT6w= github.com/nats-io/nkeys v0.3.0 h1:cgM5tL53EvYRU+2YLXIK0G2mJtK12Ft9oeooSZMA2G8= github.com/nats-io/nkeys v0.3.0/go.mod h1:gvUNGjVcM2IPr5rCsRsC6Wb3Hr2CQAm08dsxtV6A5y4= github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw= @@ -316,8 +316,8 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20210314154223-e6e6c4f2bb5b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20220919173607-35f4265a4bc0 h1:a5Yg6ylndHHYJqIPrdq0AhvR6KTvDTAvgBtaidhEevY= -golang.org/x/crypto v0.0.0-20220919173607-35f4265a4bc0/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20220926161630-eccd6366d1be h1:fmw3UbQh+nxngCAHrDCCztao/kbYFnWjoqop8dHx05A= +golang.org/x/crypto v0.0.0-20220926161630-eccd6366d1be/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -468,8 +468,8 @@ golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220919091848-fb04ddd9f9c8 h1:h+EGohizhe9XlX18rfpa8k8RAc5XyaeamM+0VHRd4lc= -golang.org/x/sys v0.0.0-20220919091848-fb04ddd9f9c8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220928140112-f11e5e49a4ec h1:BkDtF2Ih9xZ7le9ndzTA7KJow28VbQW3odyk/8drmuI= +golang.org/x/sys v0.0.0-20220928140112-f11e5e49a4ec/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -483,7 +483,7 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20220920022843-2ce7c2934d45 h1:yuLAip3bfURHClMG9VBdzPrQvCWjWiWUTBGV+/fCbUs= +golang.org/x/time v0.0.0-20220922220347-f3bd1da661af h1:Yx9k8YCG3dvF87UAn2tu2HQLf2dt/eR1bXxpLMWeH+Y= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= From 16df03678cba645e94c1641cfa5c2756973d579c Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Mon, 24 Oct 2022 19:33:38 -0700 Subject: [PATCH 027/113] update reqs --- go.mod | 2 +- go.sum | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 7ca658e..cf912c8 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( github.com/nats-io/nats-server/v2 v2.9.3 // indirect github.com/nats-io/nats.go v1.18.0 github.com/rickb777/date v1.19.1 - github.com/shirou/gopsutil/v3 v3.22.8 + github.com/shirou/gopsutil/v3 v3.22.9 github.com/sirupsen/logrus v1.9.0 github.com/ugorji/go/codec v1.2.7 github.com/wh1te909/go-win64api v0.0.0-20210906074314-ab23795a6ae5 diff --git a/go.sum b/go.sum index d35e090..6723895 100644 --- a/go.sum +++ b/go.sum @@ -140,8 +140,9 @@ github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/logger v1.1.0/go.mod h1:w7O8nrRr0xufejBlQMI83MXqRusvREoJdaAxV+CoAB4= github.com/google/logger v1.1.1/go.mod h1:BkeJZ+1FhQ+/d087r4dzojEg1u2ZX+ZqG1jTUrLM+zQ= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= @@ -256,8 +257,8 @@ github.com/rogpeppe/go-internal v1.8.1 h1:geMPLpDpQOgVyCg5z5GoRwLHepNdb71NXb67XF github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= github.com/scjalliance/comshim v0.0.0-20190308082608-cf06d2532c4e h1:+/AzLkOdIXEPrAQtwAeWOBnPQ0BnYlBW0aCZmSb47u4= github.com/scjalliance/comshim v0.0.0-20190308082608-cf06d2532c4e/go.mod h1:9Tc1SKnfACJb9N7cw2eyuI6xzy845G7uZONBsi5uPEA= -github.com/shirou/gopsutil/v3 v3.22.8 h1:a4s3hXogo5mE2PfdfJIonDbstO/P+9JszdfhAHSzD9Y= -github.com/shirou/gopsutil/v3 v3.22.8/go.mod h1:s648gW4IywYzUfE/KjXxUsqrqx/T2xO5VqOXxONeRfI= +github.com/shirou/gopsutil/v3 v3.22.9 h1:yibtJhIVEMcdw+tCTbOPiF1VcsuDeTE4utJ8Dm4c5eA= +github.com/shirou/gopsutil/v3 v3.22.9/go.mod h1:bBYl1kjgEJpWpxeHmLI+dVHWtyAwfcmSBLDsp2TNT8A= github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/spf13/afero v1.8.2 h1:xehSyVa0YnHWsJ49JFljMpg1HX19V6NDZ1fkm1Xznbo= From 552d63ea6e017891429412761fafcd75c643cacb Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Tue, 25 Oct 2022 11:34:44 -0700 Subject: [PATCH 028/113] update mesh installpath --- agent/agent.go | 32 ++++++++++++++++++-------------- agent/install.go | 2 +- agent/install_unix.go | 3 ++- main.go | 2 +- 4 files changed, 22 insertions(+), 17 deletions(-) diff --git a/agent/agent.go b/agent/agent.go index 2fb9fd7..d6d7a91 100644 --- a/agent/agent.go +++ b/agent/agent.go @@ -72,16 +72,18 @@ type Agent struct { } const ( - progFilesName = "TacticalAgent" - winExeName = "tacticalrmm.exe" - winSvcName = "tacticalrmm" - meshSvcName = "mesh agent" - etcConfig = "/etc/tacticalagent" - nixAgentDir = "/opt/tacticalagent" - nixAgentBin = nixAgentDir + "/tacticalagent" - macPlistPath = "/Library/LaunchDaemons/tacticalagent.plist" - macPlistName = "tacticalagent" - macMeshSvcDir = "/usr/local/mesh_services" + progFilesName = "TacticalAgent" + winExeName = "tacticalrmm.exe" + winSvcName = "tacticalrmm" + meshSvcName = "mesh agent" + etcConfig = "/etc/tacticalagent" + nixAgentDir = "/opt/tacticalagent" + nixMeshDir = "/opt/tacticalmesh" + nixAgentBin = nixAgentDir + "/tacticalagent" + nixMeshAgentBin = nixMeshDir + "/meshagent" + macPlistPath = "/Library/LaunchDaemons/tacticalagent.plist" + macPlistName = "tacticalagent" + defaultMacMeshSvcDir = "/usr/local/mesh_services" ) var winTempDir = filepath.Join(os.Getenv("PROGRAMDATA"), "TacticalRMM") @@ -133,12 +135,14 @@ func New(logger *logrus.Logger, version string) *Agent { } else { MeshSysExe = filepath.Join(os.Getenv("ProgramFiles"), "Mesh Agent", "MeshAgent.exe") } - case "linux": - MeshSysExe = "/opt/tacticalmesh/meshagent" case "darwin": - MeshSysExe = "/usr/local/mesh_services/meshagent/meshagent" + if trmm.FileExists(nixMeshAgentBin) { + MeshSysExe = nixMeshAgentBin + } else { + MeshSysExe = "/usr/local/mesh_services/meshagent/meshagent" + } default: - MeshSysExe = "/opt/tacticalmesh/meshagent" + MeshSysExe = nixMeshAgentBin } svcConf := &service.Config{ diff --git a/agent/install.go b/agent/install.go index 1cd45e4..16562fc 100644 --- a/agent/install.go +++ b/agent/install.go @@ -185,7 +185,7 @@ func (a *Agent) Install(i *Installer) { } } else { opts := a.NewCMDOpts() - opts.Command = fmt.Sprintf("%s -install", meshOutput) + opts.Command = fmt.Sprintf("%s -install --installPath=%s", meshOutput, nixMeshDir) out := a.CmdV2(opts) if out.Status.Exit != 0 { a.Logger.Fatalln("Error installing mesh agent:", out.Stderr) diff --git a/agent/install_unix.go b/agent/install_unix.go index 56f5f8f..1c9ba5d 100644 --- a/agent/install_unix.go +++ b/agent/install_unix.go @@ -68,7 +68,8 @@ func (a *Agent) checkExistingAndRemove(silent bool) { a.CmdV2(opts) } - os.RemoveAll(macMeshSvcDir) + os.RemoveAll(defaultMacMeshSvcDir) + os.RemoveAll(nixMeshDir) os.Remove(etcConfig) os.RemoveAll(nixAgentDir) os.Remove(macPlistPath) diff --git a/main.go b/main.go index 21fa89f..9ebf099 100644 --- a/main.go +++ b/main.go @@ -25,7 +25,7 @@ import ( ) var ( - version = "2.4.0" + version = "2.4.1-dev" log = logrus.New() logFile *os.File ) From 935d5d8ab8e3b8ccca4345298348c0600c475e71 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Tue, 25 Oct 2022 14:47:42 -0700 Subject: [PATCH 029/113] bump version --- build/rmm.exe.manifest | 2 +- build/setup.iss | 2 +- main.go | 2 +- versioninfo.json | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/build/rmm.exe.manifest b/build/rmm.exe.manifest index 2053207..7b92d4e 100644 --- a/build/rmm.exe.manifest +++ b/build/rmm.exe.manifest @@ -3,7 +3,7 @@ diff --git a/build/setup.iss b/build/setup.iss index 03671e2..d8e8b58 100644 --- a/build/setup.iss +++ b/build/setup.iss @@ -1,5 +1,5 @@ #define MyAppName "Tactical RMM Agent" -#define MyAppVersion "2.4.0" +#define MyAppVersion "2.4.1" #define MyAppPublisher "AmidaWare LLC" #define MyAppURL "https://github.com/amidaware" #define MyAppExeName "tacticalrmm.exe" diff --git a/main.go b/main.go index 9ebf099..766fe2b 100644 --- a/main.go +++ b/main.go @@ -25,7 +25,7 @@ import ( ) var ( - version = "2.4.1-dev" + version = "2.4.1" log = logrus.New() logFile *os.File ) diff --git a/versioninfo.json b/versioninfo.json index b985ad4..b85f0d2 100644 --- a/versioninfo.json +++ b/versioninfo.json @@ -3,13 +3,13 @@ "FileVersion": { "Major": 2, "Minor": 4, - "Patch": 0, + "Patch": 1, "Build": 0 }, "ProductVersion": { "Major": 2, "Minor": 4, - "Patch": 0, + "Patch": 1, "Build": 0 }, "FileFlagsMask": "3f", @@ -22,14 +22,14 @@ "Comments": "", "CompanyName": "AmidaWare LLC", "FileDescription": "Tactical RMM Agent", - "FileVersion": "v2.4.0.0", + "FileVersion": "v2.4.1.0", "InternalName": "tacticalrmm.exe", "LegalCopyright": "Copyright (c) 2022 AmidaWare LLC", "LegalTrademarks": "", "OriginalFilename": "tacticalrmm.exe", "PrivateBuild": "", "ProductName": "Tactical RMM Agent", - "ProductVersion": "v2.4.0.0", + "ProductVersion": "v2.4.1.0", "SpecialBuild": "" }, "VarFileInfo": { From eddafb873b21781828fa0b404b3b6cebd2b28776 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Sat, 29 Oct 2022 16:02:08 -0700 Subject: [PATCH 030/113] remove stale inno temp files --- agent/process.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/agent/process.go b/agent/process.go index ae7c392..6409bc3 100644 --- a/agent/process.go +++ b/agent/process.go @@ -13,6 +13,8 @@ package agent import ( "fmt" + "os" + "path/filepath" "strings" rmm "github.com/amidaware/rmmagent/shared" @@ -76,4 +78,15 @@ func (a *Agent) KillHungUpdates() { KillProc(int32(p.PID)) } } + + err = os.Chdir(a.ProgramDir) + if err == nil { + files, err := filepath.Glob("is-*.tmp") + if err == nil { + for _, f := range files { + a.Logger.Debugln("KillHungUpdates() Removing file:", f) + os.Remove(f) + } + } + } } From e11c38dd49256584900be3ebaacdcb228a14f87b Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Sun, 6 Nov 2022 21:49:26 -0800 Subject: [PATCH 031/113] fix race condition in windows agent update amidaware/tacticalrmm#1250 --- agent/agent.go | 2 +- agent/rpc.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/agent/agent.go b/agent/agent.go index d6d7a91..16d1c1c 100644 --- a/agent/agent.go +++ b/agent/agent.go @@ -154,7 +154,7 @@ func New(logger *logrus.Logger, version string) *Agent { Option: service.KeyValue{ "StartType": "automatic", "OnFailure": "restart", - "OnFailureDelayDuration": "5s", + "OnFailureDelayDuration": "12s", "OnFailureResetPeriod": 10, }, } diff --git a/agent/rpc.go b/agent/rpc.go index ce2a89c..b141be0 100644 --- a/agent/rpc.go +++ b/agent/rpc.go @@ -479,6 +479,7 @@ func (a *Agent) RunRPC() { atomic.StoreUint32(&agentUpdateLocker, 0) nc.Flush() nc.Close() + a.ControlService(winSvcName, "stop") os.Exit(0) } }(payload) From a057c65a02c96b6f36b756359be02d6e9059263d Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Sun, 6 Nov 2022 22:18:56 -0800 Subject: [PATCH 032/113] moving this somewhere else --- agent/process.go | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/agent/process.go b/agent/process.go index 6409bc3..ae7c392 100644 --- a/agent/process.go +++ b/agent/process.go @@ -13,8 +13,6 @@ package agent import ( "fmt" - "os" - "path/filepath" "strings" rmm "github.com/amidaware/rmmagent/shared" @@ -78,15 +76,4 @@ func (a *Agent) KillHungUpdates() { KillProc(int32(p.PID)) } } - - err = os.Chdir(a.ProgramDir) - if err == nil { - files, err := filepath.Glob("is-*.tmp") - if err == nil { - for _, f := range files { - a.Logger.Debugln("KillHungUpdates() Removing file:", f) - os.Remove(f) - } - } - } } From 473cfd3ced4c6a1d03a41fc33974dc46ccb7b827 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Sun, 6 Nov 2022 22:20:49 -0800 Subject: [PATCH 033/113] add more cleanup #25 --- agent/agent.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/agent/agent.go b/agent/agent.go index 16d1c1c..c9b9b04 100644 --- a/agent/agent.go +++ b/agent/agent.go @@ -426,7 +426,7 @@ func (a *Agent) GetUninstallExe() string { func (a *Agent) CleanupAgentUpdates() { // TODO remove a.ProgramDir, updates are now in winTempDir - dirs := [2]string{winTempDir, a.ProgramDir} + dirs := [3]string{winTempDir, os.Getenv("TMP"), a.ProgramDir} for _, dir := range dirs { err := os.Chdir(dir) if err != nil { @@ -435,7 +435,7 @@ func (a *Agent) CleanupAgentUpdates() { } // TODO winagent-v* is deprecated - globs := [2]string{"tacticalagent-v*", "winagent-v*"} + globs := [3]string{"tacticalagent-v*", "is-*.tmp", "winagent-v*"} for _, glob := range globs { files, err := filepath.Glob(glob) if err == nil { From 337c519b99fd4b3e294cf84b56f76de0fc48b93b Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Mon, 7 Nov 2022 10:18:12 -0800 Subject: [PATCH 034/113] update deps --- go.mod | 6 +++--- go.sum | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/go.mod b/go.mod index cf912c8..0d2d785 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/amidaware/rmmagent -go 1.18 +go 1.19 require ( github.com/StackExchange/wmi v1.2.1 @@ -10,8 +10,8 @@ require ( github.com/go-resty/resty/v2 v2.7.0 github.com/gonutz/w32/v2 v2.4.0 github.com/iamacarpet/go-win64api v0.0.0-20220531131246-e84054eb584d - github.com/nats-io/nats-server/v2 v2.9.3 // indirect - github.com/nats-io/nats.go v1.18.0 + github.com/nats-io/nats-server/v2 v2.9.6 // indirect + github.com/nats-io/nats.go v1.19.1 github.com/rickb777/date v1.19.1 github.com/shirou/gopsutil/v3 v3.22.9 github.com/sirupsen/logrus v1.9.0 diff --git a/go.sum b/go.sum index 6723895..b66a4de 100644 --- a/go.sum +++ b/go.sum @@ -212,10 +212,10 @@ github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrk github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/nats-io/jwt/v2 v2.3.0 h1:z2mA1a7tIf5ShggOFlR1oBPgd6hGqcDYsISxZByUzdI= -github.com/nats-io/nats-server/v2 v2.9.3 h1:HrfzA7G9LNetKkm1z+jU/e9kuAe+E6uaBuuq9EB5sQQ= -github.com/nats-io/nats-server/v2 v2.9.3/go.mod h1:4sq8wvrpbvSzL1n3ZfEYnH4qeUuIl5W990j3kw13rRk= -github.com/nats-io/nats.go v1.18.0 h1:o480Ao6kuSSFyJO75rGTXCEPj7LGkY84C1Ye+Uhm4c0= -github.com/nats-io/nats.go v1.18.0/go.mod h1:BPko4oXsySz4aSWeFgOHLZs3G4Jq4ZAyE6/zMCxRT6w= +github.com/nats-io/nats-server/v2 v2.9.6 h1:RTtK+rv/4CcliOuqGsy58g7MuWkBaWmF5TUNwuUo9Uw= +github.com/nats-io/nats-server/v2 v2.9.6/go.mod h1:AB6hAnGZDlYfqb7CTAm66ZKMZy9DpfierY1/PbpvI2g= +github.com/nats-io/nats.go v1.19.1 h1:pDQZthDfxRMSJ0ereExAM9ODf3JyS42Exk7iCMdbpec= +github.com/nats-io/nats.go v1.19.1/go.mod h1:tLqubohF7t4z3du1QDPYJIQQyhb4wl6DhjxEajSI7UA= github.com/nats-io/nkeys v0.3.0 h1:cgM5tL53EvYRU+2YLXIK0G2mJtK12Ft9oeooSZMA2G8= github.com/nats-io/nkeys v0.3.0/go.mod h1:gvUNGjVcM2IPr5rCsRsC6Wb3Hr2CQAm08dsxtV6A5y4= github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw= From 93f4de35fe23700279eae7573e4d5613d7e693c0 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Tue, 8 Nov 2022 21:37:54 -0800 Subject: [PATCH 035/113] update psutil --- go.mod | 2 +- go.sum | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 0d2d785..cf40ceb 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( github.com/nats-io/nats-server/v2 v2.9.6 // indirect github.com/nats-io/nats.go v1.19.1 github.com/rickb777/date v1.19.1 - github.com/shirou/gopsutil/v3 v3.22.9 + github.com/shirou/gopsutil/v3 v3.22.10 github.com/sirupsen/logrus v1.9.0 github.com/ugorji/go/codec v1.2.7 github.com/wh1te909/go-win64api v0.0.0-20210906074314-ab23795a6ae5 diff --git a/go.sum b/go.sum index b66a4de..35ebe70 100644 --- a/go.sum +++ b/go.sum @@ -257,8 +257,8 @@ github.com/rogpeppe/go-internal v1.8.1 h1:geMPLpDpQOgVyCg5z5GoRwLHepNdb71NXb67XF github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= github.com/scjalliance/comshim v0.0.0-20190308082608-cf06d2532c4e h1:+/AzLkOdIXEPrAQtwAeWOBnPQ0BnYlBW0aCZmSb47u4= github.com/scjalliance/comshim v0.0.0-20190308082608-cf06d2532c4e/go.mod h1:9Tc1SKnfACJb9N7cw2eyuI6xzy845G7uZONBsi5uPEA= -github.com/shirou/gopsutil/v3 v3.22.9 h1:yibtJhIVEMcdw+tCTbOPiF1VcsuDeTE4utJ8Dm4c5eA= -github.com/shirou/gopsutil/v3 v3.22.9/go.mod h1:bBYl1kjgEJpWpxeHmLI+dVHWtyAwfcmSBLDsp2TNT8A= +github.com/shirou/gopsutil/v3 v3.22.10 h1:4KMHdfBRYXGF9skjDWiL4RA2N+E8dRdodU/bOZpPoVg= +github.com/shirou/gopsutil/v3 v3.22.10/go.mod h1:QNza6r4YQoydyCfo6rH0blGfKahgibh4dQmV5xdFkQk= github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/spf13/afero v1.8.2 h1:xehSyVa0YnHWsJ49JFljMpg1HX19V6NDZ1fkm1Xznbo= @@ -275,14 +275,16 @@ github.com/spf13/viper v1.13.0 h1:BWSJ/M+f+3nmdz9bxB+bWX28kkALN2ok11D0rSo8EJU= github.com/spf13/viper v1.13.0/go.mod h1:Icm2xNL3/8uyh/wFuB1jI7TiTNKp8632Nwegu+zgdYw= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/subosito/gotenv v1.4.1 h1:jyEFiXpy21Wm81FBN71l9VoMMV8H8jG+qIK3GCpY6Qs= github.com/subosito/gotenv v1.4.1/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= github.com/tklauser/go-sysconf v0.3.10 h1:IJ1AZGZRWbY8T5Vfk04D9WOA5WSejdflXxP03OUqALw= From bf5258eb78c1f209b70c6bf1547b2f1233c00294 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Tue, 8 Nov 2022 23:02:17 -0800 Subject: [PATCH 036/113] bump version --- build/rmm.exe.manifest | 2 +- build/setup.iss | 2 +- main.go | 2 +- versioninfo.json | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/build/rmm.exe.manifest b/build/rmm.exe.manifest index 7b92d4e..c18eeec 100644 --- a/build/rmm.exe.manifest +++ b/build/rmm.exe.manifest @@ -3,7 +3,7 @@ diff --git a/build/setup.iss b/build/setup.iss index d8e8b58..9f61bec 100644 --- a/build/setup.iss +++ b/build/setup.iss @@ -1,5 +1,5 @@ #define MyAppName "Tactical RMM Agent" -#define MyAppVersion "2.4.1" +#define MyAppVersion "2.4.2" #define MyAppPublisher "AmidaWare LLC" #define MyAppURL "https://github.com/amidaware" #define MyAppExeName "tacticalrmm.exe" diff --git a/main.go b/main.go index 766fe2b..549be41 100644 --- a/main.go +++ b/main.go @@ -25,7 +25,7 @@ import ( ) var ( - version = "2.4.1" + version = "2.4.2" log = logrus.New() logFile *os.File ) diff --git a/versioninfo.json b/versioninfo.json index b85f0d2..6cb8e61 100644 --- a/versioninfo.json +++ b/versioninfo.json @@ -3,13 +3,13 @@ "FileVersion": { "Major": 2, "Minor": 4, - "Patch": 1, + "Patch": 2, "Build": 0 }, "ProductVersion": { "Major": 2, "Minor": 4, - "Patch": 1, + "Patch": 2, "Build": 0 }, "FileFlagsMask": "3f", @@ -22,14 +22,14 @@ "Comments": "", "CompanyName": "AmidaWare LLC", "FileDescription": "Tactical RMM Agent", - "FileVersion": "v2.4.1.0", + "FileVersion": "v2.4.2.0", "InternalName": "tacticalrmm.exe", "LegalCopyright": "Copyright (c) 2022 AmidaWare LLC", "LegalTrademarks": "", "OriginalFilename": "tacticalrmm.exe", "PrivateBuild": "", "ProductName": "Tactical RMM Agent", - "ProductVersion": "v2.4.1.0", + "ProductVersion": "v2.4.2.0", "SpecialBuild": "" }, "VarFileInfo": { From 44c63d00b65ad1605e3f832637a37add22588b67 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Wed, 9 Nov 2022 23:47:00 -0800 Subject: [PATCH 037/113] update ci --- .github/workflows/ci.yml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3c4f05a..477fa07 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ jobs: - uses: actions/setup-go@v3 with: - go-version: '1.18.3' + go-version: '1.19.3' - name: Ensure linux agent compiles run: | @@ -40,10 +40,3 @@ jobs: for i in ${ARCHS}; do env CGO_ENABLED=0 GOOS=darwin GOARCH=${i} go build -ldflags "-s -w" done - - - name: Ensure freebsd agent compiles - run: | - ARCHS='amd64 386 arm64 arm' - for i in ${ARCHS}; do - env CGO_ENABLED=0 GOOS=freebsd GOARCH=${i} go build -ldflags "-s -w" - done From db5cd5b0e04570c38efcadee02d30ca00b1fc139 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Fri, 11 Nov 2022 17:46:10 -0800 Subject: [PATCH 038/113] dev --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index 549be41..c6dd5c2 100644 --- a/main.go +++ b/main.go @@ -25,7 +25,7 @@ import ( ) var ( - version = "2.4.2" + version = "2.4.2-dev" log = logrus.New() logFile *os.File ) From 7a75d4d5a3a6d22b1c1f4c5480870f6180d3ee80 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Fri, 11 Nov 2022 17:46:28 -0800 Subject: [PATCH 039/113] update viper --- go.mod | 12 ++++++------ go.sum | 28 ++++++++++++++-------------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/go.mod b/go.mod index cf40ceb..bdc1a3c 100644 --- a/go.mod +++ b/go.mod @@ -18,7 +18,7 @@ require ( github.com/ugorji/go/codec v1.2.7 github.com/wh1te909/go-win64api v0.0.0-20210906074314-ab23795a6ae5 github.com/wh1te909/trmm-shared v0.0.0-20220227075846-f9f757361139 - golang.org/x/net v0.0.0-20220706163947-c90051bbdb60 // indirect + golang.org/x/net v0.0.0-20221014081412-f15817d10f9b // indirect golang.org/x/sys v0.0.0-20220928140112-f11e5e49a4ec ) @@ -31,12 +31,12 @@ require ( github.com/fourcorelabs/wintoken v1.0.0 github.com/jaypipes/ghw v0.9.0 github.com/kardianos/service v1.2.2 - github.com/spf13/viper v1.13.0 + github.com/spf13/viper v1.14.0 ) require ( github.com/elastic/go-windows v1.0.1 // indirect - github.com/fsnotify/fsnotify v1.5.4 // indirect + github.com/fsnotify/fsnotify v1.6.0 // indirect github.com/ghodss/yaml v1.0.0 // indirect github.com/google/cabbie v1.0.3 // indirect github.com/google/glazier v0.0.0-20220520121753-83447cca4ea7 // indirect @@ -59,7 +59,7 @@ require ( github.com/rickb777/plural v1.4.1 // indirect github.com/rogpeppe/go-internal v1.8.1 // indirect github.com/scjalliance/comshim v0.0.0-20190308082608-cf06d2532c4e // indirect - github.com/spf13/afero v1.8.2 // indirect + github.com/spf13/afero v1.9.2 // indirect github.com/spf13/cast v1.5.0 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect @@ -68,8 +68,8 @@ require ( github.com/tklauser/numcpus v0.5.0 // indirect github.com/yusufpapurcu/wmi v1.2.2 // indirect golang.org/x/crypto v0.0.0-20220926161630-eccd6366d1be // indirect - golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f // indirect - golang.org/x/text v0.3.7 // indirect + golang.org/x/sync v0.1.0 // indirect + golang.org/x/text v0.4.0 // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/toast.v1 v1.0.0-20180812000517-0a84660828b2 // indirect diff --git a/go.sum b/go.sum index 35ebe70..a16feb1 100644 --- a/go.sum +++ b/go.sum @@ -72,8 +72,8 @@ github.com/fourcorelabs/wintoken v1.0.0/go.mod h1:jKyXHt079W09KwEMbUC9g+R2KDs5kV github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI= -github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= +github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= +github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-cmd/cmd v1.4.1 h1:JUcEIE84v8DSy02XTZpUDeGKExk2oW3DA10hTjbQwmc= @@ -261,8 +261,8 @@ github.com/shirou/gopsutil/v3 v3.22.10 h1:4KMHdfBRYXGF9skjDWiL4RA2N+E8dRdodU/bOZ github.com/shirou/gopsutil/v3 v3.22.10/go.mod h1:QNza6r4YQoydyCfo6rH0blGfKahgibh4dQmV5xdFkQk= github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= -github.com/spf13/afero v1.8.2 h1:xehSyVa0YnHWsJ49JFljMpg1HX19V6NDZ1fkm1Xznbo= -github.com/spf13/afero v1.8.2/go.mod h1:CtAatgMJh6bJEIs48Ay/FOnkljP3WeGUG0MC1RfAqwo= +github.com/spf13/afero v1.9.2 h1:j49Hj62F0n+DaZ1dDCvhABaPNSGNkt32oRFxI33IEMw= +github.com/spf13/afero v1.9.2/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcDf8Y= github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w= github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= @@ -271,8 +271,8 @@ github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0 github.com/spf13/pflag v1.0.2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/viper v1.13.0 h1:BWSJ/M+f+3nmdz9bxB+bWX28kkALN2ok11D0rSo8EJU= -github.com/spf13/viper v1.13.0/go.mod h1:Icm2xNL3/8uyh/wFuB1jI7TiTNKp8632Nwegu+zgdYw= +github.com/spf13/viper v1.14.0 h1:Rg7d3Lo706X9tHsJMUjdiwMpHB7W8WnSVOssIY+JElU= +github.com/spf13/viper v1.14.0/go.mod h1:WT//axPky3FdvXHzGw33dNdXXXfFQqmEalje+egj8As= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= @@ -391,8 +391,8 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211029224645-99673261e6eb/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220706163947-c90051bbdb60 h1:8NSylCMxLW4JvserAndSgFL7aPli6A68yf0bYFTcWCM= -golang.org/x/net v0.0.0-20220706163947-c90051bbdb60/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.0.0-20221014081412-f15817d10f9b h1:tvrvnPFcdzp294diPnrdZZZ8XUt2Tyj7svb7X52iDuU= +golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -413,8 +413,8 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f h1:Ax0t5p6N38Ga0dThY21weqDEyz2oklo4IvDkpigvkD8= -golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= +golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -467,10 +467,10 @@ golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20211107104306-e0b2ad06fe42/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220319134239-a9b59b0215f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220928140112-f11e5e49a4ec h1:BkDtF2Ih9xZ7le9ndzTA7KJow28VbQW3odyk/8drmuI= golang.org/x/sys v0.0.0-20220928140112-f11e5e49a4ec/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= @@ -481,8 +481,8 @@ golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.4.0 h1:BrVqGRd7+k1DiOgtnFvAkoQEWQvBc25ouMJM6429SFg= +golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -626,7 +626,7 @@ google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2 google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= -google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= +google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= From f200862b1a0e3c42933f27dc72cd72d127a0cd5f Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Sat, 12 Nov 2022 15:28:19 -0800 Subject: [PATCH 040/113] remove unused funcs --- main.go | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/main.go b/main.go index c6dd5c2..09d22f1 100644 --- a/main.go +++ b/main.go @@ -51,9 +51,6 @@ func main() { meshDir := flag.String("meshdir", "", "Path to custom meshcentral dir") meshNodeID := flag.String("meshnodeid", "", "Mesh Node ID") cert := flag.String("cert", "", "Path to domain CA .pem") - updateurl := flag.String("updateurl", "", "Download link to updater") - inno := flag.String("inno", "", "Inno setup file") - updatever := flag.String("updatever", "", "Update version") silent := flag.Bool("silent", false, "Do not popup any message boxes during installation") proxy := flag.String("proxy", "", "Use a http proxy") flag.Parse() @@ -127,12 +124,6 @@ func main() { return } a.RunTask(*taskPK) - case "update": - if *updateurl == "" || *inno == "" || *updatever == "" { - updateUsage() - return - } - a.AgentUpdate(*updateurl, *inno, *updatever) case "install": if runtime.GOOS != "windows" { u, err := user.Current() @@ -145,7 +136,6 @@ func main() { } if *api == "" || *clientID == 0 || *siteID == 0 || *token == "" { - installUsage() return } a.Install(&agent.Installer{ @@ -191,14 +181,3 @@ func setupLogging(level, to *string) { log.SetOutput(logFile) } } - -func installUsage() { - exe, _ := os.Executable() - u := fmt.Sprintf(`Usage: %s -m install -api -client-id X -site-id X -auth `, exe) - fmt.Println(u) -} - -func updateUsage() { - u := `Usage: tacticalrmm.exe -m update -updateurl https://example.com/tacticalagent-vX.X.X.exe -inno tacticalagent-vX.X.X.exe -updatever 1.1.1` - fmt.Println(u) -} From bcfae9dc66580da47ae51cdf16252eb5fefced44 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Sat, 12 Nov 2022 15:30:39 -0800 Subject: [PATCH 041/113] update nats --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index bdc1a3c..9127efc 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/gonutz/w32/v2 v2.4.0 github.com/iamacarpet/go-win64api v0.0.0-20220531131246-e84054eb584d github.com/nats-io/nats-server/v2 v2.9.6 // indirect - github.com/nats-io/nats.go v1.19.1 + github.com/nats-io/nats.go v1.20.0 github.com/rickb777/date v1.19.1 github.com/shirou/gopsutil/v3 v3.22.10 github.com/sirupsen/logrus v1.9.0 diff --git a/go.sum b/go.sum index a16feb1..ba4125a 100644 --- a/go.sum +++ b/go.sum @@ -216,6 +216,8 @@ github.com/nats-io/nats-server/v2 v2.9.6 h1:RTtK+rv/4CcliOuqGsy58g7MuWkBaWmF5TUN github.com/nats-io/nats-server/v2 v2.9.6/go.mod h1:AB6hAnGZDlYfqb7CTAm66ZKMZy9DpfierY1/PbpvI2g= github.com/nats-io/nats.go v1.19.1 h1:pDQZthDfxRMSJ0ereExAM9ODf3JyS42Exk7iCMdbpec= github.com/nats-io/nats.go v1.19.1/go.mod h1:tLqubohF7t4z3du1QDPYJIQQyhb4wl6DhjxEajSI7UA= +github.com/nats-io/nats.go v1.20.0 h1:T8JJnQfVSdh1CzGiwAOv5hEobYCBho/0EupGznYw0oM= +github.com/nats-io/nats.go v1.20.0/go.mod h1:tLqubohF7t4z3du1QDPYJIQQyhb4wl6DhjxEajSI7UA= github.com/nats-io/nkeys v0.3.0 h1:cgM5tL53EvYRU+2YLXIK0G2mJtK12Ft9oeooSZMA2G8= github.com/nats-io/nkeys v0.3.0/go.mod h1:gvUNGjVcM2IPr5rCsRsC6Wb3Hr2CQAm08dsxtV6A5y4= github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw= From d3bcb10f93fa992aa0e5042465993a86c4d02ef8 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Sat, 12 Nov 2022 16:17:18 -0800 Subject: [PATCH 042/113] tidy --- go.sum | 2 -- 1 file changed, 2 deletions(-) diff --git a/go.sum b/go.sum index ba4125a..ce32c18 100644 --- a/go.sum +++ b/go.sum @@ -214,8 +214,6 @@ github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RR github.com/nats-io/jwt/v2 v2.3.0 h1:z2mA1a7tIf5ShggOFlR1oBPgd6hGqcDYsISxZByUzdI= github.com/nats-io/nats-server/v2 v2.9.6 h1:RTtK+rv/4CcliOuqGsy58g7MuWkBaWmF5TUNwuUo9Uw= github.com/nats-io/nats-server/v2 v2.9.6/go.mod h1:AB6hAnGZDlYfqb7CTAm66ZKMZy9DpfierY1/PbpvI2g= -github.com/nats-io/nats.go v1.19.1 h1:pDQZthDfxRMSJ0ereExAM9ODf3JyS42Exk7iCMdbpec= -github.com/nats-io/nats.go v1.19.1/go.mod h1:tLqubohF7t4z3du1QDPYJIQQyhb4wl6DhjxEajSI7UA= github.com/nats-io/nats.go v1.20.0 h1:T8JJnQfVSdh1CzGiwAOv5hEobYCBho/0EupGznYw0oM= github.com/nats-io/nats.go v1.20.0/go.mod h1:tLqubohF7t4z3du1QDPYJIQQyhb4wl6DhjxEajSI7UA= github.com/nats-io/nkeys v0.3.0 h1:cgM5tL53EvYRU+2YLXIK0G2mJtK12Ft9oeooSZMA2G8= From 9ccb95449edbf20e98727d5b33705013f48c7b9d Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Sat, 12 Nov 2022 16:49:47 -0800 Subject: [PATCH 043/113] bump version --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index 09d22f1..36cc94a 100644 --- a/main.go +++ b/main.go @@ -25,7 +25,7 @@ import ( ) var ( - version = "2.4.2-dev" + version = "2.4.2" log = logrus.New() logFile *os.File ) From f1db416d565dfce8c48534be35b9fb07b21457b7 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Thu, 24 Nov 2022 23:45:59 -0800 Subject: [PATCH 044/113] make checkin intervals configurable and remove extra nats conn --- agent/agent.go | 1 + agent/rpc.go | 9 ++++-- agent/svc.go | 84 +++++++++++++++++++++++++++++++++++++------------- agent/utils.go | 9 ++++++ 4 files changed, 79 insertions(+), 24 deletions(-) diff --git a/agent/agent.go b/agent/agent.go index c9b9b04..daa3503 100644 --- a/agent/agent.go +++ b/agent/agent.go @@ -89,6 +89,7 @@ const ( var winTempDir = filepath.Join(os.Getenv("PROGRAMDATA"), "TacticalRMM") var winMeshDir = filepath.Join(os.Getenv("PROGRAMFILES"), "Mesh Agent") var natsCheckin = []string{"agent-hello", "agent-agentinfo", "agent-disks", "agent-winsvc", "agent-publicip", "agent-wmi"} +var limitNatsData = []string{"agent-winsvc", "agent-wmi"} func New(logger *logrus.Logger, version string) *Agent { host, _ := ps.Host() diff --git a/agent/rpc.go b/agent/rpc.go index b141be0..f5dc454 100644 --- a/agent/rpc.go +++ b/agent/rpc.go @@ -51,15 +51,18 @@ var ( func (a *Agent) RunRPC() { a.Logger.Infoln("Agent service started") - go a.RunAsService() - var wg sync.WaitGroup - wg.Add(1) + opts := a.setupNatsOptions() nc, err := nats.Connect(a.NatsServer, opts...) if err != nil { a.Logger.Fatalln("RunRPC() nats.Connect()", err) } + go a.RunAsService(nc) + + var wg sync.WaitGroup + wg.Add(1) + nc.Subscribe(a.AgentID, func(msg *nats.Msg) { var payload *NatsMsg var mh codec.MsgpackHandle diff --git a/agent/svc.go b/agent/svc.go index e695ffd..24d72d8 100644 --- a/agent/svc.go +++ b/agent/svc.go @@ -12,6 +12,7 @@ https://license.tacticalrmm.com package agent import ( + "fmt" "runtime" "sync" "time" @@ -19,15 +20,27 @@ import ( nats "github.com/nats-io/nats.go" ) -func (a *Agent) RunAsService() { +func (a *Agent) RunAsService(nc *nats.Conn) { var wg sync.WaitGroup wg.Add(1) - go a.AgentSvc() + go a.AgentSvc(nc) go a.CheckRunner() wg.Wait() } -func (a *Agent) AgentSvc() { +type AgentCheckInConfig struct { + Hello int `json:"checkin_hello"` + AgentInfo int `json:"checkin_agentinfo"` + WinSvc int `json:"checkin_winsvc"` + PubIP int `json:"checkin_pubip"` + Disks int `json:"checkin_disks"` + SW int `json:"checkin_sw"` + WMI int `json:"checkin_wmi"` + SyncMesh int `json:"checkin_syncmesh"` + LimitData bool `json:"limit_data"` +} + +func (a *Agent) AgentSvc(nc *nats.Conn) { if runtime.GOOS == "windows" { go a.GetPython(false) @@ -38,37 +51,36 @@ func (a *Agent) AgentSvc() { } a.RunMigrations() - sleepDelay := randRange(14, 22) + sleepDelay := randRange(7, 25) a.Logger.Debugf("AgentSvc() sleeping for %v seconds", sleepDelay) time.Sleep(time.Duration(sleepDelay) * time.Second) - opts := a.setupNatsOptions() - nc, err := nats.Connect(a.NatsServer, opts...) - if err != nil { - a.Logger.Fatalln("AgentSvc() nats.Connect()", err) - } - + conf := a.GetAgentCheckInConfig() for _, s := range natsCheckin { - a.NatsMessage(nc, s) - time.Sleep(time.Duration(randRange(100, 400)) * time.Millisecond) + if conf.LimitData && stringInSlice(s, limitNatsData) { + continue + } else { + a.NatsMessage(nc, s) + time.Sleep(time.Duration(randRange(100, 400)) * time.Millisecond) + } } go a.SyncMeshNodeID() time.Sleep(time.Duration(randRange(1, 3)) * time.Second) - if runtime.GOOS == "windows" { + if runtime.GOOS == "windows" && !conf.LimitData { a.AgentStartup() a.SendSoftware() } - checkInHelloTicker := time.NewTicker(time.Duration(randRange(30, 60)) * time.Second) - checkInAgentInfoTicker := time.NewTicker(time.Duration(randRange(200, 400)) * time.Second) - checkInWinSvcTicker := time.NewTicker(time.Duration(randRange(2400, 3000)) * time.Second) - checkInPubIPTicker := time.NewTicker(time.Duration(randRange(300, 500)) * time.Second) - checkInDisksTicker := time.NewTicker(time.Duration(randRange(1000, 2000)) * time.Second) - checkInSWTicker := time.NewTicker(time.Duration(randRange(2800, 3500)) * time.Second) - checkInWMITicker := time.NewTicker(time.Duration(randRange(3000, 4000)) * time.Second) - syncMeshTicker := time.NewTicker(time.Duration(randRange(800, 1200)) * time.Second) + checkInHelloTicker := time.NewTicker(time.Duration(conf.Hello) * time.Second) + checkInAgentInfoTicker := time.NewTicker(time.Duration(conf.AgentInfo) * time.Second) + checkInWinSvcTicker := time.NewTicker(time.Duration(conf.WinSvc) * time.Second) + checkInPubIPTicker := time.NewTicker(time.Duration(conf.PubIP) * time.Second) + checkInDisksTicker := time.NewTicker(time.Duration(conf.Disks) * time.Second) + checkInSWTicker := time.NewTicker(time.Duration(conf.SW) * time.Second) + checkInWMITicker := time.NewTicker(time.Duration(conf.WMI) * time.Second) + syncMeshTicker := time.NewTicker(time.Duration(conf.SyncMesh) * time.Second) for { select { @@ -100,3 +112,33 @@ func (a *Agent) AgentStartup() { a.Logger.Debugln("AgentStartup()", err) } } + +func (a *Agent) GetAgentCheckInConfig() AgentCheckInConfig { + ret := AgentCheckInConfig{} + url := fmt.Sprintf("/api/v3/%s/config/", a.AgentID) + r, err := a.rClient.R().SetResult(&AgentCheckInConfig{}).Get(url) + if err != nil { + a.Logger.Debugln("GetAgentCheckInConfig()", err) + ret.Hello = randRange(30, 60) + ret.AgentInfo = randRange(200, 400) + ret.WinSvc = randRange(2400, 3000) + ret.PubIP = randRange(300, 500) + ret.Disks = randRange(1000, 2000) + ret.SW = randRange(2800, 3500) + ret.WMI = randRange(3000, 4000) + ret.SyncMesh = randRange(800, 1200) + ret.LimitData = false + return ret + } + ret.Hello = r.Result().(*AgentCheckInConfig).Hello + ret.AgentInfo = r.Result().(*AgentCheckInConfig).AgentInfo + ret.WinSvc = r.Result().(*AgentCheckInConfig).WinSvc + ret.PubIP = r.Result().(*AgentCheckInConfig).PubIP + ret.Disks = r.Result().(*AgentCheckInConfig).Disks + ret.SW = r.Result().(*AgentCheckInConfig).SW + ret.WMI = r.Result().(*AgentCheckInConfig).WMI + ret.SyncMesh = r.Result().(*AgentCheckInConfig).SyncMesh + ret.LimitData = r.Result().(*AgentCheckInConfig).LimitData + a.Logger.Debugf("%+v\n", r) + return ret +} diff --git a/agent/utils.go b/agent/utils.go index f5916f8..ede7753 100644 --- a/agent/utils.go +++ b/agent/utils.go @@ -322,3 +322,12 @@ func createTmpFile() (*os.File, error) { } return f, nil } + +func stringInSlice(a string, list []string) bool { + for _, b := range list { + if b == a { + return true + } + } + return false +} From 79dba2f84c860b03cdb6b98f831d74b33c125eea Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Thu, 24 Nov 2022 23:48:27 -0800 Subject: [PATCH 045/113] add some debug callbacks --- agent/agent.go | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/agent/agent.go b/agent/agent.go index daa3503..8a03e6a 100644 --- a/agent/agent.go +++ b/agent/agent.go @@ -400,13 +400,25 @@ func (a *Agent) SyncMeshNodeID() { func (a *Agent) setupNatsOptions() []nats.Option { opts := make([]nats.Option, 0) - opts = append(opts, nats.Name("TacticalRMM")) + opts = append(opts, nats.Name(a.AgentID)) opts = append(opts, nats.UserInfo(a.AgentID, a.Token)) opts = append(opts, nats.ReconnectWait(time.Second*5)) opts = append(opts, nats.RetryOnFailedConnect(true)) opts = append(opts, nats.MaxReconnects(-1)) opts = append(opts, nats.ReconnectBufSize(-1)) opts = append(opts, nats.ProxyPath(a.NatsProxyPath)) + opts = append(opts, nats.DisconnectErrHandler(func(nc *nats.Conn, err error) { + a.Logger.Debugln("NATS disconnected:", err) + a.Logger.Debugf("%+v\n", nc.Statistics) + })) + opts = append(opts, nats.ReconnectHandler(func(nc *nats.Conn) { + a.Logger.Debugln("NATS reconnected") + a.Logger.Debugf("%+v\n", nc.Statistics) + })) + opts = append(opts, nats.ErrorHandler(func(nc *nats.Conn, sub *nats.Subscription, err error) { + a.Logger.Debugln("NATS error:", err) + a.Logger.Debugf("%+v\n", sub) + })) return opts } From 9565fea27cb72f1d2db4935d73c8dc06ccc89f4d Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Fri, 25 Nov 2022 00:22:28 -0800 Subject: [PATCH 046/113] update deps --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 9127efc..e31b3d0 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/go-resty/resty/v2 v2.7.0 github.com/gonutz/w32/v2 v2.4.0 github.com/iamacarpet/go-win64api v0.0.0-20220531131246-e84054eb584d - github.com/nats-io/nats-server/v2 v2.9.6 // indirect + github.com/nats-io/nats-server/v2 v2.9.8 // indirect github.com/nats-io/nats.go v1.20.0 github.com/rickb777/date v1.19.1 github.com/shirou/gopsutil/v3 v3.22.10 diff --git a/go.sum b/go.sum index ce32c18..75321c6 100644 --- a/go.sum +++ b/go.sum @@ -212,8 +212,8 @@ github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrk github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/nats-io/jwt/v2 v2.3.0 h1:z2mA1a7tIf5ShggOFlR1oBPgd6hGqcDYsISxZByUzdI= -github.com/nats-io/nats-server/v2 v2.9.6 h1:RTtK+rv/4CcliOuqGsy58g7MuWkBaWmF5TUNwuUo9Uw= -github.com/nats-io/nats-server/v2 v2.9.6/go.mod h1:AB6hAnGZDlYfqb7CTAm66ZKMZy9DpfierY1/PbpvI2g= +github.com/nats-io/nats-server/v2 v2.9.8 h1:jgxZsv+A3Reb3MgwxaINcNq/za8xZInKhDg9Q0cGN1o= +github.com/nats-io/nats-server/v2 v2.9.8/go.mod h1:AB6hAnGZDlYfqb7CTAm66ZKMZy9DpfierY1/PbpvI2g= github.com/nats-io/nats.go v1.20.0 h1:T8JJnQfVSdh1CzGiwAOv5hEobYCBho/0EupGznYw0oM= github.com/nats-io/nats.go v1.20.0/go.mod h1:tLqubohF7t4z3du1QDPYJIQQyhb4wl6DhjxEajSI7UA= github.com/nats-io/nkeys v0.3.0 h1:cgM5tL53EvYRU+2YLXIK0G2mJtK12Ft9oeooSZMA2G8= From 6ac14b6d6426bf66ec05d591e657cb66818cd138 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Fri, 25 Nov 2022 00:23:31 -0800 Subject: [PATCH 047/113] add env to scripts --- agent/agent_windows.go | 7 ++++++- agent/checks.go | 2 +- agent/choco_windows.go | 2 +- agent/rpc.go | 5 +++-- agent/tasks_windows.go | 2 +- shared/types.go | 8 +++++--- 6 files changed, 17 insertions(+), 9 deletions(-) diff --git a/agent/agent_windows.go b/agent/agent_windows.go index 26cb7b6..c980ebd 100644 --- a/agent/agent_windows.go +++ b/agent/agent_windows.go @@ -82,7 +82,7 @@ func NewAgentConfig() *rmm.AgentConfig { } } -func (a *Agent) RunScript(code string, shell string, args []string, timeout int, runasuser bool) (stdout, stderr string, exitcode int, e error) { +func (a *Agent) RunScript(code string, shell string, args []string, timeout int, runasuser bool, envs []string) (stdout, stderr string, exitcode int, e error) { content := []byte(code) @@ -158,6 +158,11 @@ func (a *Agent) RunScript(code string, shell string, args []string, timeout int, cmd.Stdout = &outb cmd.Stderr = &errb + if len(envs) > 0 { + cmd.Env = os.Environ() + cmd.Env = append(cmd.Env, envs...) + } + if cmdErr := cmd.Start(); cmdErr != nil { a.Logger.Debugln(cmdErr) return "", cmdErr.Error(), 65, cmdErr diff --git a/agent/checks.go b/agent/checks.go index 531bf74..a680917 100644 --- a/agent/checks.go +++ b/agent/checks.go @@ -169,7 +169,7 @@ type ScriptCheckResult struct { // ScriptCheck runs either bat, powershell or python script func (a *Agent) ScriptCheck(data rmm.Check, r *resty.Client) { start := time.Now() - stdout, stderr, retcode, _ := a.RunScript(data.Script.Code, data.Script.Shell, data.ScriptArgs, data.Timeout, data.Script.RunAsUser) + stdout, stderr, retcode, _ := a.RunScript(data.Script.Code, data.Script.Shell, data.ScriptArgs, data.Timeout, data.Script.RunAsUser, data.Script.Env) payload := ScriptCheckResult{ ID: data.CheckPK, diff --git a/agent/choco_windows.go b/agent/choco_windows.go index c37f025..1ba6058 100644 --- a/agent/choco_windows.go +++ b/agent/choco_windows.go @@ -42,7 +42,7 @@ func (a *Agent) InstallChoco() { return } - _, _, exitcode, err := a.RunScript(string(r.Body()), "powershell", []string{}, 900, false) + _, _, exitcode, err := a.RunScript(string(r.Body()), "powershell", []string{}, 900, false, []string{}) if err != nil { a.Logger.Debugln(err) a.rClient.R().SetBody(result).Post(url) diff --git a/agent/rpc.go b/agent/rpc.go index f5dc454..57f0987 100644 --- a/agent/rpc.go +++ b/agent/rpc.go @@ -41,6 +41,7 @@ type NatsMsg struct { ID int `json:"id"` Code string `json:"code"` RunAsUser bool `json:"run_as_user"` + Env []string `json:"env"` } var ( @@ -261,7 +262,7 @@ func (a *Agent) RunRPC() { var resultData rmm.RunScriptResp ret := codec.NewEncoderBytes(&resp, new(codec.MsgpackHandle)) start := time.Now() - stdout, stderr, retcode, err := a.RunScript(p.Data["code"], p.Data["shell"], p.ScriptArgs, p.Timeout, p.RunAsUser) + stdout, stderr, retcode, err := a.RunScript(p.Data["code"], p.Data["shell"], p.ScriptArgs, p.Timeout, p.RunAsUser, p.Env) resultData.ExecTime = time.Since(start).Seconds() resultData.ID = p.ID @@ -291,7 +292,7 @@ func (a *Agent) RunRPC() { var retData rmm.RunScriptResp ret := codec.NewEncoderBytes(&resp, new(codec.MsgpackHandle)) start := time.Now() - stdout, stderr, retcode, err := a.RunScript(p.Data["code"], p.Data["shell"], p.ScriptArgs, p.Timeout, p.RunAsUser) + stdout, stderr, retcode, err := a.RunScript(p.Data["code"], p.Data["shell"], p.ScriptArgs, p.Timeout, p.RunAsUser, p.Env) retData.ExecTime = time.Since(start).Seconds() if err != nil { diff --git a/agent/tasks_windows.go b/agent/tasks_windows.go index da3d7a2..3144c8f 100644 --- a/agent/tasks_windows.go +++ b/agent/tasks_windows.go @@ -59,7 +59,7 @@ func (a *Agent) RunTask(id int) error { action_start := time.Now() if action.ActionType == "script" { - stdout, stderr, retcode, err := a.RunScript(action.Code, action.Shell, action.Args, action.Timeout, action.RunAsUser) + stdout, stderr, retcode, err := a.RunScript(action.Code, action.Shell, action.Args, action.Timeout, action.RunAsUser, action.Env) if err != nil { a.Logger.Debugln(err) diff --git a/shared/types.go b/shared/types.go index b2cb258..90acdc5 100644 --- a/shared/types.go +++ b/shared/types.go @@ -141,9 +141,10 @@ type AssignedTask struct { } type Script struct { - Shell string `json:"shell"` - Code string `json:"code"` - RunAsUser bool `json:"run_as_user"` + Shell string `json:"shell"` + Code string `json:"code"` + RunAsUser bool `json:"run_as_user"` + Env []string `json:"env"` } type CheckInfo struct { @@ -190,6 +191,7 @@ type TaskAction struct { Args []string `json:"script_args"` Timeout int `json:"timeout"` RunAsUser bool `json:"run_as_user"` + Env []string `json:"env"` } type AutomatedTask struct { From 7358907b3c01f817155f8dc80c5ad0bf60380907 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Mon, 28 Nov 2022 23:18:22 -0800 Subject: [PATCH 048/113] add env --- agent/agent.go | 6 +++--- agent/agent_windows.go | 6 +++--- agent/checks.go | 2 +- agent/rpc.go | 6 +++--- agent/tasks_windows.go | 2 +- shared/types.go | 4 ++-- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/agent/agent.go b/agent/agent.go index 8a03e6a..7374220 100644 --- a/agent/agent.go +++ b/agent/agent.go @@ -221,7 +221,7 @@ type CmdOptions struct { IsScript bool IsExecutable bool Detached bool - Env []string + EnvVars []string } func (a *Agent) NewCMDOpts() *CmdOptions { @@ -250,10 +250,10 @@ func (a *Agent) CmdV2(c *CmdOptions) CmdStatus { }) } - if len(c.Env) > 0 { + if len(c.EnvVars) > 0 { cmdOptions.BeforeExec = append(cmdOptions.BeforeExec, func(cmd *exec.Cmd) { cmd.Env = os.Environ() - cmd.Env = append(cmd.Env, c.Env...) + cmd.Env = append(cmd.Env, c.EnvVars...) }) } diff --git a/agent/agent_windows.go b/agent/agent_windows.go index c980ebd..446ddd6 100644 --- a/agent/agent_windows.go +++ b/agent/agent_windows.go @@ -82,7 +82,7 @@ func NewAgentConfig() *rmm.AgentConfig { } } -func (a *Agent) RunScript(code string, shell string, args []string, timeout int, runasuser bool, envs []string) (stdout, stderr string, exitcode int, e error) { +func (a *Agent) RunScript(code string, shell string, args []string, timeout int, runasuser bool, envVars []string) (stdout, stderr string, exitcode int, e error) { content := []byte(code) @@ -158,9 +158,9 @@ func (a *Agent) RunScript(code string, shell string, args []string, timeout int, cmd.Stdout = &outb cmd.Stderr = &errb - if len(envs) > 0 { + if len(envVars) > 0 { cmd.Env = os.Environ() - cmd.Env = append(cmd.Env, envs...) + cmd.Env = append(cmd.Env, envVars...) } if cmdErr := cmd.Start(); cmdErr != nil { diff --git a/agent/checks.go b/agent/checks.go index a680917..ec44b04 100644 --- a/agent/checks.go +++ b/agent/checks.go @@ -169,7 +169,7 @@ type ScriptCheckResult struct { // ScriptCheck runs either bat, powershell or python script func (a *Agent) ScriptCheck(data rmm.Check, r *resty.Client) { start := time.Now() - stdout, stderr, retcode, _ := a.RunScript(data.Script.Code, data.Script.Shell, data.ScriptArgs, data.Timeout, data.Script.RunAsUser, data.Script.Env) + stdout, stderr, retcode, _ := a.RunScript(data.Script.Code, data.Script.Shell, data.ScriptArgs, data.Timeout, data.Script.RunAsUser, data.Script.EnvVars) payload := ScriptCheckResult{ ID: data.CheckPK, diff --git a/agent/rpc.go b/agent/rpc.go index 57f0987..b883ead 100644 --- a/agent/rpc.go +++ b/agent/rpc.go @@ -41,7 +41,7 @@ type NatsMsg struct { ID int `json:"id"` Code string `json:"code"` RunAsUser bool `json:"run_as_user"` - Env []string `json:"env"` + EnvVars []string `json:"env_vars"` } var ( @@ -262,7 +262,7 @@ func (a *Agent) RunRPC() { var resultData rmm.RunScriptResp ret := codec.NewEncoderBytes(&resp, new(codec.MsgpackHandle)) start := time.Now() - stdout, stderr, retcode, err := a.RunScript(p.Data["code"], p.Data["shell"], p.ScriptArgs, p.Timeout, p.RunAsUser, p.Env) + stdout, stderr, retcode, err := a.RunScript(p.Data["code"], p.Data["shell"], p.ScriptArgs, p.Timeout, p.RunAsUser, p.EnvVars) resultData.ExecTime = time.Since(start).Seconds() resultData.ID = p.ID @@ -292,7 +292,7 @@ func (a *Agent) RunRPC() { var retData rmm.RunScriptResp ret := codec.NewEncoderBytes(&resp, new(codec.MsgpackHandle)) start := time.Now() - stdout, stderr, retcode, err := a.RunScript(p.Data["code"], p.Data["shell"], p.ScriptArgs, p.Timeout, p.RunAsUser, p.Env) + stdout, stderr, retcode, err := a.RunScript(p.Data["code"], p.Data["shell"], p.ScriptArgs, p.Timeout, p.RunAsUser, p.EnvVars) retData.ExecTime = time.Since(start).Seconds() if err != nil { diff --git a/agent/tasks_windows.go b/agent/tasks_windows.go index 3144c8f..086b80e 100644 --- a/agent/tasks_windows.go +++ b/agent/tasks_windows.go @@ -59,7 +59,7 @@ func (a *Agent) RunTask(id int) error { action_start := time.Now() if action.ActionType == "script" { - stdout, stderr, retcode, err := a.RunScript(action.Code, action.Shell, action.Args, action.Timeout, action.RunAsUser, action.Env) + stdout, stderr, retcode, err := a.RunScript(action.Code, action.Shell, action.Args, action.Timeout, action.RunAsUser, action.EnvVars) if err != nil { a.Logger.Debugln(err) diff --git a/shared/types.go b/shared/types.go index 90acdc5..de7f2a9 100644 --- a/shared/types.go +++ b/shared/types.go @@ -144,7 +144,7 @@ type Script struct { Shell string `json:"shell"` Code string `json:"code"` RunAsUser bool `json:"run_as_user"` - Env []string `json:"env"` + EnvVars []string `json:"env_vars"` } type CheckInfo struct { @@ -191,7 +191,7 @@ type TaskAction struct { Args []string `json:"script_args"` Timeout int `json:"timeout"` RunAsUser bool `json:"run_as_user"` - Env []string `json:"env"` + EnvVars []string `json:"env_vars"` } type AutomatedTask struct { From 36e9065474ea8539e2f7225549cf73743551fbc7 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Mon, 28 Nov 2022 23:19:58 -0800 Subject: [PATCH 049/113] change logging level --- agent/agent.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/agent/agent.go b/agent/agent.go index 7374220..45c43b0 100644 --- a/agent/agent.go +++ b/agent/agent.go @@ -408,16 +408,16 @@ func (a *Agent) setupNatsOptions() []nats.Option { opts = append(opts, nats.ReconnectBufSize(-1)) opts = append(opts, nats.ProxyPath(a.NatsProxyPath)) opts = append(opts, nats.DisconnectErrHandler(func(nc *nats.Conn, err error) { - a.Logger.Debugln("NATS disconnected:", err) - a.Logger.Debugf("%+v\n", nc.Statistics) + a.Logger.Errorln("NATS disconnected:", err) + a.Logger.Errorf("%+v\n", nc.Statistics) })) opts = append(opts, nats.ReconnectHandler(func(nc *nats.Conn) { - a.Logger.Debugln("NATS reconnected") - a.Logger.Debugf("%+v\n", nc.Statistics) + a.Logger.Infoln("NATS reconnected") + a.Logger.Infof("%+v\n", nc.Statistics) })) opts = append(opts, nats.ErrorHandler(func(nc *nats.Conn, sub *nats.Subscription, err error) { - a.Logger.Debugln("NATS error:", err) - a.Logger.Debugf("%+v\n", sub) + a.Logger.Errorln("NATS error:", err) + a.Logger.Errorf("%+v\n", sub) })) return opts } From 3ff004afa0327b52704e2c625d2d429c7752e956 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Tue, 29 Nov 2022 11:38:17 -0800 Subject: [PATCH 050/113] add more nats debug --- agent/agent.go | 129 +++++++++++++++++++++++------------------ agent/agent_unix.go | 1 + agent/agent_windows.go | 3 + agent/rpc.go | 2 + shared/types.go | 1 + 5 files changed, 80 insertions(+), 56 deletions(-) diff --git a/agent/agent.go b/agent/agent.go index 45c43b0..a5d36fb 100644 --- a/agent/agent.go +++ b/agent/agent.go @@ -40,35 +40,37 @@ import ( // Agent struct type Agent struct { - Hostname string - Arch string - AgentID string - BaseURL string - ApiURL string - Token string - AgentPK int - Cert string - ProgramDir string - EXE string - SystemDrive string - MeshInstaller string - MeshSystemEXE string - MeshSVC string - PyBin string - Headers map[string]string - Logger *logrus.Logger - Version string - Debug bool - rClient *resty.Client - Proxy string - LogTo string - LogFile *os.File - Platform string - GoArch string - ServiceConfig *service.Config - NatsServer string - NatsProxyPath string - NatsProxyPort string + Hostname string + Arch string + AgentID string + BaseURL string + ApiURL string + Token string + AgentPK int + Cert string + ProgramDir string + EXE string + SystemDrive string + MeshInstaller string + MeshSystemEXE string + MeshSVC string + PyBin string + Headers map[string]string + Logger *logrus.Logger + Version string + Debug bool + rClient *resty.Client + Proxy string + LogTo string + LogFile *os.File + Platform string + GoArch string + ServiceConfig *service.Config + NatsServer string + NatsProxyPath string + NatsProxyPort string + NatsPingInterval int + NatsWSCompression bool } const ( @@ -171,39 +173,50 @@ func New(logger *logrus.Logger, version string) *Agent { // check if using nats standard tcp, otherwise use nats websockets by default var natsServer string + var natsWsCompression bool if ac.NatsStandardPort != "" { natsServer = fmt.Sprintf("tls://%s:%s", ac.APIURL, ac.NatsStandardPort) } else { natsServer = fmt.Sprintf("wss://%s:%s", ac.APIURL, natsProxyPort) + natsWsCompression = true + } + + var natsPingInterval int + if ac.NatsPingInterval == 0 { + natsPingInterval = randRange(35, 45) + } else { + natsPingInterval = ac.NatsPingInterval } return &Agent{ - Hostname: info.Hostname, - BaseURL: ac.BaseURL, - AgentID: ac.AgentID, - ApiURL: ac.APIURL, - Token: ac.Token, - AgentPK: ac.PK, - Cert: ac.Cert, - ProgramDir: pd, - EXE: exe, - SystemDrive: sd, - MeshInstaller: "meshagent.exe", - MeshSystemEXE: MeshSysExe, - MeshSVC: meshSvcName, - PyBin: pybin, - Headers: headers, - Logger: logger, - Version: version, - Debug: logger.IsLevelEnabled(logrus.DebugLevel), - rClient: restyC, - Proxy: ac.Proxy, - Platform: runtime.GOOS, - GoArch: runtime.GOARCH, - ServiceConfig: svcConf, - NatsServer: natsServer, - NatsProxyPath: natsProxyPath, - NatsProxyPort: natsProxyPort, + Hostname: info.Hostname, + BaseURL: ac.BaseURL, + AgentID: ac.AgentID, + ApiURL: ac.APIURL, + Token: ac.Token, + AgentPK: ac.PK, + Cert: ac.Cert, + ProgramDir: pd, + EXE: exe, + SystemDrive: sd, + MeshInstaller: "meshagent.exe", + MeshSystemEXE: MeshSysExe, + MeshSVC: meshSvcName, + PyBin: pybin, + Headers: headers, + Logger: logger, + Version: version, + Debug: logger.IsLevelEnabled(logrus.DebugLevel), + rClient: restyC, + Proxy: ac.Proxy, + Platform: runtime.GOOS, + GoArch: runtime.GOARCH, + ServiceConfig: svcConf, + NatsServer: natsServer, + NatsProxyPath: natsProxyPath, + NatsProxyPort: natsProxyPort, + NatsPingInterval: natsPingInterval, + NatsWSCompression: natsWsCompression, } } @@ -399,14 +412,18 @@ func (a *Agent) SyncMeshNodeID() { } func (a *Agent) setupNatsOptions() []nats.Option { + reconnectWait := randRange(2, 8) opts := make([]nats.Option, 0) opts = append(opts, nats.Name(a.AgentID)) opts = append(opts, nats.UserInfo(a.AgentID, a.Token)) - opts = append(opts, nats.ReconnectWait(time.Second*5)) + opts = append(opts, nats.ReconnectWait(time.Duration(reconnectWait)*time.Second)) opts = append(opts, nats.RetryOnFailedConnect(true)) + opts = append(opts, nats.PingInterval(time.Duration(a.NatsPingInterval)*time.Second)) + opts = append(opts, nats.Compression(a.NatsWSCompression)) opts = append(opts, nats.MaxReconnects(-1)) opts = append(opts, nats.ReconnectBufSize(-1)) opts = append(opts, nats.ProxyPath(a.NatsProxyPath)) + opts = append(opts, nats.ReconnectJitter(500*time.Millisecond, 4*time.Second)) opts = append(opts, nats.DisconnectErrHandler(func(nc *nats.Conn, err error) { a.Logger.Errorln("NATS disconnected:", err) a.Logger.Errorf("%+v\n", nc.Statistics) diff --git a/agent/agent_unix.go b/agent/agent_unix.go index f33a307..a3b06f1 100644 --- a/agent/agent_unix.go +++ b/agent/agent_unix.go @@ -158,6 +158,7 @@ func NewAgentConfig() *rmm.AgentConfig { NatsProxyPath: viper.GetString("natsproxypath"), NatsProxyPort: viper.GetString("natsproxyport"), NatsStandardPort: viper.GetString("natsstandardport"), + NatsPingInterval: viper.GetInt("natspinginterval"), } return ret } diff --git a/agent/agent_windows.go b/agent/agent_windows.go index 446ddd6..263d1c1 100644 --- a/agent/agent_windows.go +++ b/agent/agent_windows.go @@ -65,6 +65,8 @@ func NewAgentConfig() *rmm.AgentConfig { natsProxyPath, _, _ := k.GetStringValue("NatsProxyPath") natsProxyPort, _, _ := k.GetStringValue("NatsProxyPort") natsStandardPort, _, _ := k.GetStringValue("NatsStandardPort") + natsPingInterval, _, _ := k.GetStringValue("NatsPingInterval") + npi, _ := strconv.Atoi(natsPingInterval) return &rmm.AgentConfig{ BaseURL: baseurl, @@ -79,6 +81,7 @@ func NewAgentConfig() *rmm.AgentConfig { NatsProxyPath: natsProxyPath, NatsProxyPort: natsProxyPort, NatsStandardPort: natsStandardPort, + NatsPingInterval: npi, } } diff --git a/agent/rpc.go b/agent/rpc.go index b883ead..5eaf456 100644 --- a/agent/rpc.go +++ b/agent/rpc.go @@ -55,6 +55,8 @@ func (a *Agent) RunRPC() { opts := a.setupNatsOptions() nc, err := nats.Connect(a.NatsServer, opts...) + a.Logger.Debugf("%+v\n", nc) + a.Logger.Debugf("%+v\n", nc.Opts) if err != nil { a.Logger.Fatalln("RunRPC() nats.Connect()", err) } diff --git a/shared/types.go b/shared/types.go index de7f2a9..f857ccb 100644 --- a/shared/types.go +++ b/shared/types.go @@ -45,6 +45,7 @@ type AgentConfig struct { NatsProxyPath string NatsProxyPort string NatsStandardPort string + NatsPingInterval int } type RunScriptResp struct { From 8d7dfeef25259af14d8c8fd010e27a353192a5aa Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Tue, 29 Nov 2022 19:50:52 +0000 Subject: [PATCH 051/113] fix unix --- agent/agent_unix.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/agent/agent_unix.go b/agent/agent_unix.go index a3b06f1..b3af98e 100644 --- a/agent/agent_unix.go +++ b/agent/agent_unix.go @@ -163,7 +163,7 @@ func NewAgentConfig() *rmm.AgentConfig { return ret } -func (a *Agent) RunScript(code string, shell string, args []string, timeout int, runasuser bool) (stdout, stderr string, exitcode int, e error) { +func (a *Agent) RunScript(code string, shell string, args []string, timeout int, runasuser bool, envVars []string) (stdout, stderr string, exitcode int, e error) { code = removeWinNewLines(code) content := []byte(code) @@ -193,6 +193,7 @@ func (a *Agent) RunScript(code string, shell string, args []string, timeout int, opts.IsScript = true opts.Shell = f.Name() opts.Args = args + opts.EnvVars = envVars opts.Timeout = time.Duration(timeout) out := a.CmdV2(opts) retError := "" From c71e495184cd6dbd5aebc457fba151bf0f0d995c Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Wed, 30 Nov 2022 16:28:06 -0800 Subject: [PATCH 052/113] update deps --- go.mod | 4 ++-- go.sum | 4 ++++ main.go | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index e31b3d0..361ae4a 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.19 require ( github.com/StackExchange/wmi v1.2.1 - github.com/elastic/go-sysinfo v1.8.1 + github.com/elastic/go-sysinfo v1.9.0 github.com/go-ole/go-ole v1.2.6 github.com/go-ping/ping v1.1.0 github.com/go-resty/resty/v2 v2.7.0 @@ -55,7 +55,7 @@ require ( github.com/pelletier/go-toml/v2 v2.0.5 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c // indirect - github.com/prometheus/procfs v0.7.3 // indirect + github.com/prometheus/procfs v0.8.0 // indirect github.com/rickb777/plural v1.4.1 // indirect github.com/rogpeppe/go-internal v1.8.1 // indirect github.com/scjalliance/comshim v0.0.0-20190308082608-cf06d2532c4e // indirect diff --git a/go.sum b/go.sum index 75321c6..d35e81e 100644 --- a/go.sum +++ b/go.sum @@ -59,6 +59,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/elastic/go-sysinfo v1.8.1 h1:4Yhj+HdV6WjbCRgGdZpPJ8lZQlXZLKDAeIkmQ/VRvi4= github.com/elastic/go-sysinfo v1.8.1/go.mod h1:JfllUnzoQV/JRYymbH3dO1yggI3mV2oTKSXsDHM+uIM= +github.com/elastic/go-sysinfo v1.9.0 h1:usICqY/Nw4Mpn9f4LdtpFrKxXroJDe81GaxxUlCckIo= +github.com/elastic/go-sysinfo v1.9.0/go.mod h1:eBD1wEGVaRnRLGecc9iG1z8eOv5HnEdz9+nWd8UAxcE= github.com/elastic/go-windows v1.0.1 h1:AlYZOldA+UJ0/2nBuqWdo90GFCgG9xuyw9SYzGUtJm0= github.com/elastic/go-windows v1.0.1/go.mod h1:FoVvqWSun28vaDQPbj2Elfc0JahhPB7WQEGa3c814Ss= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= @@ -245,6 +247,8 @@ github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c/go.mod h1:Om github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/procfs v0.7.3 h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0VU= github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5mo= +github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= github.com/rickb777/date v1.14.2/go.mod h1:swmf05C+hN+m8/Xh7gEq3uB6QJDNc5pQBWojKdHetOs= github.com/rickb777/date v1.19.1 h1:IMcFlWY3PagAcc274tJAag84+dh4ihusPxhu4jaHMwY= github.com/rickb777/date v1.19.1/go.mod h1:NxzFOW9ZWNeOWWE2kUXLDN59GSuGMsu3E4YVVk+GcVU= diff --git a/main.go b/main.go index 36cc94a..52f95ce 100644 --- a/main.go +++ b/main.go @@ -25,7 +25,7 @@ import ( ) var ( - version = "2.4.2" + version = "2.4.3-dev" log = logrus.New() logFile *os.File ) From de01fa5d80c31890e21ee243bf3b2bb03dc3f31b Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Wed, 30 Nov 2022 17:13:55 -0800 Subject: [PATCH 053/113] change logging levels --- agent/agent.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/agent/agent.go b/agent/agent.go index a5d36fb..d9e573b 100644 --- a/agent/agent.go +++ b/agent/agent.go @@ -425,12 +425,12 @@ func (a *Agent) setupNatsOptions() []nats.Option { opts = append(opts, nats.ProxyPath(a.NatsProxyPath)) opts = append(opts, nats.ReconnectJitter(500*time.Millisecond, 4*time.Second)) opts = append(opts, nats.DisconnectErrHandler(func(nc *nats.Conn, err error) { - a.Logger.Errorln("NATS disconnected:", err) - a.Logger.Errorf("%+v\n", nc.Statistics) + a.Logger.Debugln("NATS disconnected:", err) + a.Logger.Debugf("%+v\n", nc.Statistics) })) opts = append(opts, nats.ReconnectHandler(func(nc *nats.Conn) { - a.Logger.Infoln("NATS reconnected") - a.Logger.Infof("%+v\n", nc.Statistics) + a.Logger.Debugln("NATS reconnected") + a.Logger.Debugf("%+v\n", nc.Statistics) })) opts = append(opts, nats.ErrorHandler(func(nc *nats.Conn, sub *nats.Subscription, err error) { a.Logger.Errorln("NATS error:", err) From ec6ea9adedc28e7d44414760f59098067e469d73 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Fri, 2 Dec 2022 23:22:14 -0800 Subject: [PATCH 054/113] add local config --- agent/agent_unix.go | 3 +++ agent/agent_windows.go | 37 +++++++++++++++++++++++++++++++++++++ agent/svc.go | 26 +++++++++++++------------- agent/utils.go | 8 ++++++++ 4 files changed, 61 insertions(+), 13 deletions(-) diff --git a/agent/agent_unix.go b/agent/agent_unix.go index b3af98e..c0488d6 100644 --- a/agent/agent_unix.go +++ b/agent/agent_unix.go @@ -493,6 +493,9 @@ func (a *Agent) GetWMIInfo() map[string]interface{} { } // windows only below TODO add into stub file +func (a *Agent) GetAgentCheckInConfig(ret AgentCheckInConfig) AgentCheckInConfig { + return ret +} func (a *Agent) PlatVer() (string, error) { return "", nil } diff --git a/agent/agent_windows.go b/agent/agent_windows.go index 263d1c1..f211987 100644 --- a/agent/agent_windows.go +++ b/agent/agent_windows.go @@ -863,6 +863,43 @@ func (a *Agent) InstallService() error { return service.Control(s, "install") } +func (a *Agent) GetAgentCheckInConfig(ret AgentCheckInConfig) AgentCheckInConfig { + // if local config present, overwrite + k, err := registry.OpenKey(registry.LOCAL_MACHINE, `SOFTWARE\TacticalRMM`, registry.ALL_ACCESS) + if err == nil { + if checkInHello, _, err := k.GetStringValue("CheckInHello"); err == nil { + ret.Hello = regRangeToInt(checkInHello) + } + if checkInAgentInfo, _, err := k.GetStringValue("CheckInAgentInfo"); err == nil { + ret.AgentInfo = regRangeToInt(checkInAgentInfo) + } + if checkInWinSvc, _, err := k.GetStringValue("CheckInWinSvc"); err == nil { + ret.WinSvc = regRangeToInt(checkInWinSvc) + } + if checkInPubIP, _, err := k.GetStringValue("CheckInPubIP"); err == nil { + ret.PubIP = regRangeToInt(checkInPubIP) + } + if checkInDisks, _, err := k.GetStringValue("CheckInDisks"); err == nil { + ret.Disks = regRangeToInt(checkInDisks) + } + if checkInSW, _, err := k.GetStringValue("CheckInSW"); err == nil { + ret.SW = regRangeToInt(checkInSW) + } + if checkInWMI, _, err := k.GetStringValue("CheckInWMI"); err == nil { + ret.WMI = regRangeToInt(checkInWMI) + } + if checkInSyncMesh, _, err := k.GetStringValue("CheckInSyncMesh"); err == nil { + ret.SyncMesh = regRangeToInt(checkInSyncMesh) + } + if checkInLimitData, _, err := k.GetStringValue("CheckInLimitData"); err == nil { + if checkInLimitData == "true" { + ret.LimitData = true + } + } + } + return ret +} + // TODO add to stub func (a *Agent) NixMeshNodeID() string { return "not implemented" diff --git a/agent/svc.go b/agent/svc.go index 24d72d8..cdaa11e 100644 --- a/agent/svc.go +++ b/agent/svc.go @@ -55,7 +55,8 @@ func (a *Agent) AgentSvc(nc *nats.Conn) { a.Logger.Debugf("AgentSvc() sleeping for %v seconds", sleepDelay) time.Sleep(time.Duration(sleepDelay) * time.Second) - conf := a.GetAgentCheckInConfig() + conf := a.GetAgentCheckInConfig(a.GetCheckInConfFromAPI()) + a.Logger.Debugf("+%v\n", conf) for _, s := range natsCheckin { if conf.LimitData && stringInSlice(s, limitNatsData) { continue @@ -113,7 +114,7 @@ func (a *Agent) AgentStartup() { } } -func (a *Agent) GetAgentCheckInConfig() AgentCheckInConfig { +func (a *Agent) GetCheckInConfFromAPI() AgentCheckInConfig { ret := AgentCheckInConfig{} url := fmt.Sprintf("/api/v3/%s/config/", a.AgentID) r, err := a.rClient.R().SetResult(&AgentCheckInConfig{}).Get(url) @@ -128,17 +129,16 @@ func (a *Agent) GetAgentCheckInConfig() AgentCheckInConfig { ret.WMI = randRange(3000, 4000) ret.SyncMesh = randRange(800, 1200) ret.LimitData = false - return ret + } else { + ret.Hello = r.Result().(*AgentCheckInConfig).Hello + ret.AgentInfo = r.Result().(*AgentCheckInConfig).AgentInfo + ret.WinSvc = r.Result().(*AgentCheckInConfig).WinSvc + ret.PubIP = r.Result().(*AgentCheckInConfig).PubIP + ret.Disks = r.Result().(*AgentCheckInConfig).Disks + ret.SW = r.Result().(*AgentCheckInConfig).SW + ret.WMI = r.Result().(*AgentCheckInConfig).WMI + ret.SyncMesh = r.Result().(*AgentCheckInConfig).SyncMesh + ret.LimitData = r.Result().(*AgentCheckInConfig).LimitData } - ret.Hello = r.Result().(*AgentCheckInConfig).Hello - ret.AgentInfo = r.Result().(*AgentCheckInConfig).AgentInfo - ret.WinSvc = r.Result().(*AgentCheckInConfig).WinSvc - ret.PubIP = r.Result().(*AgentCheckInConfig).PubIP - ret.Disks = r.Result().(*AgentCheckInConfig).Disks - ret.SW = r.Result().(*AgentCheckInConfig).SW - ret.WMI = r.Result().(*AgentCheckInConfig).WMI - ret.SyncMesh = r.Result().(*AgentCheckInConfig).SyncMesh - ret.LimitData = r.Result().(*AgentCheckInConfig).LimitData - a.Logger.Debugf("%+v\n", r) return ret } diff --git a/agent/utils.go b/agent/utils.go index ede7753..3e84288 100644 --- a/agent/utils.go +++ b/agent/utils.go @@ -23,6 +23,7 @@ import ( "path/filepath" "runtime" goDebug "runtime/debug" + "strconv" "strings" "time" @@ -331,3 +332,10 @@ func stringInSlice(a string, list []string) bool { } return false } + +func regRangeToInt(s string) int { + split := strings.Split(s, ",") + min, _ := strconv.Atoi(split[0]) + max, _ := strconv.Atoi(split[1]) + return randRange(min, max) +} From 3cb6b92a804f4ca4bcad67905844c4e6c43ca4a9 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Fri, 2 Dec 2022 23:34:09 -0800 Subject: [PATCH 055/113] tidy --- go.sum | 5 ----- 1 file changed, 5 deletions(-) diff --git a/go.sum b/go.sum index d35e81e..bc6b194 100644 --- a/go.sum +++ b/go.sum @@ -57,8 +57,6 @@ github.com/creachadair/staticfile v0.1.3/go.mod h1:a3qySzCIXEprDGxk6tSxSI+dBBdLz github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/elastic/go-sysinfo v1.8.1 h1:4Yhj+HdV6WjbCRgGdZpPJ8lZQlXZLKDAeIkmQ/VRvi4= -github.com/elastic/go-sysinfo v1.8.1/go.mod h1:JfllUnzoQV/JRYymbH3dO1yggI3mV2oTKSXsDHM+uIM= github.com/elastic/go-sysinfo v1.9.0 h1:usICqY/Nw4Mpn9f4LdtpFrKxXroJDe81GaxxUlCckIo= github.com/elastic/go-sysinfo v1.9.0/go.mod h1:eBD1wEGVaRnRLGecc9iG1z8eOv5HnEdz9+nWd8UAxcE= github.com/elastic/go-windows v1.0.1 h1:AlYZOldA+UJ0/2nBuqWdo90GFCgG9xuyw9SYzGUtJm0= @@ -245,8 +243,6 @@ github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:Om github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c h1:NRoLoZvkBTKvR5gQLgA3e0hqjkY9u1wm+iOL45VN/qI= github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/procfs v0.7.3 h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0VU= -github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5mo= github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= github.com/rickb777/date v1.14.2/go.mod h1:swmf05C+hN+m8/Xh7gEq3uB6QJDNc5pQBWojKdHetOs= @@ -459,7 +455,6 @@ golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= From 524837627fbc7208078f32b0591c801a20303f78 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Sat, 3 Dec 2022 01:58:42 -0800 Subject: [PATCH 056/113] add env for script checks --- agent/checks.go | 2 +- shared/types.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/agent/checks.go b/agent/checks.go index ec44b04..00925d7 100644 --- a/agent/checks.go +++ b/agent/checks.go @@ -169,7 +169,7 @@ type ScriptCheckResult struct { // ScriptCheck runs either bat, powershell or python script func (a *Agent) ScriptCheck(data rmm.Check, r *resty.Client) { start := time.Now() - stdout, stderr, retcode, _ := a.RunScript(data.Script.Code, data.Script.Shell, data.ScriptArgs, data.Timeout, data.Script.RunAsUser, data.Script.EnvVars) + stdout, stderr, retcode, _ := a.RunScript(data.Script.Code, data.Script.Shell, data.ScriptArgs, data.Timeout, data.Script.RunAsUser, data.EnvVars) payload := ScriptCheckResult{ ID: data.CheckPK, diff --git a/shared/types.go b/shared/types.go index f857ccb..5ff983d 100644 --- a/shared/types.go +++ b/shared/types.go @@ -163,6 +163,7 @@ type Check struct { Disk string `json:"disk"` IP string `json:"ip"` ScriptArgs []string `json:"script_args"` + EnvVars []string `json:"env_vars"` Timeout int `json:"timeout"` ServiceName string `json:"svc_name"` PassStartPending bool `json:"pass_if_start_pending"` From 63fe3bcd73f0f9b9e89724ff4237885d200fb3d9 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Sun, 4 Dec 2022 15:09:48 -0800 Subject: [PATCH 057/113] bump versions --- build/rmm.exe.manifest | 2 +- build/setup.iss | 2 +- main.go | 2 +- versioninfo.json | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/build/rmm.exe.manifest b/build/rmm.exe.manifest index c18eeec..56445b7 100644 --- a/build/rmm.exe.manifest +++ b/build/rmm.exe.manifest @@ -3,7 +3,7 @@ diff --git a/build/setup.iss b/build/setup.iss index 9f61bec..1c1b1e3 100644 --- a/build/setup.iss +++ b/build/setup.iss @@ -1,5 +1,5 @@ #define MyAppName "Tactical RMM Agent" -#define MyAppVersion "2.4.2" +#define MyAppVersion "2.4.3" #define MyAppPublisher "AmidaWare LLC" #define MyAppURL "https://github.com/amidaware" #define MyAppExeName "tacticalrmm.exe" diff --git a/main.go b/main.go index 52f95ce..1e2c402 100644 --- a/main.go +++ b/main.go @@ -25,7 +25,7 @@ import ( ) var ( - version = "2.4.3-dev" + version = "2.4.3" log = logrus.New() logFile *os.File ) diff --git a/versioninfo.json b/versioninfo.json index 6cb8e61..695415b 100644 --- a/versioninfo.json +++ b/versioninfo.json @@ -3,13 +3,13 @@ "FileVersion": { "Major": 2, "Minor": 4, - "Patch": 2, + "Patch": 3, "Build": 0 }, "ProductVersion": { "Major": 2, "Minor": 4, - "Patch": 2, + "Patch": 3, "Build": 0 }, "FileFlagsMask": "3f", @@ -22,14 +22,14 @@ "Comments": "", "CompanyName": "AmidaWare LLC", "FileDescription": "Tactical RMM Agent", - "FileVersion": "v2.4.2.0", + "FileVersion": "v2.4.3.0", "InternalName": "tacticalrmm.exe", "LegalCopyright": "Copyright (c) 2022 AmidaWare LLC", "LegalTrademarks": "", "OriginalFilename": "tacticalrmm.exe", "PrivateBuild": "", "ProductName": "Tactical RMM Agent", - "ProductVersion": "v2.4.2.0", + "ProductVersion": "v2.4.3.0", "SpecialBuild": "" }, "VarFileInfo": { From 293151ea0a87489cc9df481166672c9ba29b9ecb Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Sun, 11 Dec 2022 23:47:16 -0800 Subject: [PATCH 058/113] fix choco not found in path --- agent/choco_windows.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/agent/choco_windows.go b/agent/choco_windows.go index 1ba6058..5053f09 100644 --- a/agent/choco_windows.go +++ b/agent/choco_windows.go @@ -12,6 +12,9 @@ https://license.tacticalrmm.com package agent import ( + "os" + "os/exec" + "path/filepath" "time" rmm "github.com/amidaware/rmmagent/shared" @@ -59,7 +62,14 @@ func (a *Agent) InstallChoco() { } func (a *Agent) InstallWithChoco(name string) (string, error) { - out, err := CMD("choco.exe", []string{"install", name, "--yes", "--force", "--force-dependencies", "--no-progress"}, 1200, false) + var exe string + choco, err := exec.LookPath("choco.exe") + if err != nil || choco == "" { + exe = filepath.Join(os.Getenv("PROGRAMDATA"), `chocolatey\bin\choco.exe`) + } else { + exe = choco + } + out, err := CMD(exe, []string{"install", name, "--yes", "--force", "--force-dependencies", "--no-progress"}, 1200, false) if err != nil { a.Logger.Errorln(err) return err.Error(), err From c3e33a6def6ee4d12bfa88e814c53d436d674a8f Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Sun, 11 Dec 2022 23:50:00 -0800 Subject: [PATCH 059/113] fix path on exchange servers fixes amidaware/tacticalrmm#1359 --- agent/agent_windows.go | 14 ++++++++------ agent/utils.go | 17 +++++++++++++++++ 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/agent/agent_windows.go b/agent/agent_windows.go index f211987..b19a185 100644 --- a/agent/agent_windows.go +++ b/agent/agent_windows.go @@ -132,7 +132,7 @@ func (a *Agent) RunScript(code string, shell string, args []string, timeout int, switch shell { case "powershell": - exe = "Powershell" + exe = getPowershellExe() cmdArgs = []string{"-NonInteractive", "-NoProfile", "-ExecutionPolicy", "Bypass", tmpfn.Name()} case "python": exe = a.PyBin @@ -260,23 +260,25 @@ func CMDShell(shell string, cmdArgs []string, command string, timeout int, detac defer cancel() sysProcAttr := &windows.SysProcAttr{} + cmdExe := getCMDExe() + powershell := getPowershellExe() if len(cmdArgs) > 0 && command == "" { switch shell { case "cmd": cmdArgs = append([]string{"/C"}, cmdArgs...) - cmd = exec.Command("cmd.exe", cmdArgs...) + cmd = exec.Command(cmdExe, cmdArgs...) case "powershell": cmdArgs = append([]string{"-NonInteractive", "-NoProfile"}, cmdArgs...) - cmd = exec.Command("powershell.exe", cmdArgs...) + cmd = exec.Command(powershell, cmdArgs...) } } else { switch shell { case "cmd": - cmd = exec.Command("cmd.exe") - sysProcAttr.CmdLine = fmt.Sprintf("cmd.exe /C %s", command) + cmd = exec.Command(cmdExe) + sysProcAttr.CmdLine = fmt.Sprintf("%s /C %s", cmdExe, command) case "powershell": - cmd = exec.Command("Powershell", "-NonInteractive", "-NoProfile", command) + cmd = exec.Command(powershell, "-NonInteractive", "-NoProfile", command) } } diff --git a/agent/utils.go b/agent/utils.go index 3e84288..093fa1b 100644 --- a/agent/utils.go +++ b/agent/utils.go @@ -20,6 +20,7 @@ import ( "math/rand" "net" "os" + "os/exec" "path/filepath" "runtime" goDebug "runtime/debug" @@ -339,3 +340,19 @@ func regRangeToInt(s string) int { max, _ := strconv.Atoi(split[1]) return randRange(min, max) } + +func getPowershellExe() string { + powershell, err := exec.LookPath("powershell.exe") + if err != nil || powershell == "" { + return filepath.Join(os.Getenv("WINDIR"), `System32\WindowsPowerShell\v1.0\powershell.exe`) + } + return powershell +} + +func getCMDExe() string { + cmdExe, err := exec.LookPath("cmd.exe") + if err != nil || cmdExe == "" { + return filepath.Join(os.Getenv("WINDIR"), `System32\cmd.exe`) + } + return cmdExe +} From 4b1f993a7633c3f69d49cd6ee4ae509c3896d19b Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Sun, 11 Dec 2022 23:52:06 -0800 Subject: [PATCH 060/113] fix ping check fixes amidaware/tacticalrmm#812 --- agent/utils.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/agent/utils.go b/agent/utils.go index 093fa1b..41715bd 100644 --- a/agent/utils.go +++ b/agent/utils.go @@ -61,7 +61,7 @@ func DoPing(host string) (PingResponse, error) { } pinger.Count = 3 - pinger.Size = 24 + pinger.Size = 548 pinger.Interval = time.Second pinger.Timeout = 5 * time.Second pinger.SetPrivileged(true) From ff75a8eb8995716cb696f547312314b1b48a6aa4 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Tue, 20 Dec 2022 16:07:42 -0800 Subject: [PATCH 061/113] update nats --- go.mod | 4 ++-- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 361ae4a..c41cae6 100644 --- a/go.mod +++ b/go.mod @@ -10,8 +10,8 @@ require ( github.com/go-resty/resty/v2 v2.7.0 github.com/gonutz/w32/v2 v2.4.0 github.com/iamacarpet/go-win64api v0.0.0-20220531131246-e84054eb584d - github.com/nats-io/nats-server/v2 v2.9.8 // indirect - github.com/nats-io/nats.go v1.20.0 + github.com/nats-io/nats-server/v2 v2.9.10 // indirect + github.com/nats-io/nats.go v1.22.0 github.com/rickb777/date v1.19.1 github.com/shirou/gopsutil/v3 v3.22.10 github.com/sirupsen/logrus v1.9.0 diff --git a/go.sum b/go.sum index bc6b194..306b47c 100644 --- a/go.sum +++ b/go.sum @@ -212,10 +212,10 @@ github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrk github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/nats-io/jwt/v2 v2.3.0 h1:z2mA1a7tIf5ShggOFlR1oBPgd6hGqcDYsISxZByUzdI= -github.com/nats-io/nats-server/v2 v2.9.8 h1:jgxZsv+A3Reb3MgwxaINcNq/za8xZInKhDg9Q0cGN1o= -github.com/nats-io/nats-server/v2 v2.9.8/go.mod h1:AB6hAnGZDlYfqb7CTAm66ZKMZy9DpfierY1/PbpvI2g= -github.com/nats-io/nats.go v1.20.0 h1:T8JJnQfVSdh1CzGiwAOv5hEobYCBho/0EupGznYw0oM= -github.com/nats-io/nats.go v1.20.0/go.mod h1:tLqubohF7t4z3du1QDPYJIQQyhb4wl6DhjxEajSI7UA= +github.com/nats-io/nats-server/v2 v2.9.10 h1:LMC46Oi9E6BUx/xBsaCVZgofliAqKQzRPU6eKWkN8jE= +github.com/nats-io/nats-server/v2 v2.9.10/go.mod h1:AB6hAnGZDlYfqb7CTAm66ZKMZy9DpfierY1/PbpvI2g= +github.com/nats-io/nats.go v1.22.0 h1:3dxyVf+S449DbMriqQV27HgSbXklxT9SUKbDKIxhrV0= +github.com/nats-io/nats.go v1.22.0/go.mod h1:tLqubohF7t4z3du1QDPYJIQQyhb4wl6DhjxEajSI7UA= github.com/nats-io/nkeys v0.3.0 h1:cgM5tL53EvYRU+2YLXIK0G2mJtK12Ft9oeooSZMA2G8= github.com/nats-io/nkeys v0.3.0/go.mod h1:gvUNGjVcM2IPr5rCsRsC6Wb3Hr2CQAm08dsxtV6A5y4= github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw= From d3b7d4090b369b9782a0ceb4971f4ed731d38823 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Tue, 20 Dec 2022 16:08:18 -0800 Subject: [PATCH 062/113] retry on failed auth --- agent/agent.go | 1 + 1 file changed, 1 insertion(+) diff --git a/agent/agent.go b/agent/agent.go index d9e573b..f3cbadc 100644 --- a/agent/agent.go +++ b/agent/agent.go @@ -418,6 +418,7 @@ func (a *Agent) setupNatsOptions() []nats.Option { opts = append(opts, nats.UserInfo(a.AgentID, a.Token)) opts = append(opts, nats.ReconnectWait(time.Duration(reconnectWait)*time.Second)) opts = append(opts, nats.RetryOnFailedConnect(true)) + opts = append(opts, nats.IgnoreAuthErrorAbort()) opts = append(opts, nats.PingInterval(time.Duration(a.NatsPingInterval)*time.Second)) opts = append(opts, nats.Compression(a.NatsWSCompression)) opts = append(opts, nats.MaxReconnects(-1)) From 396d7db8353b572d09ed0bde12faa4e04d284ab2 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Wed, 21 Dec 2022 11:10:18 -0800 Subject: [PATCH 063/113] bump version --- build/rmm.exe.manifest | 2 +- build/setup.iss | 2 +- main.go | 2 +- versioninfo.json | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/build/rmm.exe.manifest b/build/rmm.exe.manifest index 56445b7..1d2abaf 100644 --- a/build/rmm.exe.manifest +++ b/build/rmm.exe.manifest @@ -3,7 +3,7 @@ diff --git a/build/setup.iss b/build/setup.iss index 1c1b1e3..892f905 100644 --- a/build/setup.iss +++ b/build/setup.iss @@ -1,5 +1,5 @@ #define MyAppName "Tactical RMM Agent" -#define MyAppVersion "2.4.3" +#define MyAppVersion "2.4.4" #define MyAppPublisher "AmidaWare LLC" #define MyAppURL "https://github.com/amidaware" #define MyAppExeName "tacticalrmm.exe" diff --git a/main.go b/main.go index 1e2c402..e4f68ab 100644 --- a/main.go +++ b/main.go @@ -25,7 +25,7 @@ import ( ) var ( - version = "2.4.3" + version = "2.4.4" log = logrus.New() logFile *os.File ) diff --git a/versioninfo.json b/versioninfo.json index 695415b..c65e363 100644 --- a/versioninfo.json +++ b/versioninfo.json @@ -3,13 +3,13 @@ "FileVersion": { "Major": 2, "Minor": 4, - "Patch": 3, + "Patch": 4, "Build": 0 }, "ProductVersion": { "Major": 2, "Minor": 4, - "Patch": 3, + "Patch": 4, "Build": 0 }, "FileFlagsMask": "3f", @@ -22,14 +22,14 @@ "Comments": "", "CompanyName": "AmidaWare LLC", "FileDescription": "Tactical RMM Agent", - "FileVersion": "v2.4.3.0", + "FileVersion": "v2.4.4.0", "InternalName": "tacticalrmm.exe", "LegalCopyright": "Copyright (c) 2022 AmidaWare LLC", "LegalTrademarks": "", "OriginalFilename": "tacticalrmm.exe", "PrivateBuild": "", "ProductName": "Tactical RMM Agent", - "ProductVersion": "v2.4.3.0", + "ProductVersion": "v2.4.4.0", "SpecialBuild": "" }, "VarFileInfo": { From 08b6b5ecda7095801ce2826993ea0337ec370982 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Mon, 27 Feb 2023 21:24:37 +0000 Subject: [PATCH 064/113] update reqs --- go.mod | 33 ++++++++++++------------ go.sum | 81 +++++++++++++++++++++++++--------------------------------- 2 files changed, 51 insertions(+), 63 deletions(-) diff --git a/go.mod b/go.mod index c41cae6..b2be325 100644 --- a/go.mod +++ b/go.mod @@ -10,16 +10,16 @@ require ( github.com/go-resty/resty/v2 v2.7.0 github.com/gonutz/w32/v2 v2.4.0 github.com/iamacarpet/go-win64api v0.0.0-20220531131246-e84054eb584d - github.com/nats-io/nats-server/v2 v2.9.10 // indirect - github.com/nats-io/nats.go v1.22.0 + github.com/nats-io/nats-server/v2 v2.9.14 // indirect + github.com/nats-io/nats.go v1.24.0 github.com/rickb777/date v1.19.1 - github.com/shirou/gopsutil/v3 v3.22.10 + github.com/shirou/gopsutil/v3 v3.23.1 github.com/sirupsen/logrus v1.9.0 - github.com/ugorji/go/codec v1.2.7 + github.com/ugorji/go/codec v1.2.10 github.com/wh1te909/go-win64api v0.0.0-20210906074314-ab23795a6ae5 github.com/wh1te909/trmm-shared v0.0.0-20220227075846-f9f757361139 - golang.org/x/net v0.0.0-20221014081412-f15817d10f9b // indirect - golang.org/x/sys v0.0.0-20220928140112-f11e5e49a4ec + golang.org/x/net v0.5.0 // indirect + golang.org/x/sys v0.4.0 ) require ( @@ -29,9 +29,9 @@ require ( require ( github.com/fourcorelabs/wintoken v1.0.0 - github.com/jaypipes/ghw v0.9.0 + github.com/jaypipes/ghw v0.10.0 github.com/kardianos/service v1.2.2 - github.com/spf13/viper v1.14.0 + github.com/spf13/viper v1.15.0 ) require ( @@ -45,31 +45,30 @@ require ( github.com/jaypipes/pcidb v1.0.0 // indirect github.com/joeshaw/multierror v0.0.0-20140124173710-69b34d4ec901 // indirect github.com/lufia/plan9stats v0.0.0-20220517141722-cf486979b281 // indirect - github.com/magiconair/properties v1.8.6 // indirect + github.com/magiconair/properties v1.8.7 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/nats-io/nkeys v0.3.0 // indirect github.com/nats-io/nuid v1.0.1 // indirect github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d // indirect - github.com/pelletier/go-toml v1.9.5 // indirect - github.com/pelletier/go-toml/v2 v2.0.5 // indirect + github.com/pelletier/go-toml/v2 v2.0.6 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c // indirect github.com/prometheus/procfs v0.8.0 // indirect github.com/rickb777/plural v1.4.1 // indirect github.com/rogpeppe/go-internal v1.8.1 // indirect github.com/scjalliance/comshim v0.0.0-20190308082608-cf06d2532c4e // indirect - github.com/spf13/afero v1.9.2 // indirect + github.com/spf13/afero v1.9.3 // indirect github.com/spf13/cast v1.5.0 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect - github.com/subosito/gotenv v1.4.1 // indirect - github.com/tklauser/go-sysconf v0.3.10 // indirect - github.com/tklauser/numcpus v0.5.0 // indirect + github.com/subosito/gotenv v1.4.2 // indirect + github.com/tklauser/go-sysconf v0.3.11 // indirect + github.com/tklauser/numcpus v0.6.0 // indirect github.com/yusufpapurcu/wmi v1.2.2 // indirect - golang.org/x/crypto v0.0.0-20220926161630-eccd6366d1be // indirect + golang.org/x/crypto v0.5.0 // indirect golang.org/x/sync v0.1.0 // indirect - golang.org/x/text v0.4.0 // indirect + golang.org/x/text v0.6.0 // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/toast.v1 v1.0.0-20180812000517-0a84660828b2 // indirect diff --git a/go.sum b/go.sum index 306b47c..c77f3ef 100644 --- a/go.sum +++ b/go.sum @@ -179,9 +179,8 @@ github.com/iamacarpet/go-win64api v0.0.0-20220531131246-e84054eb584d h1:oEqcxSYu github.com/iamacarpet/go-win64api v0.0.0-20220531131246-e84054eb584d/go.mod h1:B7zFQPAznj+ujXel5X+LUoK3LgY6VboCdVYHZNn7gpg= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/jaypipes/ghw v0.9.0 h1:TWF4wNIGtZcgDJaiNcFgby5BR8s2ixcUe0ydxNO2McY= -github.com/jaypipes/ghw v0.9.0/go.mod h1:dXMo19735vXOjpIBDyDYSp31sB2u4hrtRCMxInqQ64k= +github.com/jaypipes/ghw v0.10.0 h1:UHu9UX08Py315iPojADFPOkmjTsNzHj4g4adsNKKteY= +github.com/jaypipes/ghw v0.10.0/go.mod h1:jeJGbkRB2lL3/gxYzNYzEDETV1ZJ56OKr+CSeSEym+g= github.com/jaypipes/pcidb v1.0.0 h1:vtZIfkiCUE42oYbJS0TAq9XSfSmcsgo9IdxSm9qzYU8= github.com/jaypipes/pcidb v1.0.0/go.mod h1:TnYUvqhPBzCKnH34KrIX22kAeEbDCSRJ9cqLRCuNDfk= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= @@ -192,7 +191,7 @@ github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/X github.com/kardianos/service v1.2.2 h1:ZvePhAHfvo0A7Mftk/tEzqEZ7Q4lgnR8sGz4xu1YX60= github.com/kardianos/service v1.2.2/go.mod h1:CIMRFEJVL+0DS1a3Nx06NaMn4Dz63Ng6O7dl0qH0zVM= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.15.11 h1:Lcadnb3RKGin4FYM/orgq0qde+nc15E5Cbqg4B9Sx9c= +github.com/klauspost/compress v1.15.15 h1:EF27CXIuDsYJ6mmvtBRlEuB2UVOqHG1tAXgZ7yIO+lw= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= @@ -203,19 +202,18 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I= github.com/lufia/plan9stats v0.0.0-20220517141722-cf486979b281 h1:aczX6NMOtt6L4YT0fQvKkDK6LZEtdOso9sUH89V1+P0= github.com/lufia/plan9stats v0.0.0-20220517141722-cf486979b281/go.mod h1:lc+czkgO/8F7puNki5jk8QyujbfK1LOT7Wl0ON2hxyk= -github.com/magiconair/properties v1.8.6 h1:5ibWZ6iY0NctNGWo87LalDlEZ6R41TqbbDamhfG/Qzo= -github.com/magiconair/properties v1.8.6/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= +github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= +github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA/g= -github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/nats-io/jwt/v2 v2.3.0 h1:z2mA1a7tIf5ShggOFlR1oBPgd6hGqcDYsISxZByUzdI= -github.com/nats-io/nats-server/v2 v2.9.10 h1:LMC46Oi9E6BUx/xBsaCVZgofliAqKQzRPU6eKWkN8jE= -github.com/nats-io/nats-server/v2 v2.9.10/go.mod h1:AB6hAnGZDlYfqb7CTAm66ZKMZy9DpfierY1/PbpvI2g= -github.com/nats-io/nats.go v1.22.0 h1:3dxyVf+S449DbMriqQV27HgSbXklxT9SUKbDKIxhrV0= -github.com/nats-io/nats.go v1.22.0/go.mod h1:tLqubohF7t4z3du1QDPYJIQQyhb4wl6DhjxEajSI7UA= +github.com/nats-io/nats-server/v2 v2.9.14 h1:n2GscWVgXpA14vQSRP/MM1SGi4wyazR9l19/gWxqgXQ= +github.com/nats-io/nats-server/v2 v2.9.14/go.mod h1:40ZwFm4npKdFBhOdY7rkh3YyI1oI91FzLvlYyB7HfzM= +github.com/nats-io/nats.go v1.24.0 h1:CRiD8L5GOQu/DcfkmgBcTTIQORMwizF+rPk6T0RaHVQ= +github.com/nats-io/nats.go v1.24.0/go.mod h1:dVQF+BK3SzUZpwyzHedXsvH3EO38aVKuOPkkHlv5hXA= github.com/nats-io/nkeys v0.3.0 h1:cgM5tL53EvYRU+2YLXIK0G2mJtK12Ft9oeooSZMA2G8= github.com/nats-io/nkeys v0.3.0/go.mod h1:gvUNGjVcM2IPr5rCsRsC6Wb3Hr2CQAm08dsxtV6A5y4= github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw= @@ -228,10 +226,8 @@ github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108 github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.2/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.19.0 h1:4ieX6qQjPP/BfC3mpsAtIGGlxTWPeA3Inl/7DtXw1tw= -github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8= -github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= -github.com/pelletier/go-toml/v2 v2.0.5 h1:ipoSadvV8oGUjnUbMub59IDPPwfxF694nG/jwbMiyQg= -github.com/pelletier/go-toml/v2 v2.0.5/go.mod h1:OMHamSCAODeSsVrwwvcJOaoN0LIUIaFVNZzmWyNfXas= +github.com/pelletier/go-toml/v2 v2.0.6 h1:nrzqCb7j9cDFj2coyLNLaZuJTLjWjlaz6nvTvIwycIU= +github.com/pelletier/go-toml/v2 v2.0.6/go.mod h1:eumQOmlWiOPt5WriQQqoM5y18pDHwha2N+QD+EUNTek= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -257,22 +253,20 @@ github.com/rogpeppe/go-internal v1.8.1 h1:geMPLpDpQOgVyCg5z5GoRwLHepNdb71NXb67XF github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= github.com/scjalliance/comshim v0.0.0-20190308082608-cf06d2532c4e h1:+/AzLkOdIXEPrAQtwAeWOBnPQ0BnYlBW0aCZmSb47u4= github.com/scjalliance/comshim v0.0.0-20190308082608-cf06d2532c4e/go.mod h1:9Tc1SKnfACJb9N7cw2eyuI6xzy845G7uZONBsi5uPEA= -github.com/shirou/gopsutil/v3 v3.22.10 h1:4KMHdfBRYXGF9skjDWiL4RA2N+E8dRdodU/bOZpPoVg= -github.com/shirou/gopsutil/v3 v3.22.10/go.mod h1:QNza6r4YQoydyCfo6rH0blGfKahgibh4dQmV5xdFkQk= +github.com/shirou/gopsutil/v3 v3.23.1 h1:a9KKO+kGLKEvcPIs4W62v0nu3sciVDOOOPUD0Hz7z/4= +github.com/shirou/gopsutil/v3 v3.23.1/go.mod h1:NN6mnm5/0k8jw4cBfCnJtr5L7ErOTg18tMNpgFkn0hA= github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= -github.com/spf13/afero v1.9.2 h1:j49Hj62F0n+DaZ1dDCvhABaPNSGNkt32oRFxI33IEMw= -github.com/spf13/afero v1.9.2/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcDf8Y= +github.com/spf13/afero v1.9.3 h1:41FoI0fD7OR7mGcKE/aOiLkGreyf8ifIOQmJANWogMk= +github.com/spf13/afero v1.9.3/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcDf8Y= github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w= github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= -github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= -github.com/spf13/pflag v1.0.2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/viper v1.14.0 h1:Rg7d3Lo706X9tHsJMUjdiwMpHB7W8WnSVOssIY+JElU= -github.com/spf13/viper v1.14.0/go.mod h1:WT//axPky3FdvXHzGw33dNdXXXfFQqmEalje+egj8As= +github.com/spf13/viper v1.15.0 h1:js3yy885G8xwJa6iOISGFwd+qlUo5AvyXb7CiihdtiU= +github.com/spf13/viper v1.15.0/go.mod h1:fFcTBJxvhhzSJiZy8n+PeW6t8l+KeT/uTARa0jHOQLA= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= @@ -285,16 +279,14 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/subosito/gotenv v1.4.1 h1:jyEFiXpy21Wm81FBN71l9VoMMV8H8jG+qIK3GCpY6Qs= -github.com/subosito/gotenv v1.4.1/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= -github.com/tklauser/go-sysconf v0.3.10 h1:IJ1AZGZRWbY8T5Vfk04D9WOA5WSejdflXxP03OUqALw= -github.com/tklauser/go-sysconf v0.3.10/go.mod h1:C8XykCvCb+Gn0oNCWPIlcb0RuglQTYaQ2hGm7jmxEFk= -github.com/tklauser/numcpus v0.4.0/go.mod h1:1+UI3pD8NW14VMwdgJNJ1ESk2UnwhAnz5hMwiKKqXCQ= -github.com/tklauser/numcpus v0.5.0 h1:ooe7gN0fg6myJ0EKoTAf5hebTZrH52px3New/D9iJ+A= -github.com/tklauser/numcpus v0.5.0/go.mod h1:OGzpTxpcIMNGYQdit2BYL1pvk/dSOaJWjKoflh+RQjo= -github.com/ugorji/go v1.2.7/go.mod h1:nF9osbDWLy6bDVv/Rtoh6QgnvNDpmCalQV5urGCCS6M= -github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0= -github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY= +github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8= +github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= +github.com/tklauser/go-sysconf v0.3.11 h1:89WgdJhk5SNwJfu+GKyYveZ4IaJ7xAkecBo+KdJV0CM= +github.com/tklauser/go-sysconf v0.3.11/go.mod h1:GqXfhXY3kiPa0nAXPDIQIWzJbMCB7AmcWpGR8lSZfqI= +github.com/tklauser/numcpus v0.6.0 h1:kebhY2Qt+3U6RNK7UqpYNA+tJ23IBEGKkB7JQBfDYms= +github.com/tklauser/numcpus v0.6.0/go.mod h1:FEZLMke0lhOUG6w2JadTzp0a+Nl8PF/GFkQ5UVIcaL4= +github.com/ugorji/go/codec v1.2.10 h1:eimT6Lsr+2lzmSZxPhLFoOWFmQqwk0fllJJ5hEbTXtQ= +github.com/ugorji/go/codec v1.2.10/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= github.com/wh1te909/go-win64api v0.0.0-20210906074314-ab23795a6ae5 h1:8tp/+fGR+qjDQ00vm0ZorHzskquo76MY9/ChmFFunEA= github.com/wh1te909/go-win64api v0.0.0-20210906074314-ab23795a6ae5/go.mod h1:qypF+Tf23flzLX5IXuodDb1314BrDrsbwK/OhTh6HBM= github.com/wh1te909/trmm-shared v0.0.0-20220227075846-f9f757361139 h1:PfOl03o+Y+svWrfXAAu1QWUDePu1yqTq0pf4rpnN8eA= @@ -319,8 +311,8 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20210314154223-e6e6c4f2bb5b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20220926161630-eccd6366d1be h1:fmw3UbQh+nxngCAHrDCCztao/kbYFnWjoqop8dHx05A= -golang.org/x/crypto v0.0.0-20220926161630-eccd6366d1be/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.5.0 h1:U/0M97KRkSFvyD/3FSmdP5W5swImpNgle/EHFhOsQPE= +golang.org/x/crypto v0.5.0/go.mod h1:NK/OQwhpMQP3MwtdjgLlYHnH9ebylxKWv3e0fK+mkQU= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -391,8 +383,8 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211029224645-99673261e6eb/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20221014081412-f15817d10f9b h1:tvrvnPFcdzp294diPnrdZZZ8XUt2Tyj7svb7X52iDuU= -golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= +golang.org/x/net v0.5.0 h1:GyT4nK/YDHSqa1c4753ouYCDajOYKTja9Xb/OHtgvSw= +golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -464,14 +456,11 @@ golang.org/x/sys v0.0.0-20210601080250-7ecdf8ef093b/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211107104306-e0b2ad06fe42/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220319134239-a9b59b0215f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220928140112-f11e5e49a4ec h1:BkDtF2Ih9xZ7le9ndzTA7KJow28VbQW3odyk/8drmuI= -golang.org/x/sys v0.0.0-20220928140112-f11e5e49a4ec/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.4.0 h1:Zr2JFtRQNX3BCZ8YtxRE9hNJYC8J6I1MVbMg6owUp18= +golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -480,12 +469,12 @@ golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.4.0 h1:BrVqGRd7+k1DiOgtnFvAkoQEWQvBc25ouMJM6429SFg= -golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.6.0 h1:3XmdazWV+ubf7QgHSTWeykHOci5oeekaGJBLkrkaw4k= +golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20220922220347-f3bd1da661af h1:Yx9k8YCG3dvF87UAn2tu2HQLf2dt/eR1bXxpLMWeH+Y= +golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= From 1d00f0ad417e906e02db329b52af85a81feecc7f Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Mon, 27 Feb 2023 21:26:21 +0000 Subject: [PATCH 065/113] handle tmp noexec fixes #32 --- agent/utils.go | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/agent/utils.go b/agent/utils.go index 41715bd..df4c8e1 100644 --- a/agent/utils.go +++ b/agent/utils.go @@ -26,6 +26,7 @@ import ( goDebug "runtime/debug" "strconv" "strings" + "syscall" "time" ps "github.com/elastic/go-sysinfo" @@ -311,8 +312,12 @@ func removeWinNewLines(s string) string { func createTmpFile() (*os.File, error) { var f *os.File + noexec := tmpNoExec() f, err := os.CreateTemp("", "trmm") - if err != nil { + if err != nil || noexec { + if noexec { + os.Remove(f.Name()) + } cwd, err := os.Getwd() if err != nil { return f, err @@ -356,3 +361,20 @@ func getCMDExe() string { } return cmdExe } + +func tmpNoExec() bool { + if runtime.GOOS == "windows" { + return false + } + + var stat syscall.Statfs_t + var noexec bool + + tmpdir := os.TempDir() + if err := syscall.Statfs(tmpdir, &stat); err == nil { + if stat.Flags&syscall.MS_NOEXEC != 0 { + noexec = true + } + } + return noexec +} From 2316271bf932127266f7bdcf07fb4d6b0e44a2d6 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Mon, 27 Feb 2023 21:54:48 +0000 Subject: [PATCH 066/113] fix build --- agent/agent_unix.go | 45 ++++++++++++++++++++++++++++++++++++------ agent/agent_windows.go | 9 +++++++++ agent/install.go | 2 +- agent/utils.go | 38 ----------------------------------- 4 files changed, 49 insertions(+), 45 deletions(-) diff --git a/agent/agent_unix.go b/agent/agent_unix.go index c0488d6..27e18c3 100644 --- a/agent/agent_unix.go +++ b/agent/agent_unix.go @@ -167,9 +167,9 @@ func (a *Agent) RunScript(code string, shell string, args []string, timeout int, code = removeWinNewLines(code) content := []byte(code) - f, err := createTmpFile() + f, err := createNixTmpFile() if err != nil { - a.Logger.Errorln("RunScript createTmpFile()", err) + a.Logger.Errorln("RunScript createNixTmpFile()", err) return "", err.Error(), 85, err } defer os.Remove(f.Name()) @@ -226,9 +226,9 @@ func (a *Agent) AgentUpdate(url, inno, version string) { return } - f, err := createTmpFile() + f, err := createNixTmpFile() if err != nil { - a.Logger.Errorln("AgentUpdate createTmpFile()", err) + a.Logger.Errorln("AgentUpdate createNixTmpFile()", err) return } defer os.Remove(f.Name()) @@ -307,9 +307,9 @@ func (a *Agent) AgentUpdate(url, inno, version string) { } func (a *Agent) AgentUninstall(code string) { - f, err := createTmpFile() + f, err := createNixTmpFile() if err != nil { - a.Logger.Errorln("AgentUninstall createTmpFile():", err) + a.Logger.Errorln("AgentUninstall createNixTmpFile():", err) return } @@ -492,6 +492,39 @@ func (a *Agent) GetWMIInfo() map[string]interface{} { return wmiInfo } +func tmpNoExec() bool { + var stat syscall.Statfs_t + var noexec bool + + tmpdir := os.TempDir() + if err := syscall.Statfs(tmpdir, &stat); err == nil { + if stat.Flags&syscall.MS_NOEXEC != 0 { + noexec = true + } + } + return noexec +} + +func createNixTmpFile() (*os.File, error) { + var f *os.File + noexec := tmpNoExec() + f, err := os.CreateTemp("", "trmm") + if err != nil || noexec { + if noexec { + os.Remove(f.Name()) + } + cwd, err := os.Getwd() + if err != nil { + return f, err + } + f, err = os.CreateTemp(cwd, "trmm") + if err != nil { + return f, err + } + } + return f, nil +} + // windows only below TODO add into stub file func (a *Agent) GetAgentCheckInConfig(ret AgentCheckInConfig) AgentCheckInConfig { return ret diff --git a/agent/agent_windows.go b/agent/agent_windows.go index b19a185..cc5da54 100644 --- a/agent/agent_windows.go +++ b/agent/agent_windows.go @@ -906,3 +906,12 @@ func (a *Agent) GetAgentCheckInConfig(ret AgentCheckInConfig) AgentCheckInConfig func (a *Agent) NixMeshNodeID() string { return "not implemented" } + +func tmpNoExec() bool { + return false +} + +func createNixTmpFile() (*os.File, error) { + var f *os.File + return f, nil +} diff --git a/agent/install.go b/agent/install.go index 16562fc..241d64b 100644 --- a/agent/install.go +++ b/agent/install.go @@ -147,7 +147,7 @@ func (a *Agent) Install(i *Installer) { case "windows": meshOutput = filepath.Join(a.ProgramDir, a.MeshInstaller) case "darwin": - tmp, err := createTmpFile() + tmp, err := createNixTmpFile() if err != nil { a.Logger.Fatalln("Failed to create mesh temp file", err) } diff --git a/agent/utils.go b/agent/utils.go index df4c8e1..4d41ecb 100644 --- a/agent/utils.go +++ b/agent/utils.go @@ -26,7 +26,6 @@ import ( goDebug "runtime/debug" "strconv" "strings" - "syscall" "time" ps "github.com/elastic/go-sysinfo" @@ -310,26 +309,6 @@ func removeWinNewLines(s string) string { return strings.ReplaceAll(s, "\r\n", "\n") } -func createTmpFile() (*os.File, error) { - var f *os.File - noexec := tmpNoExec() - f, err := os.CreateTemp("", "trmm") - if err != nil || noexec { - if noexec { - os.Remove(f.Name()) - } - cwd, err := os.Getwd() - if err != nil { - return f, err - } - f, err = os.CreateTemp(cwd, "trmm") - if err != nil { - return f, err - } - } - return f, nil -} - func stringInSlice(a string, list []string) bool { for _, b := range list { if b == a { @@ -361,20 +340,3 @@ func getCMDExe() string { } return cmdExe } - -func tmpNoExec() bool { - if runtime.GOOS == "windows" { - return false - } - - var stat syscall.Statfs_t - var noexec bool - - tmpdir := os.TempDir() - if err := syscall.Statfs(tmpdir, &stat); err == nil { - if stat.Flags&syscall.MS_NOEXEC != 0 { - noexec = true - } - } - return noexec -} From a0828c98ab9bd4e1919a541df09be26f76e48f18 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Mon, 27 Feb 2023 22:04:56 +0000 Subject: [PATCH 067/113] fix darwin --- agent/agent_darwin.go | 16 ++++++++++++++++ agent/agent_linux.go | 30 ++++++++++++++++++++++++++++++ agent/agent_unix.go | 13 ------------- 3 files changed, 46 insertions(+), 13 deletions(-) create mode 100644 agent/agent_darwin.go create mode 100644 agent/agent_linux.go diff --git a/agent/agent_darwin.go b/agent/agent_darwin.go new file mode 100644 index 0000000..c7741c4 --- /dev/null +++ b/agent/agent_darwin.go @@ -0,0 +1,16 @@ +/* +Copyright 2022 AmidaWare LLC. + +Licensed under the Tactical RMM License Version 1.0 (the “License”). +You may only use the Licensed Software in accordance with the License. +A copy of the License is available at: + +https://license.tacticalrmm.com + +*/ + +package agent + +func tmpNoExec() bool { + return false +} diff --git a/agent/agent_linux.go b/agent/agent_linux.go new file mode 100644 index 0000000..c7d16e1 --- /dev/null +++ b/agent/agent_linux.go @@ -0,0 +1,30 @@ +/* +Copyright 2022 AmidaWare LLC. + +Licensed under the Tactical RMM License Version 1.0 (the “License”). +You may only use the Licensed Software in accordance with the License. +A copy of the License is available at: + +https://license.tacticalrmm.com + +*/ + +package agent + +import ( + "os" + "syscall" +) + +func tmpNoExec() bool { + var stat syscall.Statfs_t + var noexec bool + + tmpdir := os.TempDir() + if err := syscall.Statfs(tmpdir, &stat); err == nil { + if stat.Flags&syscall.MS_NOEXEC != 0 { + noexec = true + } + } + return noexec +} diff --git a/agent/agent_unix.go b/agent/agent_unix.go index 27e18c3..fc65765 100644 --- a/agent/agent_unix.go +++ b/agent/agent_unix.go @@ -492,19 +492,6 @@ func (a *Agent) GetWMIInfo() map[string]interface{} { return wmiInfo } -func tmpNoExec() bool { - var stat syscall.Statfs_t - var noexec bool - - tmpdir := os.TempDir() - if err := syscall.Statfs(tmpdir, &stat); err == nil { - if stat.Flags&syscall.MS_NOEXEC != 0 { - noexec = true - } - } - return noexec -} - func createNixTmpFile() (*os.File, error) { var f *os.File noexec := tmpNoExec() From 7ae664b9c685c70ebf196f5001e6edcfade8beeb Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Sun, 19 Mar 2023 18:27:41 -0700 Subject: [PATCH 068/113] update reqs --- .github/workflows/ci.yml | 2 +- go.mod | 16 ++++++++-------- go.sum | 33 +++++++++++++++++---------------- main.go | 2 +- 4 files changed, 27 insertions(+), 26 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 477fa07..53e74b1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ jobs: - uses: actions/setup-go@v3 with: - go-version: '1.19.3' + go-version: '1.20.2' - name: Ensure linux agent compiles run: | diff --git a/go.mod b/go.mod index b2be325..e059687 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/amidaware/rmmagent -go 1.19 +go 1.20 require ( github.com/StackExchange/wmi v1.2.1 @@ -10,16 +10,16 @@ require ( github.com/go-resty/resty/v2 v2.7.0 github.com/gonutz/w32/v2 v2.4.0 github.com/iamacarpet/go-win64api v0.0.0-20220531131246-e84054eb584d - github.com/nats-io/nats-server/v2 v2.9.14 // indirect + github.com/nats-io/nats-server/v2 v2.9.15 // indirect github.com/nats-io/nats.go v1.24.0 github.com/rickb777/date v1.19.1 - github.com/shirou/gopsutil/v3 v3.23.1 + github.com/shirou/gopsutil/v3 v3.23.2 github.com/sirupsen/logrus v1.9.0 - github.com/ugorji/go/codec v1.2.10 + github.com/ugorji/go/codec v1.2.11 github.com/wh1te909/go-win64api v0.0.0-20210906074314-ab23795a6ae5 github.com/wh1te909/trmm-shared v0.0.0-20220227075846-f9f757361139 - golang.org/x/net v0.5.0 // indirect - golang.org/x/sys v0.4.0 + golang.org/x/net v0.6.0 // indirect + golang.org/x/sys v0.5.0 ) require ( @@ -66,9 +66,9 @@ require ( github.com/tklauser/go-sysconf v0.3.11 // indirect github.com/tklauser/numcpus v0.6.0 // indirect github.com/yusufpapurcu/wmi v1.2.2 // indirect - golang.org/x/crypto v0.5.0 // indirect + golang.org/x/crypto v0.6.0 // indirect golang.org/x/sync v0.1.0 // indirect - golang.org/x/text v0.6.0 // indirect + golang.org/x/text v0.7.0 // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/toast.v1 v1.0.0-20180812000517-0a84660828b2 // indirect diff --git a/go.sum b/go.sum index c77f3ef..dc388ed 100644 --- a/go.sum +++ b/go.sum @@ -191,7 +191,7 @@ github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/X github.com/kardianos/service v1.2.2 h1:ZvePhAHfvo0A7Mftk/tEzqEZ7Q4lgnR8sGz4xu1YX60= github.com/kardianos/service v1.2.2/go.mod h1:CIMRFEJVL+0DS1a3Nx06NaMn4Dz63Ng6O7dl0qH0zVM= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.15.15 h1:EF27CXIuDsYJ6mmvtBRlEuB2UVOqHG1tAXgZ7yIO+lw= +github.com/klauspost/compress v1.16.0 h1:iULayQNOReoYUe+1qtKOqw9CwJv3aNQu8ivo7lw1HU4= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= @@ -210,8 +210,8 @@ github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrk github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/nats-io/jwt/v2 v2.3.0 h1:z2mA1a7tIf5ShggOFlR1oBPgd6hGqcDYsISxZByUzdI= -github.com/nats-io/nats-server/v2 v2.9.14 h1:n2GscWVgXpA14vQSRP/MM1SGi4wyazR9l19/gWxqgXQ= -github.com/nats-io/nats-server/v2 v2.9.14/go.mod h1:40ZwFm4npKdFBhOdY7rkh3YyI1oI91FzLvlYyB7HfzM= +github.com/nats-io/nats-server/v2 v2.9.15 h1:MuwEJheIwpvFgqvbs20W8Ish2azcygjf4Z0liVu2I4c= +github.com/nats-io/nats-server/v2 v2.9.15/go.mod h1:QlCTy115fqpx4KSOPFIxSV7DdI6OxtZsGOL1JLdeRlE= github.com/nats-io/nats.go v1.24.0 h1:CRiD8L5GOQu/DcfkmgBcTTIQORMwizF+rPk6T0RaHVQ= github.com/nats-io/nats.go v1.24.0/go.mod h1:dVQF+BK3SzUZpwyzHedXsvH3EO38aVKuOPkkHlv5hXA= github.com/nats-io/nkeys v0.3.0 h1:cgM5tL53EvYRU+2YLXIK0G2mJtK12Ft9oeooSZMA2G8= @@ -253,8 +253,8 @@ github.com/rogpeppe/go-internal v1.8.1 h1:geMPLpDpQOgVyCg5z5GoRwLHepNdb71NXb67XF github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= github.com/scjalliance/comshim v0.0.0-20190308082608-cf06d2532c4e h1:+/AzLkOdIXEPrAQtwAeWOBnPQ0BnYlBW0aCZmSb47u4= github.com/scjalliance/comshim v0.0.0-20190308082608-cf06d2532c4e/go.mod h1:9Tc1SKnfACJb9N7cw2eyuI6xzy845G7uZONBsi5uPEA= -github.com/shirou/gopsutil/v3 v3.23.1 h1:a9KKO+kGLKEvcPIs4W62v0nu3sciVDOOOPUD0Hz7z/4= -github.com/shirou/gopsutil/v3 v3.23.1/go.mod h1:NN6mnm5/0k8jw4cBfCnJtr5L7ErOTg18tMNpgFkn0hA= +github.com/shirou/gopsutil/v3 v3.23.2 h1:PAWSuiAszn7IhPMBtXsbSCafej7PqUOvY6YywlQUExU= +github.com/shirou/gopsutil/v3 v3.23.2/go.mod h1:gv0aQw33GLo3pG8SiWKiQrbDzbRY1K80RyZJ7V4Th1M= github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/spf13/afero v1.9.3 h1:41FoI0fD7OR7mGcKE/aOiLkGreyf8ifIOQmJANWogMk= @@ -277,16 +277,17 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5 github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= +github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8= github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= github.com/tklauser/go-sysconf v0.3.11 h1:89WgdJhk5SNwJfu+GKyYveZ4IaJ7xAkecBo+KdJV0CM= github.com/tklauser/go-sysconf v0.3.11/go.mod h1:GqXfhXY3kiPa0nAXPDIQIWzJbMCB7AmcWpGR8lSZfqI= github.com/tklauser/numcpus v0.6.0 h1:kebhY2Qt+3U6RNK7UqpYNA+tJ23IBEGKkB7JQBfDYms= github.com/tklauser/numcpus v0.6.0/go.mod h1:FEZLMke0lhOUG6w2JadTzp0a+Nl8PF/GFkQ5UVIcaL4= -github.com/ugorji/go/codec v1.2.10 h1:eimT6Lsr+2lzmSZxPhLFoOWFmQqwk0fllJJ5hEbTXtQ= -github.com/ugorji/go/codec v1.2.10/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= +github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU= +github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= github.com/wh1te909/go-win64api v0.0.0-20210906074314-ab23795a6ae5 h1:8tp/+fGR+qjDQ00vm0ZorHzskquo76MY9/ChmFFunEA= github.com/wh1te909/go-win64api v0.0.0-20210906074314-ab23795a6ae5/go.mod h1:qypF+Tf23flzLX5IXuodDb1314BrDrsbwK/OhTh6HBM= github.com/wh1te909/trmm-shared v0.0.0-20220227075846-f9f757361139 h1:PfOl03o+Y+svWrfXAAu1QWUDePu1yqTq0pf4rpnN8eA= @@ -311,8 +312,8 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20210314154223-e6e6c4f2bb5b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.5.0 h1:U/0M97KRkSFvyD/3FSmdP5W5swImpNgle/EHFhOsQPE= -golang.org/x/crypto v0.5.0/go.mod h1:NK/OQwhpMQP3MwtdjgLlYHnH9ebylxKWv3e0fK+mkQU= +golang.org/x/crypto v0.6.0 h1:qfktjS5LUO+fFKeJXZ+ikTRijMmljikvG68fpMMruSc= +golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -383,8 +384,8 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211029224645-99673261e6eb/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.5.0 h1:GyT4nK/YDHSqa1c4753ouYCDajOYKTja9Xb/OHtgvSw= -golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= +golang.org/x/net v0.6.0 h1:L4ZwwTvKW9gr0ZMS1yrHD9GZhIuVjOBBnaKH+SPQK0Q= +golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -459,8 +460,8 @@ golang.org/x/sys v0.0.0-20211107104306-e0b2ad06fe42/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.4.0 h1:Zr2JFtRQNX3BCZ8YtxRE9hNJYC8J6I1MVbMg6owUp18= -golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -469,8 +470,8 @@ golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.6.0 h1:3XmdazWV+ubf7QgHSTWeykHOci5oeekaGJBLkrkaw4k= -golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= diff --git a/main.go b/main.go index e4f68ab..5bfbd96 100644 --- a/main.go +++ b/main.go @@ -25,7 +25,7 @@ import ( ) var ( - version = "2.4.4" + version = "2.4.5-dev" log = logrus.New() logFile *os.File ) From bee870bd5839b0ad6c445d9ffd219e0d306fdb37 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Thu, 23 Mar 2023 13:00:41 -0700 Subject: [PATCH 069/113] bump version --- build/rmm.exe.manifest | 2 +- build/setup.iss | 2 +- main.go | 2 +- versioninfo.json | 10 +++++----- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/build/rmm.exe.manifest b/build/rmm.exe.manifest index 1d2abaf..3beb038 100644 --- a/build/rmm.exe.manifest +++ b/build/rmm.exe.manifest @@ -3,7 +3,7 @@ diff --git a/build/setup.iss b/build/setup.iss index 892f905..33e05cc 100644 --- a/build/setup.iss +++ b/build/setup.iss @@ -1,5 +1,5 @@ #define MyAppName "Tactical RMM Agent" -#define MyAppVersion "2.4.4" +#define MyAppVersion "2.4.5" #define MyAppPublisher "AmidaWare LLC" #define MyAppURL "https://github.com/amidaware" #define MyAppExeName "tacticalrmm.exe" diff --git a/main.go b/main.go index 5bfbd96..1e27e25 100644 --- a/main.go +++ b/main.go @@ -25,7 +25,7 @@ import ( ) var ( - version = "2.4.5-dev" + version = "2.4.5" log = logrus.New() logFile *os.File ) diff --git a/versioninfo.json b/versioninfo.json index c65e363..a845730 100644 --- a/versioninfo.json +++ b/versioninfo.json @@ -3,13 +3,13 @@ "FileVersion": { "Major": 2, "Minor": 4, - "Patch": 4, + "Patch": 5, "Build": 0 }, "ProductVersion": { "Major": 2, "Minor": 4, - "Patch": 4, + "Patch": 5, "Build": 0 }, "FileFlagsMask": "3f", @@ -22,14 +22,14 @@ "Comments": "", "CompanyName": "AmidaWare LLC", "FileDescription": "Tactical RMM Agent", - "FileVersion": "v2.4.4.0", + "FileVersion": "v2.4.5.0", "InternalName": "tacticalrmm.exe", - "LegalCopyright": "Copyright (c) 2022 AmidaWare LLC", + "LegalCopyright": "Copyright (c) 2023 AmidaWare LLC", "LegalTrademarks": "", "OriginalFilename": "tacticalrmm.exe", "PrivateBuild": "", "ProductName": "Tactical RMM Agent", - "ProductVersion": "v2.4.4.0", + "ProductVersion": "v2.4.5.0", "SpecialBuild": "" }, "VarFileInfo": { From 407f2a8072594e17d6de7555e63bb2622eae0ed5 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Wed, 29 Mar 2023 05:21:26 +0000 Subject: [PATCH 070/113] use cwd for agent update fixes #24 --- agent/agent_unix.go | 35 ++++++++++------------------------- 1 file changed, 10 insertions(+), 25 deletions(-) diff --git a/agent/agent_unix.go b/agent/agent_unix.go index fc65765..c75e4bb 100644 --- a/agent/agent_unix.go +++ b/agent/agent_unix.go @@ -226,9 +226,15 @@ func (a *Agent) AgentUpdate(url, inno, version string) { return } - f, err := createNixTmpFile() + // more reliable method to get current working directory than os.Getwd() + cwd := filepath.Dir(self) + // create a tmpfile in same location as current binary + // avoids issues with /tmp dir and other fs mount issues + tmpfile := filepath.Join(cwd, GenerateAgentID()) + + f, err := os.Create(tmpfile) if err != nil { - a.Logger.Errorln("AgentUpdate createNixTmpFile()", err) + a.Logger.Errorln("AgentUpdate() os.Create(tmpfile)", err) return } defer os.Remove(f.Name()) @@ -260,29 +266,8 @@ func (a *Agent) AgentUpdate(url, inno, version string) { os.Chmod(f.Name(), 0755) err = os.Rename(f.Name(), self) if err != nil { - a.Logger.Debugln("Detected /tmp on different filesystem") - // rename does not work when src and dest are on different filesystems - // so we need to manually copy it to the same fs then rename it - cwd, err := os.Getwd() - if err != nil { - a.Logger.Errorln("AgentUpdate() os.Getwd():", err) - return - } - // create a tmpfile in same fs as agent - tmpfile := filepath.Join(cwd, GenerateAgentID()) - defer os.Remove(tmpfile) - a.Logger.Debugln("Copying tmpfile from", f.Name(), "to", tmpfile) - cperr := copyFile(f.Name(), tmpfile) - if cperr != nil { - a.Logger.Errorln("AgentUpdate() copyFile:", cperr) - return - } - os.Chmod(tmpfile, 0755) - rerr := os.Rename(tmpfile, self) - if rerr != nil { - a.Logger.Errorln("AgentUpdate() os.Rename():", rerr) - return - } + a.Logger.Errorln("AgentUpdate() os.Rename():", err) + return } if runtime.GOOS == "linux" && a.seEnforcing() { From 56cbf8a9d713d91df59abb54994980e1d914544b Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Wed, 29 Mar 2023 17:41:24 +0000 Subject: [PATCH 071/113] use cwd for everything --- agent/agent_darwin.go | 16 ---------------- agent/agent_linux.go | 30 ------------------------------ agent/agent_unix.go | 26 ++------------------------ agent/agent_windows.go | 9 --------- agent/utils.go | 25 +++++++++++++++++++++++++ 5 files changed, 27 insertions(+), 79 deletions(-) delete mode 100644 agent/agent_darwin.go delete mode 100644 agent/agent_linux.go diff --git a/agent/agent_darwin.go b/agent/agent_darwin.go deleted file mode 100644 index c7741c4..0000000 --- a/agent/agent_darwin.go +++ /dev/null @@ -1,16 +0,0 @@ -/* -Copyright 2022 AmidaWare LLC. - -Licensed under the Tactical RMM License Version 1.0 (the “License”). -You may only use the Licensed Software in accordance with the License. -A copy of the License is available at: - -https://license.tacticalrmm.com - -*/ - -package agent - -func tmpNoExec() bool { - return false -} diff --git a/agent/agent_linux.go b/agent/agent_linux.go deleted file mode 100644 index c7d16e1..0000000 --- a/agent/agent_linux.go +++ /dev/null @@ -1,30 +0,0 @@ -/* -Copyright 2022 AmidaWare LLC. - -Licensed under the Tactical RMM License Version 1.0 (the “License”). -You may only use the Licensed Software in accordance with the License. -A copy of the License is available at: - -https://license.tacticalrmm.com - -*/ - -package agent - -import ( - "os" - "syscall" -) - -func tmpNoExec() bool { - var stat syscall.Statfs_t - var noexec bool - - tmpdir := os.TempDir() - if err := syscall.Statfs(tmpdir, &stat); err == nil { - if stat.Flags&syscall.MS_NOEXEC != 0 { - noexec = true - } - } - return noexec -} diff --git a/agent/agent_unix.go b/agent/agent_unix.go index c75e4bb..42f51ee 100644 --- a/agent/agent_unix.go +++ b/agent/agent_unix.go @@ -230,11 +230,9 @@ func (a *Agent) AgentUpdate(url, inno, version string) { cwd := filepath.Dir(self) // create a tmpfile in same location as current binary // avoids issues with /tmp dir and other fs mount issues - tmpfile := filepath.Join(cwd, GenerateAgentID()) - - f, err := os.Create(tmpfile) + f, err := os.CreateTemp(cwd, "trmm") if err != nil { - a.Logger.Errorln("AgentUpdate() os.Create(tmpfile)", err) + a.Logger.Errorln("AgentUpdate() os.CreateTemp:", err) return } defer os.Remove(f.Name()) @@ -477,26 +475,6 @@ func (a *Agent) GetWMIInfo() map[string]interface{} { return wmiInfo } -func createNixTmpFile() (*os.File, error) { - var f *os.File - noexec := tmpNoExec() - f, err := os.CreateTemp("", "trmm") - if err != nil || noexec { - if noexec { - os.Remove(f.Name()) - } - cwd, err := os.Getwd() - if err != nil { - return f, err - } - f, err = os.CreateTemp(cwd, "trmm") - if err != nil { - return f, err - } - } - return f, nil -} - // windows only below TODO add into stub file func (a *Agent) GetAgentCheckInConfig(ret AgentCheckInConfig) AgentCheckInConfig { return ret diff --git a/agent/agent_windows.go b/agent/agent_windows.go index cc5da54..b19a185 100644 --- a/agent/agent_windows.go +++ b/agent/agent_windows.go @@ -906,12 +906,3 @@ func (a *Agent) GetAgentCheckInConfig(ret AgentCheckInConfig) AgentCheckInConfig func (a *Agent) NixMeshNodeID() string { return "not implemented" } - -func tmpNoExec() bool { - return false -} - -func createNixTmpFile() (*os.File, error) { - var f *os.File - return f, nil -} diff --git a/agent/utils.go b/agent/utils.go index 4d41ecb..8db3341 100644 --- a/agent/utils.go +++ b/agent/utils.go @@ -340,3 +340,28 @@ func getCMDExe() string { } return cmdExe } + +// more accurate than os.Getwd() +func getCwd() (string, error) { + self, err := os.Executable() + if err != nil { + return "", err + } + + return filepath.Dir(self), nil +} + +func createNixTmpFile() (*os.File, error) { + var f *os.File + cwd, err := getCwd() + if err != nil { + return f, err + } + + f, err = os.CreateTemp(cwd, "trmm") + if err != nil { + return f, err + } + + return f, nil +} From 549aaba08f0ee303140b63275d918df0b8bececa Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Fri, 7 Apr 2023 13:00:28 -0700 Subject: [PATCH 072/113] update ci --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 53e74b1..89684ea 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,9 +16,9 @@ jobs: steps: - uses: actions/checkout@v3 - - uses: actions/setup-go@v3 + - uses: actions/setup-go@v4 with: - go-version: '1.20.2' + go-version: '1.20.3' - name: Ensure linux agent compiles run: | From 9c6c67b1b26d28bb106db1f89dae5fbb3ca11590 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Fri, 7 Apr 2023 13:00:45 -0700 Subject: [PATCH 073/113] update reqs --- go.mod | 13 +++++++------ go.sum | 39 ++++++++++++++++++++++++++------------- main.go | 2 +- 3 files changed, 34 insertions(+), 20 deletions(-) diff --git a/go.mod b/go.mod index e059687..dae960f 100644 --- a/go.mod +++ b/go.mod @@ -4,22 +4,22 @@ go 1.20 require ( github.com/StackExchange/wmi v1.2.1 - github.com/elastic/go-sysinfo v1.9.0 + github.com/elastic/go-sysinfo v1.10.0 github.com/go-ole/go-ole v1.2.6 github.com/go-ping/ping v1.1.0 github.com/go-resty/resty/v2 v2.7.0 github.com/gonutz/w32/v2 v2.4.0 github.com/iamacarpet/go-win64api v0.0.0-20220531131246-e84054eb584d github.com/nats-io/nats-server/v2 v2.9.15 // indirect - github.com/nats-io/nats.go v1.24.0 + github.com/nats-io/nats.go v1.25.0 github.com/rickb777/date v1.19.1 - github.com/shirou/gopsutil/v3 v3.23.2 + github.com/shirou/gopsutil/v3 v3.23.3 github.com/sirupsen/logrus v1.9.0 github.com/ugorji/go/codec v1.2.11 github.com/wh1te909/go-win64api v0.0.0-20210906074314-ab23795a6ae5 github.com/wh1te909/trmm-shared v0.0.0-20220227075846-f9f757361139 - golang.org/x/net v0.6.0 // indirect - golang.org/x/sys v0.5.0 + golang.org/x/net v0.7.0 // indirect + golang.org/x/sys v0.6.0 ) require ( @@ -48,7 +48,7 @@ require ( github.com/magiconair/properties v1.8.7 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect - github.com/nats-io/nkeys v0.3.0 // indirect + github.com/nats-io/nkeys v0.4.4 // indirect github.com/nats-io/nuid v1.0.1 // indirect github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d // indirect github.com/pelletier/go-toml/v2 v2.0.6 // indirect @@ -58,6 +58,7 @@ require ( github.com/rickb777/plural v1.4.1 // indirect github.com/rogpeppe/go-internal v1.8.1 // indirect github.com/scjalliance/comshim v0.0.0-20190308082608-cf06d2532c4e // indirect + github.com/shoenig/go-m1cpu v0.1.4 // indirect github.com/spf13/afero v1.9.3 // indirect github.com/spf13/cast v1.5.0 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect diff --git a/go.sum b/go.sum index dc388ed..cf9604d 100644 --- a/go.sum +++ b/go.sum @@ -39,6 +39,7 @@ cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3f dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/Microsoft/go-winio v0.6.0 h1:slsWYD/zyx7lCXoZVlvQrj0hPTM1HI4+v1sIda2yDvg= github.com/StackExchange/wmi v1.2.0/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= github.com/StackExchange/wmi v1.2.1 h1:VIkavFPXSjcnS+O8yTq7NI32k0R5Aj+v39y29VYDOSA= github.com/StackExchange/wmi v1.2.1/go.mod h1:rcmrprowKIVzvc+NUiLncP2uuArMWLCbu9SBzvHz7e8= @@ -57,8 +58,12 @@ github.com/creachadair/staticfile v0.1.3/go.mod h1:a3qySzCIXEprDGxk6tSxSI+dBBdLz github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/elastic/go-sysinfo v1.9.0 h1:usICqY/Nw4Mpn9f4LdtpFrKxXroJDe81GaxxUlCckIo= -github.com/elastic/go-sysinfo v1.9.0/go.mod h1:eBD1wEGVaRnRLGecc9iG1z8eOv5HnEdz9+nWd8UAxcE= +github.com/docker/distribution v2.8.1+incompatible h1:Q50tZOPR6T/hjNsyc9g8/syEs6bk8XXApsHjKukMl68= +github.com/docker/docker v20.10.24+incompatible h1:Ugvxm7a8+Gz6vqQYQQ2W7GYq5EUPaAiuPgIfVyI3dYE= +github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= +github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= +github.com/elastic/go-sysinfo v1.10.0 h1:8mhFXJrWFLpeskULp0sGq+jt5DA0AaPU+RfGDOJQPUA= +github.com/elastic/go-sysinfo v1.10.0/go.mod h1:RgpZTzVQX1UUNtbCnTYE5xzUaZ9+UU4ydR2ZXyzjkBg= github.com/elastic/go-windows v1.0.1 h1:AlYZOldA+UJ0/2nBuqWdo90GFCgG9xuyw9SYzGUtJm0= github.com/elastic/go-windows v1.0.1/go.mod h1:FoVvqWSun28vaDQPbj2Elfc0JahhPB7WQEGa3c814Ss= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= @@ -91,6 +96,7 @@ github.com/go-resty/resty/v2 v2.7.0 h1:me+K9p3uhSmXtrBZ4k9jcEAfJmuC8IivWHwaLZwPr github.com/go-resty/resty/v2 v2.7.0/go.mod h1:9PWDzw47qPphMRFfhsyk0NnSgvluHcljSMVIq3w7q0I= github.com/go-test/deep v1.0.7 h1:/VSMRlnY/JSyqxQUzQLKVMAskpY/NZKFA5j2P+0pP2M= github.com/godbus/dbus v4.1.0+incompatible/go.mod h1:/YcGZj5zSblfDWMMoOzV4fas9FZnQYTkDnsGvmh2Grw= +github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/glog v0.0.0-20210429001901-424d2337a529/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -212,10 +218,10 @@ github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RR github.com/nats-io/jwt/v2 v2.3.0 h1:z2mA1a7tIf5ShggOFlR1oBPgd6hGqcDYsISxZByUzdI= github.com/nats-io/nats-server/v2 v2.9.15 h1:MuwEJheIwpvFgqvbs20W8Ish2azcygjf4Z0liVu2I4c= github.com/nats-io/nats-server/v2 v2.9.15/go.mod h1:QlCTy115fqpx4KSOPFIxSV7DdI6OxtZsGOL1JLdeRlE= -github.com/nats-io/nats.go v1.24.0 h1:CRiD8L5GOQu/DcfkmgBcTTIQORMwizF+rPk6T0RaHVQ= -github.com/nats-io/nats.go v1.24.0/go.mod h1:dVQF+BK3SzUZpwyzHedXsvH3EO38aVKuOPkkHlv5hXA= -github.com/nats-io/nkeys v0.3.0 h1:cgM5tL53EvYRU+2YLXIK0G2mJtK12Ft9oeooSZMA2G8= -github.com/nats-io/nkeys v0.3.0/go.mod h1:gvUNGjVcM2IPr5rCsRsC6Wb3Hr2CQAm08dsxtV6A5y4= +github.com/nats-io/nats.go v1.25.0 h1:t5/wCPGciR7X3Mu8QOi4jiJaXaWM8qtkLu4lzGZvYHE= +github.com/nats-io/nats.go v1.25.0/go.mod h1:D2WALIhz7V8M0pH8Scx8JZXlg6Oqz5VG+nQkK8nJdvg= +github.com/nats-io/nkeys v0.4.4 h1:xvBJ8d69TznjcQl9t6//Q5xXuVhyYiSos6RPtvQNTwA= +github.com/nats-io/nkeys v0.4.4/go.mod h1:XUkxdLPTufzlihbamfzQ7mw/VGx6ObUs+0bN5sNvt64= github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw= github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d h1:VhgPp6v9qf9Agr/56bj7Y/xa04UccTW04VP0Qed4vnQ= @@ -226,6 +232,8 @@ github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108 github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.2/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.19.0 h1:4ieX6qQjPP/BfC3mpsAtIGGlxTWPeA3Inl/7DtXw1tw= +github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= +github.com/opencontainers/image-spec v1.0.2 h1:9yCKha/T5XdGtO0q9Q9a6T5NUCsTn/DrBg0D7ufOcFM= github.com/pelletier/go-toml/v2 v2.0.6 h1:nrzqCb7j9cDFj2coyLNLaZuJTLjWjlaz6nvTvIwycIU= github.com/pelletier/go-toml/v2 v2.0.6/go.mod h1:eumQOmlWiOPt5WriQQqoM5y18pDHwha2N+QD+EUNTek= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= @@ -253,8 +261,12 @@ github.com/rogpeppe/go-internal v1.8.1 h1:geMPLpDpQOgVyCg5z5GoRwLHepNdb71NXb67XF github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= github.com/scjalliance/comshim v0.0.0-20190308082608-cf06d2532c4e h1:+/AzLkOdIXEPrAQtwAeWOBnPQ0BnYlBW0aCZmSb47u4= github.com/scjalliance/comshim v0.0.0-20190308082608-cf06d2532c4e/go.mod h1:9Tc1SKnfACJb9N7cw2eyuI6xzy845G7uZONBsi5uPEA= -github.com/shirou/gopsutil/v3 v3.23.2 h1:PAWSuiAszn7IhPMBtXsbSCafej7PqUOvY6YywlQUExU= -github.com/shirou/gopsutil/v3 v3.23.2/go.mod h1:gv0aQw33GLo3pG8SiWKiQrbDzbRY1K80RyZJ7V4Th1M= +github.com/shirou/gopsutil/v3 v3.23.3 h1:Syt5vVZXUDXPEXpIBt5ziWsJ4LdSAAxF4l/xZeQgSEE= +github.com/shirou/gopsutil/v3 v3.23.3/go.mod h1:lSBNN6t3+D6W5e5nXTxc8KIMMVxAcS+6IJlffjRRlMU= +github.com/shoenig/go-m1cpu v0.1.4 h1:SZPIgRM2sEF9NJy50mRHu9PKGwxyyTTJIWvCtgVbozs= +github.com/shoenig/go-m1cpu v0.1.4/go.mod h1:Wwvst4LR89UxjeFtLRMrpgRiyY4xPsejnVZym39dbAQ= +github.com/shoenig/test v0.6.3 h1:GVXWJFk9PiOjN0KoJ7VrJGH6uLPnqxR7/fe3HUPfE0c= +github.com/shoenig/test v0.6.3/go.mod h1:byHiCGXqrVaflBLAMq/srcZIHynQPQgeyvkvXnjqq0k= github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/spf13/afero v1.9.3 h1:41FoI0fD7OR7mGcKE/aOiLkGreyf8ifIOQmJANWogMk= @@ -309,7 +321,6 @@ golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20210314154223-e6e6c4f2bb5b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.6.0 h1:qfktjS5LUO+fFKeJXZ+ikTRijMmljikvG68fpMMruSc= @@ -347,6 +358,7 @@ golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 h1:6zppjxzCulZykYSLyVDYbneBfbaBIQPYMevg0bEwv2s= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -384,8 +396,8 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211029224645-99673261e6eb/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.6.0 h1:L4ZwwTvKW9gr0ZMS1yrHD9GZhIuVjOBBnaKH+SPQK0Q= -golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= +golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -460,8 +472,8 @@ golang.org/x/sys v0.0.0-20211107104306-e0b2ad06fe42/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -523,6 +535,7 @@ golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= +golang.org/x/tools v0.1.12 h1:VveCTK38A2rkS8ZqFY25HIDFscX5X9OoEhJd3quQmXU= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/main.go b/main.go index 1e27e25..c98c934 100644 --- a/main.go +++ b/main.go @@ -25,7 +25,7 @@ import ( ) var ( - version = "2.4.5" + version = "2.4.6-dev" log = logrus.New() logFile *os.File ) From 2da107455fd67a1bbe11ebaaf6e52fb0cc6862a4 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Sat, 8 Apr 2023 19:58:57 -0700 Subject: [PATCH 074/113] bump version --- build/rmm.exe.manifest | 2 +- build/setup.iss | 2 +- main.go | 2 +- versioninfo.json | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/build/rmm.exe.manifest b/build/rmm.exe.manifest index 3beb038..a6341c2 100644 --- a/build/rmm.exe.manifest +++ b/build/rmm.exe.manifest @@ -3,7 +3,7 @@ diff --git a/build/setup.iss b/build/setup.iss index 33e05cc..13607a2 100644 --- a/build/setup.iss +++ b/build/setup.iss @@ -1,5 +1,5 @@ #define MyAppName "Tactical RMM Agent" -#define MyAppVersion "2.4.5" +#define MyAppVersion "2.4.6" #define MyAppPublisher "AmidaWare LLC" #define MyAppURL "https://github.com/amidaware" #define MyAppExeName "tacticalrmm.exe" diff --git a/main.go b/main.go index c98c934..322e7c2 100644 --- a/main.go +++ b/main.go @@ -25,7 +25,7 @@ import ( ) var ( - version = "2.4.6-dev" + version = "2.4.6" log = logrus.New() logFile *os.File ) diff --git a/versioninfo.json b/versioninfo.json index a845730..dad4f80 100644 --- a/versioninfo.json +++ b/versioninfo.json @@ -3,13 +3,13 @@ "FileVersion": { "Major": 2, "Minor": 4, - "Patch": 5, + "Patch": 6, "Build": 0 }, "ProductVersion": { "Major": 2, "Minor": 4, - "Patch": 5, + "Patch": 6, "Build": 0 }, "FileFlagsMask": "3f", @@ -22,14 +22,14 @@ "Comments": "", "CompanyName": "AmidaWare LLC", "FileDescription": "Tactical RMM Agent", - "FileVersion": "v2.4.5.0", + "FileVersion": "v2.4.6.0", "InternalName": "tacticalrmm.exe", "LegalCopyright": "Copyright (c) 2023 AmidaWare LLC", "LegalTrademarks": "", "OriginalFilename": "tacticalrmm.exe", "PrivateBuild": "", "ProductName": "Tactical RMM Agent", - "ProductVersion": "v2.4.5.0", + "ProductVersion": "v2.4.6.0", "SpecialBuild": "" }, "VarFileInfo": { From ec49d4941dc601349386686f10860cbcdf4691b1 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Sat, 8 Apr 2023 20:21:20 -0700 Subject: [PATCH 075/113] update dep --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index dae960f..46c0b0b 100644 --- a/go.mod +++ b/go.mod @@ -58,7 +58,7 @@ require ( github.com/rickb777/plural v1.4.1 // indirect github.com/rogpeppe/go-internal v1.8.1 // indirect github.com/scjalliance/comshim v0.0.0-20190308082608-cf06d2532c4e // indirect - github.com/shoenig/go-m1cpu v0.1.4 // indirect + github.com/shoenig/go-m1cpu v0.1.5 // indirect github.com/spf13/afero v1.9.3 // indirect github.com/spf13/cast v1.5.0 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect diff --git a/go.sum b/go.sum index cf9604d..37efa22 100644 --- a/go.sum +++ b/go.sum @@ -265,6 +265,8 @@ github.com/shirou/gopsutil/v3 v3.23.3 h1:Syt5vVZXUDXPEXpIBt5ziWsJ4LdSAAxF4l/xZeQ github.com/shirou/gopsutil/v3 v3.23.3/go.mod h1:lSBNN6t3+D6W5e5nXTxc8KIMMVxAcS+6IJlffjRRlMU= github.com/shoenig/go-m1cpu v0.1.4 h1:SZPIgRM2sEF9NJy50mRHu9PKGwxyyTTJIWvCtgVbozs= github.com/shoenig/go-m1cpu v0.1.4/go.mod h1:Wwvst4LR89UxjeFtLRMrpgRiyY4xPsejnVZym39dbAQ= +github.com/shoenig/go-m1cpu v0.1.5 h1:LF57Z/Fpb/WdGLjt2HZilNnmZOxg/q2bSKTQhgbrLrQ= +github.com/shoenig/go-m1cpu v0.1.5/go.mod h1:Wwvst4LR89UxjeFtLRMrpgRiyY4xPsejnVZym39dbAQ= github.com/shoenig/test v0.6.3 h1:GVXWJFk9PiOjN0KoJ7VrJGH6uLPnqxR7/fe3HUPfE0c= github.com/shoenig/test v0.6.3/go.mod h1:byHiCGXqrVaflBLAMq/srcZIHynQPQgeyvkvXnjqq0k= github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= From 588a4bcbf7d93789a97d309652434839caa53f66 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Sat, 29 Apr 2023 15:30:23 -0700 Subject: [PATCH 076/113] allow setting custom defined tmpdir --- agent/agent.go | 142 ++++++++++++++++++++++------------------- agent/agent_windows.go | 47 ++++++++------ shared/types.go | 28 ++++---- 3 files changed, 122 insertions(+), 95 deletions(-) diff --git a/agent/agent.go b/agent/agent.go index f3cbadc..75d087b 100644 --- a/agent/agent.go +++ b/agent/agent.go @@ -40,37 +40,39 @@ import ( // Agent struct type Agent struct { - Hostname string - Arch string - AgentID string - BaseURL string - ApiURL string - Token string - AgentPK int - Cert string - ProgramDir string - EXE string - SystemDrive string - MeshInstaller string - MeshSystemEXE string - MeshSVC string - PyBin string - Headers map[string]string - Logger *logrus.Logger - Version string - Debug bool - rClient *resty.Client - Proxy string - LogTo string - LogFile *os.File - Platform string - GoArch string - ServiceConfig *service.Config - NatsServer string - NatsProxyPath string - NatsProxyPort string - NatsPingInterval int - NatsWSCompression bool + Hostname string + Arch string + AgentID string + BaseURL string + ApiURL string + Token string + AgentPK int + Cert string + ProgramDir string + EXE string + SystemDrive string + WinTmpDir string + WinRunAsUserTmpDir string + MeshInstaller string + MeshSystemEXE string + MeshSVC string + PyBin string + Headers map[string]string + Logger *logrus.Logger + Version string + Debug bool + rClient *resty.Client + Proxy string + LogTo string + LogFile *os.File + Platform string + GoArch string + ServiceConfig *service.Config + NatsServer string + NatsProxyPath string + NatsProxyPort string + NatsPingInterval int + NatsWSCompression bool } const ( @@ -88,7 +90,7 @@ const ( defaultMacMeshSvcDir = "/usr/local/mesh_services" ) -var winTempDir = filepath.Join(os.Getenv("PROGRAMDATA"), "TacticalRMM") +var defaultWinTmpDir = filepath.Join(os.Getenv("PROGRAMDATA"), "TacticalRMM") var winMeshDir = filepath.Join(os.Getenv("PROGRAMFILES"), "Mesh Agent") var natsCheckin = []string{"agent-hello", "agent-agentinfo", "agent-disks", "agent-winsvc", "agent-publicip", "agent-wmi"} var limitNatsData = []string{"agent-winsvc", "agent-wmi"} @@ -99,6 +101,8 @@ func New(logger *logrus.Logger, version string) *Agent { pd := filepath.Join(os.Getenv("ProgramFiles"), progFilesName) exe := filepath.Join(pd, winExeName) sd := os.Getenv("SystemDrive") + winTempDir := defaultWinTmpDir + winRunAsUserTmpDir := defaultWinTmpDir var pybin string switch runtime.GOARCH { @@ -130,6 +134,14 @@ func New(logger *logrus.Logger, version string) *Agent { restyC.SetRootCertificate(ac.Cert) } + if len(ac.WinTmpDir) > 0 { + winTempDir = ac.WinTmpDir + } + + if len(ac.WinRunAsUserTmpDir) > 0 { + winRunAsUserTmpDir = ac.WinRunAsUserTmpDir + } + var MeshSysExe string switch runtime.GOOS { case "windows": @@ -189,34 +201,36 @@ func New(logger *logrus.Logger, version string) *Agent { } return &Agent{ - Hostname: info.Hostname, - BaseURL: ac.BaseURL, - AgentID: ac.AgentID, - ApiURL: ac.APIURL, - Token: ac.Token, - AgentPK: ac.PK, - Cert: ac.Cert, - ProgramDir: pd, - EXE: exe, - SystemDrive: sd, - MeshInstaller: "meshagent.exe", - MeshSystemEXE: MeshSysExe, - MeshSVC: meshSvcName, - PyBin: pybin, - Headers: headers, - Logger: logger, - Version: version, - Debug: logger.IsLevelEnabled(logrus.DebugLevel), - rClient: restyC, - Proxy: ac.Proxy, - Platform: runtime.GOOS, - GoArch: runtime.GOARCH, - ServiceConfig: svcConf, - NatsServer: natsServer, - NatsProxyPath: natsProxyPath, - NatsProxyPort: natsProxyPort, - NatsPingInterval: natsPingInterval, - NatsWSCompression: natsWsCompression, + Hostname: info.Hostname, + BaseURL: ac.BaseURL, + AgentID: ac.AgentID, + ApiURL: ac.APIURL, + Token: ac.Token, + AgentPK: ac.PK, + Cert: ac.Cert, + ProgramDir: pd, + EXE: exe, + SystemDrive: sd, + WinTmpDir: winTempDir, + WinRunAsUserTmpDir: winRunAsUserTmpDir, + MeshInstaller: "meshagent.exe", + MeshSystemEXE: MeshSysExe, + MeshSVC: meshSvcName, + PyBin: pybin, + Headers: headers, + Logger: logger, + Version: version, + Debug: logger.IsLevelEnabled(logrus.DebugLevel), + rClient: restyC, + Proxy: ac.Proxy, + Platform: runtime.GOOS, + GoArch: runtime.GOARCH, + ServiceConfig: svcConf, + NatsServer: natsServer, + NatsProxyPath: natsProxyPath, + NatsProxyPort: natsProxyPort, + NatsPingInterval: natsPingInterval, + NatsWSCompression: natsWsCompression, } } @@ -457,7 +471,7 @@ func (a *Agent) GetUninstallExe() string { func (a *Agent) CleanupAgentUpdates() { // TODO remove a.ProgramDir, updates are now in winTempDir - dirs := [3]string{winTempDir, os.Getenv("TMP"), a.ProgramDir} + dirs := [3]string{a.WinTmpDir, os.Getenv("TMP"), a.ProgramDir} for _, dir := range dirs { err := os.Chdir(dir) if err != nil { @@ -491,7 +505,7 @@ func (a *Agent) CleanupAgentUpdates() { func (a *Agent) RunPythonCode(code string, timeout int, args []string) (string, error) { content := []byte(code) - tmpfn, _ := ioutil.TempFile(winTempDir, "*.py") + tmpfn, _ := ioutil.TempFile(a.WinTmpDir, "*.py") if _, err := tmpfn.Write(content); err != nil { a.Logger.Debugln(err) return "", err @@ -537,8 +551,8 @@ func (a *Agent) RunPythonCode(code string, timeout int, args []string) (string, } func createWinTempDir() error { - if !trmm.FileExists(winTempDir) { - err := os.Mkdir(winTempDir, 0775) + if !trmm.FileExists(defaultWinTmpDir) { + err := os.Mkdir(defaultWinTmpDir, 0775) if err != nil { return err } diff --git a/agent/agent_windows.go b/agent/agent_windows.go index b19a185..5e8ee3b 100644 --- a/agent/agent_windows.go +++ b/agent/agent_windows.go @@ -62,6 +62,8 @@ func NewAgentConfig() *rmm.AgentConfig { cert, _, _ := k.GetStringValue("Cert") proxy, _, _ := k.GetStringValue("Proxy") customMeshDir, _, _ := k.GetStringValue("MeshDir") + winTmpDir, _, _ := k.GetStringValue("WinTmpDir") + winRunAsUserTmpDir, _, _ := k.GetStringValue("WinRunAsUserTmpDir") natsProxyPath, _, _ := k.GetStringValue("NatsProxyPath") natsProxyPort, _, _ := k.GetStringValue("NatsProxyPort") natsStandardPort, _, _ := k.GetStringValue("NatsStandardPort") @@ -69,19 +71,21 @@ func NewAgentConfig() *rmm.AgentConfig { npi, _ := strconv.Atoi(natsPingInterval) return &rmm.AgentConfig{ - BaseURL: baseurl, - AgentID: agentid, - APIURL: apiurl, - Token: token, - AgentPK: agentpk, - PK: pk, - Cert: cert, - Proxy: proxy, - CustomMeshDir: customMeshDir, - NatsProxyPath: natsProxyPath, - NatsProxyPort: natsProxyPort, - NatsStandardPort: natsStandardPort, - NatsPingInterval: npi, + BaseURL: baseurl, + AgentID: agentid, + APIURL: apiurl, + Token: token, + AgentPK: agentpk, + PK: pk, + Cert: cert, + Proxy: proxy, + CustomMeshDir: customMeshDir, + WinTmpDir: winTmpDir, + WinRunAsUserTmpDir: winRunAsUserTmpDir, + NatsProxyPath: natsProxyPath, + NatsProxyPort: natsProxyPort, + NatsStandardPort: natsStandardPort, + NatsPingInterval: npi, } } @@ -114,7 +118,13 @@ func (a *Agent) RunScript(code string, shell string, args []string, timeout int, ext = "*.bat" } - tmpfn, err := ioutil.TempFile(winTempDir, ext) + tmpDir := a.WinTmpDir + + if runasuser { + tmpDir = a.WinRunAsUserTmpDir + } + + tmpfn, err := ioutil.TempFile(tmpDir, ext) if err != nil { a.Logger.Errorln(err) return "", err.Error(), 85, err @@ -133,7 +143,7 @@ func (a *Agent) RunScript(code string, shell string, args []string, timeout int, switch shell { case "powershell": exe = getPowershellExe() - cmdArgs = []string{"-NonInteractive", "-NoProfile", "-ExecutionPolicy", "Bypass", tmpfn.Name()} + cmdArgs = []string{"-NonInteractive", "-NoProfile", "-ExecutionPolicy", "Bypass", "-File", tmpfn.Name()} case "python": exe = a.PyBin cmdArgs = []string{tmpfn.Name()} @@ -587,7 +597,8 @@ func (a *Agent) UninstallCleanup() { a.PatchMgmnt(false) a.CleanupAgentUpdates() CleanupSchedTasks() - os.RemoveAll(winTempDir) + os.RemoveAll(a.WinTmpDir) + os.RemoveAll(a.WinRunAsUserTmpDir) } func (a *Agent) AgentUpdate(url, inno, version string) { @@ -595,7 +606,7 @@ func (a *Agent) AgentUpdate(url, inno, version string) { a.KillHungUpdates() time.Sleep(1 * time.Second) a.CleanupAgentUpdates() - updater := filepath.Join(winTempDir, inno) + updater := filepath.Join(a.WinTmpDir, inno) a.Logger.Infof("Agent updating from %s to %s", a.Version, version) a.Logger.Debugln("Downloading agent update from", url) @@ -618,7 +629,7 @@ func (a *Agent) AgentUpdate(url, inno, version string) { return } - innoLogFile := filepath.Join(winTempDir, fmt.Sprintf("tacticalagent_update_v%s.txt", version)) + innoLogFile := filepath.Join(a.WinTmpDir, fmt.Sprintf("tacticalagent_update_v%s.txt", version)) args := []string{"/C", updater, "/VERYSILENT", fmt.Sprintf("/LOG=%s", innoLogFile)} cmd := exec.Command("cmd.exe", args...) diff --git a/shared/types.go b/shared/types.go index 5ff983d..3fbf3f4 100644 --- a/shared/types.go +++ b/shared/types.go @@ -33,19 +33,21 @@ type ProcessMsg struct { } type AgentConfig struct { - BaseURL string - AgentID string - APIURL string - Token string - AgentPK string - PK int - Cert string - Proxy string - CustomMeshDir string - NatsProxyPath string - NatsProxyPort string - NatsStandardPort string - NatsPingInterval int + BaseURL string + AgentID string + APIURL string + Token string + AgentPK string + PK int + Cert string + Proxy string + CustomMeshDir string + WinTmpDir string + WinRunAsUserTmpDir string + NatsProxyPath string + NatsProxyPort string + NatsStandardPort string + NatsPingInterval int } type RunScriptResp struct { From 4f01e214fd1eb4870e90a1f99480526ef3dd2299 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Sat, 29 Apr 2023 16:56:15 -0700 Subject: [PATCH 077/113] fix crash when update fails to download fixes #33 --- agent/agent_unix.go | 16 +++++++++------- agent/agent_windows.go | 9 ++++----- agent/rpc.go | 6 +++++- 3 files changed, 18 insertions(+), 13 deletions(-) diff --git a/agent/agent_unix.go b/agent/agent_unix.go index 42f51ee..aa633b3 100644 --- a/agent/agent_unix.go +++ b/agent/agent_unix.go @@ -16,6 +16,7 @@ package agent import ( "bufio" + "errors" "fmt" "os" "path/filepath" @@ -218,12 +219,12 @@ func (a *Agent) seEnforcing() bool { return out.Status.Exit == 0 && strings.Contains(out.Stdout, "Enforcing") } -func (a *Agent) AgentUpdate(url, inno, version string) { +func (a *Agent) AgentUpdate(url, inno, version string) error { self, err := os.Executable() if err != nil { a.Logger.Errorln("AgentUpdate() os.Executable():", err) - return + return err } // more reliable method to get current working directory than os.Getwd() @@ -233,7 +234,7 @@ func (a *Agent) AgentUpdate(url, inno, version string) { f, err := os.CreateTemp(cwd, "trmm") if err != nil { a.Logger.Errorln("AgentUpdate() os.CreateTemp:", err) - return + return err } defer os.Remove(f.Name()) @@ -252,12 +253,12 @@ func (a *Agent) AgentUpdate(url, inno, version string) { if err != nil { a.Logger.Errorln("AgentUpdate() download:", err) f.Close() - return + return err } if r.IsError() { a.Logger.Errorln("AgentUpdate() status code:", r.StatusCode()) f.Close() - return + return errors.New("err") } f.Close() @@ -265,7 +266,7 @@ func (a *Agent) AgentUpdate(url, inno, version string) { err = os.Rename(f.Name(), self) if err != nil { a.Logger.Errorln("AgentUpdate() os.Rename():", err) - return + return err } if runtime.GOOS == "linux" && a.seEnforcing() { @@ -283,10 +284,11 @@ func (a *Agent) AgentUpdate(url, inno, version string) { case "darwin": opts.Command = "launchctl kickstart -k system/tacticalagent" default: - return + return nil } a.CmdV2(opts) + return nil } func (a *Agent) AgentUninstall(code string) { diff --git a/agent/agent_windows.go b/agent/agent_windows.go index 5e8ee3b..fd6fb19 100644 --- a/agent/agent_windows.go +++ b/agent/agent_windows.go @@ -601,7 +601,7 @@ func (a *Agent) UninstallCleanup() { os.RemoveAll(a.WinRunAsUserTmpDir) } -func (a *Agent) AgentUpdate(url, inno, version string) { +func (a *Agent) AgentUpdate(url, inno, version string) error { time.Sleep(time.Duration(randRange(1, 15)) * time.Second) a.KillHungUpdates() time.Sleep(1 * time.Second) @@ -620,13 +620,11 @@ func (a *Agent) AgentUpdate(url, inno, version string) { r, err := rClient.R().SetOutput(updater).Get(url) if err != nil { a.Logger.Errorln(err) - CMD("net", []string{"start", winSvcName}, 10, false) - return + return err } if r.IsError() { a.Logger.Errorln("Download failed with status code", r.StatusCode()) - CMD("net", []string{"start", winSvcName}, 10, false) - return + return err } innoLogFile := filepath.Join(a.WinTmpDir, fmt.Sprintf("tacticalagent_update_v%s.txt", version)) @@ -638,6 +636,7 @@ func (a *Agent) AgentUpdate(url, inno, version string) { } cmd.Start() time.Sleep(1 * time.Second) + return nil } func (a *Agent) osString() string { diff --git a/agent/rpc.go b/agent/rpc.go index 5eaf456..ed975d9 100644 --- a/agent/rpc.go +++ b/agent/rpc.go @@ -481,7 +481,11 @@ func (a *Agent) RunRPC() { } else { ret.Encode("ok") msg.Respond(resp) - a.AgentUpdate(p.Data["url"], p.Data["inno"], p.Data["version"]) + err := a.AgentUpdate(p.Data["url"], p.Data["inno"], p.Data["version"]) + if err != nil { + atomic.StoreUint32(&agentUpdateLocker, 0) + return + } atomic.StoreUint32(&agentUpdateLocker, 0) nc.Flush() nc.Close() From 9975ce35362644a04add5d5d3d022806413e54f6 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Sat, 6 May 2023 19:13:47 -0700 Subject: [PATCH 078/113] update reqs --- .github/workflows/ci.yml | 2 +- go.mod | 16 +++++++-------- go.sum | 43 ++++++++++++++++++++-------------------- 3 files changed, 31 insertions(+), 30 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 89684ea..002baba 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ jobs: - uses: actions/setup-go@v4 with: - go-version: '1.20.3' + go-version: '1.20.4' - name: Ensure linux agent compiles run: | diff --git a/go.mod b/go.mod index 46c0b0b..2c69013 100644 --- a/go.mod +++ b/go.mod @@ -4,22 +4,22 @@ go 1.20 require ( github.com/StackExchange/wmi v1.2.1 - github.com/elastic/go-sysinfo v1.10.0 + github.com/elastic/go-sysinfo v1.10.1 github.com/go-ole/go-ole v1.2.6 github.com/go-ping/ping v1.1.0 github.com/go-resty/resty/v2 v2.7.0 github.com/gonutz/w32/v2 v2.4.0 github.com/iamacarpet/go-win64api v0.0.0-20220531131246-e84054eb584d - github.com/nats-io/nats-server/v2 v2.9.15 // indirect + github.com/nats-io/nats-server/v2 v2.9.16 // indirect github.com/nats-io/nats.go v1.25.0 github.com/rickb777/date v1.19.1 - github.com/shirou/gopsutil/v3 v3.23.3 + github.com/shirou/gopsutil/v3 v3.23.4 github.com/sirupsen/logrus v1.9.0 github.com/ugorji/go/codec v1.2.11 github.com/wh1te909/go-win64api v0.0.0-20210906074314-ab23795a6ae5 github.com/wh1te909/trmm-shared v0.0.0-20220227075846-f9f757361139 - golang.org/x/net v0.7.0 // indirect - golang.org/x/sys v0.6.0 + golang.org/x/net v0.9.0 // indirect + golang.org/x/sys v0.7.0 ) require ( @@ -58,7 +58,7 @@ require ( github.com/rickb777/plural v1.4.1 // indirect github.com/rogpeppe/go-internal v1.8.1 // indirect github.com/scjalliance/comshim v0.0.0-20190308082608-cf06d2532c4e // indirect - github.com/shoenig/go-m1cpu v0.1.5 // indirect + github.com/shoenig/go-m1cpu v0.1.6 // indirect github.com/spf13/afero v1.9.3 // indirect github.com/spf13/cast v1.5.0 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect @@ -67,9 +67,9 @@ require ( github.com/tklauser/go-sysconf v0.3.11 // indirect github.com/tklauser/numcpus v0.6.0 // indirect github.com/yusufpapurcu/wmi v1.2.2 // indirect - golang.org/x/crypto v0.6.0 // indirect + golang.org/x/crypto v0.8.0 // indirect golang.org/x/sync v0.1.0 // indirect - golang.org/x/text v0.7.0 // indirect + golang.org/x/text v0.9.0 // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/toast.v1 v1.0.0-20180812000517-0a84660828b2 // indirect diff --git a/go.sum b/go.sum index 37efa22..6ebe848 100644 --- a/go.sum +++ b/go.sum @@ -59,11 +59,11 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/docker/distribution v2.8.1+incompatible h1:Q50tZOPR6T/hjNsyc9g8/syEs6bk8XXApsHjKukMl68= -github.com/docker/docker v20.10.24+incompatible h1:Ugvxm7a8+Gz6vqQYQQ2W7GYq5EUPaAiuPgIfVyI3dYE= +github.com/docker/docker v23.0.3+incompatible h1:9GhVsShNWz1hO//9BNg/dpMnZW25KydO4wtVxWAIbho= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= -github.com/elastic/go-sysinfo v1.10.0 h1:8mhFXJrWFLpeskULp0sGq+jt5DA0AaPU+RfGDOJQPUA= -github.com/elastic/go-sysinfo v1.10.0/go.mod h1:RgpZTzVQX1UUNtbCnTYE5xzUaZ9+UU4ydR2ZXyzjkBg= +github.com/elastic/go-sysinfo v1.10.1 h1:qAfoDsw3lnShqqTHVBZbK4+PN3Lz5FBi3o9sM5n9O9s= +github.com/elastic/go-sysinfo v1.10.1/go.mod h1:QElTrQ6akcnAVCRwdkZtoAkwuTv8UVM4+qe0hPxT4NU= github.com/elastic/go-windows v1.0.1 h1:AlYZOldA+UJ0/2nBuqWdo90GFCgG9xuyw9SYzGUtJm0= github.com/elastic/go-windows v1.0.1/go.mod h1:FoVvqWSun28vaDQPbj2Elfc0JahhPB7WQEGa3c814Ss= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= @@ -197,7 +197,7 @@ github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/X github.com/kardianos/service v1.2.2 h1:ZvePhAHfvo0A7Mftk/tEzqEZ7Q4lgnR8sGz4xu1YX60= github.com/kardianos/service v1.2.2/go.mod h1:CIMRFEJVL+0DS1a3Nx06NaMn4Dz63Ng6O7dl0qH0zVM= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.16.0 h1:iULayQNOReoYUe+1qtKOqw9CwJv3aNQu8ivo7lw1HU4= +github.com/klauspost/compress v1.16.4 h1:91KN02FnsOYhuunwU4ssRe8lc2JosWmizWa91B5v1PU= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= @@ -215,9 +215,9 @@ github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/nats-io/jwt/v2 v2.3.0 h1:z2mA1a7tIf5ShggOFlR1oBPgd6hGqcDYsISxZByUzdI= -github.com/nats-io/nats-server/v2 v2.9.15 h1:MuwEJheIwpvFgqvbs20W8Ish2azcygjf4Z0liVu2I4c= -github.com/nats-io/nats-server/v2 v2.9.15/go.mod h1:QlCTy115fqpx4KSOPFIxSV7DdI6OxtZsGOL1JLdeRlE= +github.com/nats-io/jwt/v2 v2.4.1 h1:Y35W1dgbbz2SQUYDPCaclXcuqleVmpbRa7646Jf2EX4= +github.com/nats-io/nats-server/v2 v2.9.16 h1:SuNe6AyCcVy0g5326wtyU8TdqYmcPqzTjhkHojAjprc= +github.com/nats-io/nats-server/v2 v2.9.16/go.mod h1:z1cc5Q+kqJkz9mLUdlcSsdYnId4pyImHjNgoh6zxSC0= github.com/nats-io/nats.go v1.25.0 h1:t5/wCPGciR7X3Mu8QOi4jiJaXaWM8qtkLu4lzGZvYHE= github.com/nats-io/nats.go v1.25.0/go.mod h1:D2WALIhz7V8M0pH8Scx8JZXlg6Oqz5VG+nQkK8nJdvg= github.com/nats-io/nkeys v0.4.4 h1:xvBJ8d69TznjcQl9t6//Q5xXuVhyYiSos6RPtvQNTwA= @@ -261,14 +261,15 @@ github.com/rogpeppe/go-internal v1.8.1 h1:geMPLpDpQOgVyCg5z5GoRwLHepNdb71NXb67XF github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= github.com/scjalliance/comshim v0.0.0-20190308082608-cf06d2532c4e h1:+/AzLkOdIXEPrAQtwAeWOBnPQ0BnYlBW0aCZmSb47u4= github.com/scjalliance/comshim v0.0.0-20190308082608-cf06d2532c4e/go.mod h1:9Tc1SKnfACJb9N7cw2eyuI6xzy845G7uZONBsi5uPEA= -github.com/shirou/gopsutil/v3 v3.23.3 h1:Syt5vVZXUDXPEXpIBt5ziWsJ4LdSAAxF4l/xZeQgSEE= -github.com/shirou/gopsutil/v3 v3.23.3/go.mod h1:lSBNN6t3+D6W5e5nXTxc8KIMMVxAcS+6IJlffjRRlMU= -github.com/shoenig/go-m1cpu v0.1.4 h1:SZPIgRM2sEF9NJy50mRHu9PKGwxyyTTJIWvCtgVbozs= -github.com/shoenig/go-m1cpu v0.1.4/go.mod h1:Wwvst4LR89UxjeFtLRMrpgRiyY4xPsejnVZym39dbAQ= +github.com/shirou/gopsutil/v3 v3.23.4 h1:hZwmDxZs7Ewt75DV81r4pFMqbq+di2cbt9FsQBqLD2o= +github.com/shirou/gopsutil/v3 v3.23.4/go.mod h1:ZcGxyfzAMRevhUR2+cfhXDH6gQdFYE/t8j1nsU4mPI8= github.com/shoenig/go-m1cpu v0.1.5 h1:LF57Z/Fpb/WdGLjt2HZilNnmZOxg/q2bSKTQhgbrLrQ= github.com/shoenig/go-m1cpu v0.1.5/go.mod h1:Wwvst4LR89UxjeFtLRMrpgRiyY4xPsejnVZym39dbAQ= +github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= +github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= github.com/shoenig/test v0.6.3 h1:GVXWJFk9PiOjN0KoJ7VrJGH6uLPnqxR7/fe3HUPfE0c= github.com/shoenig/test v0.6.3/go.mod h1:byHiCGXqrVaflBLAMq/srcZIHynQPQgeyvkvXnjqq0k= +github.com/shoenig/test v0.6.4 h1:kVTaSd7WLz5WZ2IaoM0RSzRsUD+m8wRR+5qvntpn4LU= github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/spf13/afero v1.9.3 h1:41FoI0fD7OR7mGcKE/aOiLkGreyf8ifIOQmJANWogMk= @@ -325,8 +326,8 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.6.0 h1:qfktjS5LUO+fFKeJXZ+ikTRijMmljikvG68fpMMruSc= -golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= +golang.org/x/crypto v0.8.0 h1:pd9TJtTueMTVQXzk8E2XESSMQDj/U7OUu0PqJqPXQjQ= +golang.org/x/crypto v0.8.0/go.mod h1:mRqEX+O9/h5TFCrQhkgjo2yKi0yYA+9ecGkdQoHrywE= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -360,7 +361,7 @@ golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 h1:6zppjxzCulZykYSLyVDYbneBfbaBIQPYMevg0bEwv2s= +golang.org/x/mod v0.8.0 h1:LUYupSeNrTNCGzR/hVBk2NHZO4hXcVaW1k4Qx7rjPx8= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -398,8 +399,8 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211029224645-99673261e6eb/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= -golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.9.0 h1:aWJ/m6xSmxWBx+V0XRHTlrYrPG56jKsLdTFmsSsCzOM= +golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -474,8 +475,8 @@ golang.org/x/sys v0.0.0-20211107104306-e0b2ad06fe42/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ= -golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU= +golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -484,8 +485,8 @@ golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= +golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -537,7 +538,7 @@ golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= -golang.org/x/tools v0.1.12 h1:VveCTK38A2rkS8ZqFY25HIDFscX5X9OoEhJd3quQmXU= +golang.org/x/tools v0.6.0 h1:BOw41kyTf3PuCW1pVQf8+Cyg8pMlkYB1oo9iJ6D/lKM= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= From 5adb986f7f93503788e952a217bbecdd6ac557b5 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Wed, 10 May 2023 10:55:56 -0700 Subject: [PATCH 079/113] bump version --- build/rmm.exe.manifest | 2 +- build/setup.iss | 2 +- main.go | 2 +- versioninfo.json | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/build/rmm.exe.manifest b/build/rmm.exe.manifest index a6341c2..2155614 100644 --- a/build/rmm.exe.manifest +++ b/build/rmm.exe.manifest @@ -3,7 +3,7 @@ diff --git a/build/setup.iss b/build/setup.iss index 13607a2..e1a9409 100644 --- a/build/setup.iss +++ b/build/setup.iss @@ -1,5 +1,5 @@ #define MyAppName "Tactical RMM Agent" -#define MyAppVersion "2.4.6" +#define MyAppVersion "2.4.7" #define MyAppPublisher "AmidaWare LLC" #define MyAppURL "https://github.com/amidaware" #define MyAppExeName "tacticalrmm.exe" diff --git a/main.go b/main.go index 322e7c2..29acebd 100644 --- a/main.go +++ b/main.go @@ -25,7 +25,7 @@ import ( ) var ( - version = "2.4.6" + version = "2.4.7" log = logrus.New() logFile *os.File ) diff --git a/versioninfo.json b/versioninfo.json index dad4f80..bc6b3e2 100644 --- a/versioninfo.json +++ b/versioninfo.json @@ -3,13 +3,13 @@ "FileVersion": { "Major": 2, "Minor": 4, - "Patch": 6, + "Patch": 7, "Build": 0 }, "ProductVersion": { "Major": 2, "Minor": 4, - "Patch": 6, + "Patch": 7, "Build": 0 }, "FileFlagsMask": "3f", @@ -22,14 +22,14 @@ "Comments": "", "CompanyName": "AmidaWare LLC", "FileDescription": "Tactical RMM Agent", - "FileVersion": "v2.4.6.0", + "FileVersion": "v2.4.7.0", "InternalName": "tacticalrmm.exe", "LegalCopyright": "Copyright (c) 2023 AmidaWare LLC", "LegalTrademarks": "", "OriginalFilename": "tacticalrmm.exe", "PrivateBuild": "", "ProductName": "Tactical RMM Agent", - "ProductVersion": "v2.4.6.0", + "ProductVersion": "v2.4.7.0", "SpecialBuild": "" }, "VarFileInfo": { From 569a6662f08cbd2b53310c599e8ba4eb5ff727de Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Wed, 10 May 2023 18:56:49 -0700 Subject: [PATCH 080/113] don't use -File, breaks existing script args. will figure out another way to deal with spaces if using custom tmpdir --- agent/agent_windows.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/agent/agent_windows.go b/agent/agent_windows.go index fd6fb19..50bd5f0 100644 --- a/agent/agent_windows.go +++ b/agent/agent_windows.go @@ -143,7 +143,7 @@ func (a *Agent) RunScript(code string, shell string, args []string, timeout int, switch shell { case "powershell": exe = getPowershellExe() - cmdArgs = []string{"-NonInteractive", "-NoProfile", "-ExecutionPolicy", "Bypass", "-File", tmpfn.Name()} + cmdArgs = []string{"-NonInteractive", "-NoProfile", "-ExecutionPolicy", "Bypass", tmpfn.Name()} case "python": exe = a.PyBin cmdArgs = []string{tmpfn.Name()} From 071ebba4aee6398f2e3460a472f873c9bd905d93 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Wed, 10 May 2023 19:04:34 -0700 Subject: [PATCH 081/113] bump version --- build/rmm.exe.manifest | 2 +- build/setup.iss | 2 +- main.go | 2 +- versioninfo.json | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/build/rmm.exe.manifest b/build/rmm.exe.manifest index 2155614..8a4c1f7 100644 --- a/build/rmm.exe.manifest +++ b/build/rmm.exe.manifest @@ -3,7 +3,7 @@ diff --git a/build/setup.iss b/build/setup.iss index e1a9409..9e90c05 100644 --- a/build/setup.iss +++ b/build/setup.iss @@ -1,5 +1,5 @@ #define MyAppName "Tactical RMM Agent" -#define MyAppVersion "2.4.7" +#define MyAppVersion "2.4.8" #define MyAppPublisher "AmidaWare LLC" #define MyAppURL "https://github.com/amidaware" #define MyAppExeName "tacticalrmm.exe" diff --git a/main.go b/main.go index 29acebd..136bb4f 100644 --- a/main.go +++ b/main.go @@ -25,7 +25,7 @@ import ( ) var ( - version = "2.4.7" + version = "2.4.8" log = logrus.New() logFile *os.File ) diff --git a/versioninfo.json b/versioninfo.json index bc6b3e2..764bb19 100644 --- a/versioninfo.json +++ b/versioninfo.json @@ -3,13 +3,13 @@ "FileVersion": { "Major": 2, "Minor": 4, - "Patch": 7, + "Patch": 8, "Build": 0 }, "ProductVersion": { "Major": 2, "Minor": 4, - "Patch": 7, + "Patch": 8, "Build": 0 }, "FileFlagsMask": "3f", @@ -22,14 +22,14 @@ "Comments": "", "CompanyName": "AmidaWare LLC", "FileDescription": "Tactical RMM Agent", - "FileVersion": "v2.4.7.0", + "FileVersion": "v2.4.8.0", "InternalName": "tacticalrmm.exe", "LegalCopyright": "Copyright (c) 2023 AmidaWare LLC", "LegalTrademarks": "", "OriginalFilename": "tacticalrmm.exe", "PrivateBuild": "", "ProductName": "Tactical RMM Agent", - "ProductVersion": "v2.4.7.0", + "ProductVersion": "v2.4.8.0", "SpecialBuild": "" }, "VarFileInfo": { From 50ff4ba0ac97e06b6f19ae26fc6fb23af0fccf59 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Mon, 22 May 2023 13:16:51 -0700 Subject: [PATCH 082/113] remove deprecated ioutil --- agent/agent.go | 3 +-- agent/agent_windows.go | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/agent/agent.go b/agent/agent.go index 75d087b..72c3aeb 100644 --- a/agent/agent.go +++ b/agent/agent.go @@ -16,7 +16,6 @@ import ( "context" "errors" "fmt" - "io/ioutil" "math" "os" "os/exec" @@ -505,7 +504,7 @@ func (a *Agent) CleanupAgentUpdates() { func (a *Agent) RunPythonCode(code string, timeout int, args []string) (string, error) { content := []byte(code) - tmpfn, _ := ioutil.TempFile(a.WinTmpDir, "*.py") + tmpfn, _ := os.CreateTemp(a.WinTmpDir, "*.py") if _, err := tmpfn.Write(content); err != nil { a.Logger.Debugln(err) return "", err diff --git a/agent/agent_windows.go b/agent/agent_windows.go index 50bd5f0..4383276 100644 --- a/agent/agent_windows.go +++ b/agent/agent_windows.go @@ -16,7 +16,6 @@ import ( "context" "errors" "fmt" - "io/ioutil" "os" "os/exec" "path/filepath" @@ -124,7 +123,7 @@ func (a *Agent) RunScript(code string, shell string, args []string, timeout int, tmpDir = a.WinRunAsUserTmpDir } - tmpfn, err := ioutil.TempFile(tmpDir, ext) + tmpfn, err := os.CreateTemp(tmpDir, ext) if err != nil { a.Logger.Errorln(err) return "", err.Error(), 85, err From d62966dd74c7c953474d293d50ae106465ceab22 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Mon, 22 May 2023 22:04:03 +0000 Subject: [PATCH 083/113] workaround for ETXTBSY race condition --- agent/agent.go | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/agent/agent.go b/agent/agent.go index 72c3aeb..a8db028 100644 --- a/agent/agent.go +++ b/agent/agent.go @@ -23,6 +23,7 @@ import ( "runtime" "strconv" "strings" + "syscall" "time" @@ -321,8 +322,21 @@ func (a *Agent) CmdV2(c *CmdOptions) CmdStatus { } }() - // Run and wait for Cmd to return, discard Status - envCmd.Start() + // workaround for https://github.com/golang/go/issues/22315 + for i := 0; i < 5; i++ { + <-envCmd.Start() + + <-doneChan + + status := envCmd.Status() + + if errors.Is(status.Error, syscall.ETXTBSY) { + a.Logger.Errorln("CmdV2 syscall.ETXTBSY, retrying...") + time.Sleep(500 * time.Millisecond) + } else { + break + } + } go func() { select { From e15b1a50c38e57fa67728c1a941bc9360c3258bd Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Fri, 26 May 2023 14:14:40 -0700 Subject: [PATCH 084/113] also cleanup during startup --- agent/svc.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/agent/svc.go b/agent/svc.go index cdaa11e..9e7f9c0 100644 --- a/agent/svc.go +++ b/agent/svc.go @@ -55,6 +55,12 @@ func (a *Agent) AgentSvc(nc *nats.Conn) { a.Logger.Debugf("AgentSvc() sleeping for %v seconds", sleepDelay) time.Sleep(time.Duration(sleepDelay) * time.Second) + if runtime.GOOS == "windows" { + a.KillHungUpdates() + time.Sleep(1 * time.Second) + a.CleanupAgentUpdates() + } + conf := a.GetAgentCheckInConfig(a.GetCheckInConfFromAPI()) a.Logger.Debugf("+%v\n", conf) for _, s := range natsCheckin { From 5a23a55e393e066d72c03ec6c14b840440422775 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Fri, 26 May 2023 14:21:05 -0700 Subject: [PATCH 085/113] update deps --- go.mod | 7 ++++--- go.sum | 19 +++++++++---------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/go.mod b/go.mod index 2c69013..d79b597 100644 --- a/go.mod +++ b/go.mod @@ -4,14 +4,14 @@ go 1.20 require ( github.com/StackExchange/wmi v1.2.1 - github.com/elastic/go-sysinfo v1.10.1 + github.com/elastic/go-sysinfo v1.10.2 github.com/go-ole/go-ole v1.2.6 github.com/go-ping/ping v1.1.0 github.com/go-resty/resty/v2 v2.7.0 github.com/gonutz/w32/v2 v2.4.0 github.com/iamacarpet/go-win64api v0.0.0-20220531131246-e84054eb584d - github.com/nats-io/nats-server/v2 v2.9.16 // indirect - github.com/nats-io/nats.go v1.25.0 + github.com/nats-io/nats-server/v2 v2.9.17 // indirect + github.com/nats-io/nats.go v1.26.0 github.com/rickb777/date v1.19.1 github.com/shirou/gopsutil/v3 v3.23.4 github.com/sirupsen/logrus v1.9.0 @@ -44,6 +44,7 @@ require ( github.com/hashicorp/hcl v1.0.0 // indirect github.com/jaypipes/pcidb v1.0.0 // indirect github.com/joeshaw/multierror v0.0.0-20140124173710-69b34d4ec901 // indirect + github.com/klauspost/compress v1.16.5 // indirect github.com/lufia/plan9stats v0.0.0-20220517141722-cf486979b281 // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect diff --git a/go.sum b/go.sum index 6ebe848..d5c5b78 100644 --- a/go.sum +++ b/go.sum @@ -58,12 +58,12 @@ github.com/creachadair/staticfile v0.1.3/go.mod h1:a3qySzCIXEprDGxk6tSxSI+dBBdLz github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/docker/distribution v2.8.1+incompatible h1:Q50tZOPR6T/hjNsyc9g8/syEs6bk8XXApsHjKukMl68= +github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8= github.com/docker/docker v23.0.3+incompatible h1:9GhVsShNWz1hO//9BNg/dpMnZW25KydO4wtVxWAIbho= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= -github.com/elastic/go-sysinfo v1.10.1 h1:qAfoDsw3lnShqqTHVBZbK4+PN3Lz5FBi3o9sM5n9O9s= -github.com/elastic/go-sysinfo v1.10.1/go.mod h1:QElTrQ6akcnAVCRwdkZtoAkwuTv8UVM4+qe0hPxT4NU= +github.com/elastic/go-sysinfo v1.10.2 h1:DK4pBq7AHwUY+3gcBykvFmWJQWEtv01Jes3v7ss1RVI= +github.com/elastic/go-sysinfo v1.10.2/go.mod h1:6KQb31j0QeWBDF88jIdWSxE8cwoOB9tO4Y4osN7Q70E= github.com/elastic/go-windows v1.0.1 h1:AlYZOldA+UJ0/2nBuqWdo90GFCgG9xuyw9SYzGUtJm0= github.com/elastic/go-windows v1.0.1/go.mod h1:FoVvqWSun28vaDQPbj2Elfc0JahhPB7WQEGa3c814Ss= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= @@ -197,7 +197,8 @@ github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/X github.com/kardianos/service v1.2.2 h1:ZvePhAHfvo0A7Mftk/tEzqEZ7Q4lgnR8sGz4xu1YX60= github.com/kardianos/service v1.2.2/go.mod h1:CIMRFEJVL+0DS1a3Nx06NaMn4Dz63Ng6O7dl0qH0zVM= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.16.4 h1:91KN02FnsOYhuunwU4ssRe8lc2JosWmizWa91B5v1PU= +github.com/klauspost/compress v1.16.5 h1:IFV2oUNUzZaz+XyusxpLzpzS8Pt5rh0Z16For/djlyI= +github.com/klauspost/compress v1.16.5/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= @@ -216,10 +217,10 @@ github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrk github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/nats-io/jwt/v2 v2.4.1 h1:Y35W1dgbbz2SQUYDPCaclXcuqleVmpbRa7646Jf2EX4= -github.com/nats-io/nats-server/v2 v2.9.16 h1:SuNe6AyCcVy0g5326wtyU8TdqYmcPqzTjhkHojAjprc= -github.com/nats-io/nats-server/v2 v2.9.16/go.mod h1:z1cc5Q+kqJkz9mLUdlcSsdYnId4pyImHjNgoh6zxSC0= -github.com/nats-io/nats.go v1.25.0 h1:t5/wCPGciR7X3Mu8QOi4jiJaXaWM8qtkLu4lzGZvYHE= -github.com/nats-io/nats.go v1.25.0/go.mod h1:D2WALIhz7V8M0pH8Scx8JZXlg6Oqz5VG+nQkK8nJdvg= +github.com/nats-io/nats-server/v2 v2.9.17 h1:gFpUQ3hqIDJrnqog+Bl5vaXg+RhhYEZIElasEuRn2tw= +github.com/nats-io/nats-server/v2 v2.9.17/go.mod h1:eQysm3xDZmIjfkjr7DuD9DjRFpnxQc2vKVxtEg0Dp6s= +github.com/nats-io/nats.go v1.26.0 h1:fWJTYPnZ8DzxIaqIHOAMfColuznchnd5Ab5dbJpgPIE= +github.com/nats-io/nats.go v1.26.0/go.mod h1:XpbWUlOElGwTYbMR7imivs7jJj9GtK7ypv321Wp6pjc= github.com/nats-io/nkeys v0.4.4 h1:xvBJ8d69TznjcQl9t6//Q5xXuVhyYiSos6RPtvQNTwA= github.com/nats-io/nkeys v0.4.4/go.mod h1:XUkxdLPTufzlihbamfzQ7mw/VGx6ObUs+0bN5sNvt64= github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw= @@ -263,11 +264,9 @@ github.com/scjalliance/comshim v0.0.0-20190308082608-cf06d2532c4e h1:+/AzLkOdIXE github.com/scjalliance/comshim v0.0.0-20190308082608-cf06d2532c4e/go.mod h1:9Tc1SKnfACJb9N7cw2eyuI6xzy845G7uZONBsi5uPEA= github.com/shirou/gopsutil/v3 v3.23.4 h1:hZwmDxZs7Ewt75DV81r4pFMqbq+di2cbt9FsQBqLD2o= github.com/shirou/gopsutil/v3 v3.23.4/go.mod h1:ZcGxyfzAMRevhUR2+cfhXDH6gQdFYE/t8j1nsU4mPI8= -github.com/shoenig/go-m1cpu v0.1.5 h1:LF57Z/Fpb/WdGLjt2HZilNnmZOxg/q2bSKTQhgbrLrQ= github.com/shoenig/go-m1cpu v0.1.5/go.mod h1:Wwvst4LR89UxjeFtLRMrpgRiyY4xPsejnVZym39dbAQ= github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= -github.com/shoenig/test v0.6.3 h1:GVXWJFk9PiOjN0KoJ7VrJGH6uLPnqxR7/fe3HUPfE0c= github.com/shoenig/test v0.6.3/go.mod h1:byHiCGXqrVaflBLAMq/srcZIHynQPQgeyvkvXnjqq0k= github.com/shoenig/test v0.6.4 h1:kVTaSd7WLz5WZ2IaoM0RSzRsUD+m8wRR+5qvntpn4LU= github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= From ee19c7a4fc726fd9712c7b2a2c8d5fed64351064 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Tue, 30 May 2023 13:01:52 -0700 Subject: [PATCH 086/113] fix nil error being returned --- agent/agent_windows.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/agent/agent_windows.go b/agent/agent_windows.go index 4383276..87c3667 100644 --- a/agent/agent_windows.go +++ b/agent/agent_windows.go @@ -622,8 +622,9 @@ func (a *Agent) AgentUpdate(url, inno, version string) error { return err } if r.IsError() { - a.Logger.Errorln("Download failed with status code", r.StatusCode()) - return err + ret := fmt.Sprintf("Download failed with status code %d", r.StatusCode()) + a.Logger.Errorln(ret) + return errors.New(ret) } innoLogFile := filepath.Join(a.WinTmpDir, fmt.Sprintf("tacticalagent_update_v%s.txt", version)) From 836c274e8377796bb857720f3b38ed31a4a9bbcf Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Tue, 30 May 2023 14:08:06 -0700 Subject: [PATCH 087/113] bump version --- build/rmm.exe.manifest | 2 +- build/setup.iss | 2 +- main.go | 2 +- versioninfo.json | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/build/rmm.exe.manifest b/build/rmm.exe.manifest index 8a4c1f7..1ca074c 100644 --- a/build/rmm.exe.manifest +++ b/build/rmm.exe.manifest @@ -3,7 +3,7 @@ diff --git a/build/setup.iss b/build/setup.iss index 9e90c05..296f3fd 100644 --- a/build/setup.iss +++ b/build/setup.iss @@ -1,5 +1,5 @@ #define MyAppName "Tactical RMM Agent" -#define MyAppVersion "2.4.8" +#define MyAppVersion "2.4.9" #define MyAppPublisher "AmidaWare LLC" #define MyAppURL "https://github.com/amidaware" #define MyAppExeName "tacticalrmm.exe" diff --git a/main.go b/main.go index 136bb4f..9efba18 100644 --- a/main.go +++ b/main.go @@ -25,7 +25,7 @@ import ( ) var ( - version = "2.4.8" + version = "2.4.9" log = logrus.New() logFile *os.File ) diff --git a/versioninfo.json b/versioninfo.json index 764bb19..14ec152 100644 --- a/versioninfo.json +++ b/versioninfo.json @@ -3,13 +3,13 @@ "FileVersion": { "Major": 2, "Minor": 4, - "Patch": 8, + "Patch": 9, "Build": 0 }, "ProductVersion": { "Major": 2, "Minor": 4, - "Patch": 8, + "Patch": 9, "Build": 0 }, "FileFlagsMask": "3f", @@ -22,14 +22,14 @@ "Comments": "", "CompanyName": "AmidaWare LLC", "FileDescription": "Tactical RMM Agent", - "FileVersion": "v2.4.8.0", + "FileVersion": "v2.4.9.0", "InternalName": "tacticalrmm.exe", "LegalCopyright": "Copyright (c) 2023 AmidaWare LLC", "LegalTrademarks": "", "OriginalFilename": "tacticalrmm.exe", "PrivateBuild": "", "ProductName": "Tactical RMM Agent", - "ProductVersion": "v2.4.8.0", + "ProductVersion": "v2.4.9.0", "SpecialBuild": "" }, "VarFileInfo": { From 7f9e3f0f7dd7bf86bddb64b72ee1dbd3e9f12b5b Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Sun, 30 Jul 2023 13:19:56 -0700 Subject: [PATCH 088/113] don't fail if user is not logged in closes amidaware/tacticalrmm#1573 --- agent/agent_windows.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/agent/agent_windows.go b/agent/agent_windows.go index 87c3667..ebdce00 100644 --- a/agent/agent_windows.go +++ b/agent/agent_windows.go @@ -161,11 +161,10 @@ func (a *Agent) RunScript(code string, shell string, args []string, timeout int, cmd := exec.Command(exe, cmdArgs...) if runasuser { token, err := wintoken.GetInteractiveToken(wintoken.TokenImpersonation) - if err != nil { - return "", err.Error(), 66, err + if err == nil { + defer token.Close() + cmd.SysProcAttr = &syscall.SysProcAttr{Token: syscall.Token(token.Token()), HideWindow: true} } - defer token.Close() - cmd.SysProcAttr = &syscall.SysProcAttr{Token: syscall.Token(token.Token()), HideWindow: true} } cmd.Stdout = &outb cmd.Stderr = &errb From 150e1eda22248961f8f926a0cb59f09def3f84f6 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Sun, 30 Jul 2023 16:40:35 -0700 Subject: [PATCH 089/113] update reqs --- .github/workflows/ci.yml | 2 +- go.mod | 33 +++++++-------- go.sum | 91 ++++++++++++++++++++-------------------- main.go | 2 +- 4 files changed, 63 insertions(+), 65 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 002baba..87b6ac2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ jobs: - uses: actions/setup-go@v4 with: - go-version: '1.20.4' + go-version: '1.20.6' - name: Ensure linux agent compiles run: | diff --git a/go.mod b/go.mod index d79b597..72869eb 100644 --- a/go.mod +++ b/go.mod @@ -4,34 +4,34 @@ go 1.20 require ( github.com/StackExchange/wmi v1.2.1 - github.com/elastic/go-sysinfo v1.10.2 + github.com/elastic/go-sysinfo v1.11.0 github.com/go-ole/go-ole v1.2.6 github.com/go-ping/ping v1.1.0 github.com/go-resty/resty/v2 v2.7.0 github.com/gonutz/w32/v2 v2.4.0 - github.com/iamacarpet/go-win64api v0.0.0-20220531131246-e84054eb584d - github.com/nats-io/nats-server/v2 v2.9.17 // indirect - github.com/nats-io/nats.go v1.26.0 + github.com/iamacarpet/go-win64api v0.0.0-20230324134531-ef6dbdd6db97 + github.com/nats-io/nats-server/v2 v2.9.20 // indirect + github.com/nats-io/nats.go v1.28.0 github.com/rickb777/date v1.19.1 - github.com/shirou/gopsutil/v3 v3.23.4 - github.com/sirupsen/logrus v1.9.0 + github.com/shirou/gopsutil/v3 v3.23.6 + github.com/sirupsen/logrus v1.9.3 github.com/ugorji/go/codec v1.2.11 github.com/wh1te909/go-win64api v0.0.0-20210906074314-ab23795a6ae5 github.com/wh1te909/trmm-shared v0.0.0-20220227075846-f9f757361139 - golang.org/x/net v0.9.0 // indirect - golang.org/x/sys v0.7.0 + golang.org/x/net v0.10.0 // indirect + golang.org/x/sys v0.9.0 ) require ( github.com/amidaware/taskmaster v0.0.0-20220111015025-c9cd178bbbf2 - github.com/go-cmd/cmd v1.4.1 + github.com/go-cmd/cmd v1.4.2 ) require ( github.com/fourcorelabs/wintoken v1.0.0 - github.com/jaypipes/ghw v0.10.0 + github.com/jaypipes/ghw v0.12.0 github.com/kardianos/service v1.2.2 - github.com/spf13/viper v1.15.0 + github.com/spf13/viper v1.16.0 ) require ( @@ -52,23 +52,22 @@ require ( github.com/nats-io/nkeys v0.4.4 // indirect github.com/nats-io/nuid v1.0.1 // indirect github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d // indirect - github.com/pelletier/go-toml/v2 v2.0.6 // indirect + github.com/pelletier/go-toml/v2 v2.0.8 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c // indirect github.com/prometheus/procfs v0.8.0 // indirect github.com/rickb777/plural v1.4.1 // indirect - github.com/rogpeppe/go-internal v1.8.1 // indirect github.com/scjalliance/comshim v0.0.0-20190308082608-cf06d2532c4e // indirect github.com/shoenig/go-m1cpu v0.1.6 // indirect - github.com/spf13/afero v1.9.3 // indirect - github.com/spf13/cast v1.5.0 // indirect + github.com/spf13/afero v1.9.5 // indirect + github.com/spf13/cast v1.5.1 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/subosito/gotenv v1.4.2 // indirect github.com/tklauser/go-sysconf v0.3.11 // indirect github.com/tklauser/numcpus v0.6.0 // indirect - github.com/yusufpapurcu/wmi v1.2.2 // indirect - golang.org/x/crypto v0.8.0 // indirect + github.com/yusufpapurcu/wmi v1.2.3 // indirect + golang.org/x/crypto v0.9.0 // indirect golang.org/x/sync v0.1.0 // indirect golang.org/x/text v0.9.0 // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect diff --git a/go.sum b/go.sum index d5c5b78..d1f81d5 100644 --- a/go.sum +++ b/go.sum @@ -62,8 +62,8 @@ github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m3 github.com/docker/docker v23.0.3+incompatible h1:9GhVsShNWz1hO//9BNg/dpMnZW25KydO4wtVxWAIbho= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= -github.com/elastic/go-sysinfo v1.10.2 h1:DK4pBq7AHwUY+3gcBykvFmWJQWEtv01Jes3v7ss1RVI= -github.com/elastic/go-sysinfo v1.10.2/go.mod h1:6KQb31j0QeWBDF88jIdWSxE8cwoOB9tO4Y4osN7Q70E= +github.com/elastic/go-sysinfo v1.11.0 h1:QW+6BF1oxBoAprH3w2yephF7xLkrrSXj7gl2xC2BM4w= +github.com/elastic/go-sysinfo v1.11.0/go.mod h1:6KQb31j0QeWBDF88jIdWSxE8cwoOB9tO4Y4osN7Q70E= github.com/elastic/go-windows v1.0.1 h1:AlYZOldA+UJ0/2nBuqWdo90GFCgG9xuyw9SYzGUtJm0= github.com/elastic/go-windows v1.0.1/go.mod h1:FoVvqWSun28vaDQPbj2Elfc0JahhPB7WQEGa3c814Ss= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= @@ -74,15 +74,15 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.m github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/fourcorelabs/wintoken v1.0.0 h1:dskUYLAFHNy1cbS5MXsNFXauQzxieTrZlffQZ0Yu19I= github.com/fourcorelabs/wintoken v1.0.0/go.mod h1:jKyXHt079W09KwEMbUC9g+R2KDs5kVvSKPUiF5p0ejs= -github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= +github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/go-cmd/cmd v1.4.1 h1:JUcEIE84v8DSy02XTZpUDeGKExk2oW3DA10hTjbQwmc= -github.com/go-cmd/cmd v1.4.1/go.mod h1:tbBenttXtZU4c5djS1o7PWL5pd2xAr5sIqH1kGdNiRc= +github.com/go-cmd/cmd v1.4.2 h1:pnX38iIJHh4huzBSqfkAZkfXrVwM/5EccAJmrVqMnbg= +github.com/go-cmd/cmd v1.4.2/go.mod h1:u3hxg/ry+D5kwh8WvUkHLAMe2zQCaXd00t35WfQaOFk= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -94,7 +94,7 @@ github.com/go-ping/ping v1.1.0 h1:3MCGhVX4fyEUuhsfwPrsEdQw6xspHkv5zHsiSoDFZYw= github.com/go-ping/ping v1.1.0/go.mod h1:xIFjORFzTxqIV/tDVGO4eDy/bLuSyawEeojSm3GfRGk= github.com/go-resty/resty/v2 v2.7.0 h1:me+K9p3uhSmXtrBZ4k9jcEAfJmuC8IivWHwaLZwPrFY= github.com/go-resty/resty/v2 v2.7.0/go.mod h1:9PWDzw47qPphMRFfhsyk0NnSgvluHcljSMVIq3w7q0I= -github.com/go-test/deep v1.0.7 h1:/VSMRlnY/JSyqxQUzQLKVMAskpY/NZKFA5j2P+0pP2M= +github.com/go-test/deep v1.1.0 h1:WOcxcdHcvdgThNXjw0t76K42FXTU7HpNQWHpA2HHNlg= github.com/godbus/dbus v4.1.0+incompatible/go.mod h1:/YcGZj5zSblfDWMMoOzV4fas9FZnQYTkDnsGvmh2Grw= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= @@ -123,7 +123,7 @@ github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvq github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/gonutz/w32/v2 v2.4.0 h1:k+R8/ddsnb9dwVDsTDWvkJGFmYJDI3ZMgcKgdpLuMpw= github.com/gonutz/w32/v2 v2.4.0/go.mod h1:MgtHx0AScDVNKyB+kjyPder4xIi3XAcHS6LDDU2DmdE= github.com/google/aukera v0.0.0-20201117230544-d145c8357fea/go.mod h1:oXqTZORBzdwQ6L32YjJmaPajqIV/hoGEouwpFMf4cJE= @@ -181,12 +181,12 @@ github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/iamacarpet/go-win64api v0.0.0-20210311141720-fe38760bed28/go.mod h1:oGJx9dz0Ny7HC7U55RZ0Smd6N9p3hXP/+hOFtuYrAxM= -github.com/iamacarpet/go-win64api v0.0.0-20220531131246-e84054eb584d h1:oEqcxSYuVSzQiXfTdp1BTJoowIUTPLCA3fOnfyZO50w= -github.com/iamacarpet/go-win64api v0.0.0-20220531131246-e84054eb584d/go.mod h1:B7zFQPAznj+ujXel5X+LUoK3LgY6VboCdVYHZNn7gpg= +github.com/iamacarpet/go-win64api v0.0.0-20230324134531-ef6dbdd6db97 h1:VjwKCN2PMLlMKM2k9AW8QQsfmEH43ldlX+JGeWW9cEE= +github.com/iamacarpet/go-win64api v0.0.0-20230324134531-ef6dbdd6db97/go.mod h1:B7zFQPAznj+ujXel5X+LUoK3LgY6VboCdVYHZNn7gpg= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/jaypipes/ghw v0.10.0 h1:UHu9UX08Py315iPojADFPOkmjTsNzHj4g4adsNKKteY= -github.com/jaypipes/ghw v0.10.0/go.mod h1:jeJGbkRB2lL3/gxYzNYzEDETV1ZJ56OKr+CSeSEym+g= +github.com/jaypipes/ghw v0.12.0 h1:xU2/MDJfWmBhJnujHY9qwXQLs3DBsf0/Xa9vECY0Tho= +github.com/jaypipes/ghw v0.12.0/go.mod h1:jeJGbkRB2lL3/gxYzNYzEDETV1ZJ56OKr+CSeSEym+g= github.com/jaypipes/pcidb v1.0.0 h1:vtZIfkiCUE42oYbJS0TAq9XSfSmcsgo9IdxSm9qzYU8= github.com/jaypipes/pcidb v1.0.0/go.mod h1:TnYUvqhPBzCKnH34KrIX22kAeEbDCSRJ9cqLRCuNDfk= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= @@ -202,7 +202,7 @@ github.com/klauspost/compress v1.16.5/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQs github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -217,10 +217,10 @@ github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrk github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/nats-io/jwt/v2 v2.4.1 h1:Y35W1dgbbz2SQUYDPCaclXcuqleVmpbRa7646Jf2EX4= -github.com/nats-io/nats-server/v2 v2.9.17 h1:gFpUQ3hqIDJrnqog+Bl5vaXg+RhhYEZIElasEuRn2tw= -github.com/nats-io/nats-server/v2 v2.9.17/go.mod h1:eQysm3xDZmIjfkjr7DuD9DjRFpnxQc2vKVxtEg0Dp6s= -github.com/nats-io/nats.go v1.26.0 h1:fWJTYPnZ8DzxIaqIHOAMfColuznchnd5Ab5dbJpgPIE= -github.com/nats-io/nats.go v1.26.0/go.mod h1:XpbWUlOElGwTYbMR7imivs7jJj9GtK7ypv321Wp6pjc= +github.com/nats-io/nats-server/v2 v2.9.20 h1:bt1dW6xsL1hWWwv7Hovm+EJt5L6iplyqlgEFkoEUk0k= +github.com/nats-io/nats-server/v2 v2.9.20/go.mod h1:aTb/xtLCGKhfTFLxP591CMWfkdgBmcUUSkiSOe5A3gw= +github.com/nats-io/nats.go v1.28.0 h1:Th4G6zdsz2d0OqXdfzKLClo6bOfoI/b1kInhRtFIy5c= +github.com/nats-io/nats.go v1.28.0/go.mod h1:XpbWUlOElGwTYbMR7imivs7jJj9GtK7ypv321Wp6pjc= github.com/nats-io/nkeys v0.4.4 h1:xvBJ8d69TznjcQl9t6//Q5xXuVhyYiSos6RPtvQNTwA= github.com/nats-io/nkeys v0.4.4/go.mod h1:XUkxdLPTufzlihbamfzQ7mw/VGx6ObUs+0bN5sNvt64= github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw= @@ -235,9 +235,8 @@ github.com/onsi/gomega v1.10.2/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1y github.com/onsi/gomega v1.19.0 h1:4ieX6qQjPP/BfC3mpsAtIGGlxTWPeA3Inl/7DtXw1tw= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/image-spec v1.0.2 h1:9yCKha/T5XdGtO0q9Q9a6T5NUCsTn/DrBg0D7ufOcFM= -github.com/pelletier/go-toml/v2 v2.0.6 h1:nrzqCb7j9cDFj2coyLNLaZuJTLjWjlaz6nvTvIwycIU= -github.com/pelletier/go-toml/v2 v2.0.6/go.mod h1:eumQOmlWiOPt5WriQQqoM5y18pDHwha2N+QD+EUNTek= -github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= +github.com/pelletier/go-toml/v2 v2.0.8 h1:0ctb6s9mE31h0/lhu+J6OPmVeDxJn+kYnJc2jZR9tGQ= +github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNcZljzZR9VXg+4= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -258,29 +257,27 @@ github.com/rickb777/plural v1.4.1 h1:5MMLcbIaapLFmvDGRT5iPk8877hpTPt8Y9cdSKRw9sU github.com/rickb777/plural v1.4.1/go.mod h1:kdmXUpmKBJTS0FtG/TFumd//VBWsNTD7zOw7x4umxNw= github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.8.1 h1:geMPLpDpQOgVyCg5z5GoRwLHepNdb71NXb67XFkP+Eg= -github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= +github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= github.com/scjalliance/comshim v0.0.0-20190308082608-cf06d2532c4e h1:+/AzLkOdIXEPrAQtwAeWOBnPQ0BnYlBW0aCZmSb47u4= github.com/scjalliance/comshim v0.0.0-20190308082608-cf06d2532c4e/go.mod h1:9Tc1SKnfACJb9N7cw2eyuI6xzy845G7uZONBsi5uPEA= -github.com/shirou/gopsutil/v3 v3.23.4 h1:hZwmDxZs7Ewt75DV81r4pFMqbq+di2cbt9FsQBqLD2o= -github.com/shirou/gopsutil/v3 v3.23.4/go.mod h1:ZcGxyfzAMRevhUR2+cfhXDH6gQdFYE/t8j1nsU4mPI8= -github.com/shoenig/go-m1cpu v0.1.5/go.mod h1:Wwvst4LR89UxjeFtLRMrpgRiyY4xPsejnVZym39dbAQ= +github.com/shirou/gopsutil/v3 v3.23.6 h1:5y46WPI9QBKBbK7EEccUPNXpJpNrvPuTD0O2zHEHT08= +github.com/shirou/gopsutil/v3 v3.23.6/go.mod h1:j7QX50DrXYggrpN30W0Mo+I4/8U2UUIQrnrhqUeWrAU= github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= -github.com/shoenig/test v0.6.3/go.mod h1:byHiCGXqrVaflBLAMq/srcZIHynQPQgeyvkvXnjqq0k= github.com/shoenig/test v0.6.4 h1:kVTaSd7WLz5WZ2IaoM0RSzRsUD+m8wRR+5qvntpn4LU= -github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= -github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= -github.com/spf13/afero v1.9.3 h1:41FoI0fD7OR7mGcKE/aOiLkGreyf8ifIOQmJANWogMk= -github.com/spf13/afero v1.9.3/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcDf8Y= -github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w= -github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= +github.com/shoenig/test v0.6.4/go.mod h1:byHiCGXqrVaflBLAMq/srcZIHynQPQgeyvkvXnjqq0k= +github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= +github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= +github.com/spf13/afero v1.9.5 h1:stMpOSZFs//0Lv29HduCmli3GUfpFoF3Y1Q/aXj/wVM= +github.com/spf13/afero v1.9.5/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= +github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA= +github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48= github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/viper v1.15.0 h1:js3yy885G8xwJa6iOISGFwd+qlUo5AvyXb7CiihdtiU= -github.com/spf13/viper v1.15.0/go.mod h1:fFcTBJxvhhzSJiZy8n+PeW6t8l+KeT/uTARa0jHOQLA= +github.com/spf13/viper v1.16.0 h1:rGGH0XDZhdUOryiDWjmIvUSWpbNqisK8Wk0Vyefw8hc= +github.com/spf13/viper v1.16.0/go.mod h1:yg78JgCJcbrQOvV9YLXgkLaZqUidkY9K+Dd1FofRzQg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= @@ -291,9 +288,9 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5 github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= -github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8= github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= github.com/tklauser/go-sysconf v0.3.11 h1:89WgdJhk5SNwJfu+GKyYveZ4IaJ7xAkecBo+KdJV0CM= @@ -310,8 +307,8 @@ github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yusufpapurcu/wmi v1.2.2 h1:KBNDSne4vP5mbSWnJbO+51IMOXJB67QiYCSBrubbPRg= -github.com/yusufpapurcu/wmi v1.2.2/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= +github.com/yusufpapurcu/wmi v1.2.3 h1:E1ctvB7uKFMOJw3fdOW32DwGE9I7t++CRUEMKvFoFiw= +github.com/yusufpapurcu/wmi v1.2.3/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= @@ -324,9 +321,9 @@ golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.8.0 h1:pd9TJtTueMTVQXzk8E2XESSMQDj/U7OUu0PqJqPXQjQ= -golang.org/x/crypto v0.8.0/go.mod h1:mRqEX+O9/h5TFCrQhkgjo2yKi0yYA+9ecGkdQoHrywE= +golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.9.0 h1:LF6fAI+IutBocDJ2OT0Q1g8plpYljMZ4+lty+dsqw3g= +golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -398,8 +395,9 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211029224645-99673261e6eb/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.9.0 h1:aWJ/m6xSmxWBx+V0XRHTlrYrPG56jKsLdTFmsSsCzOM= -golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= +golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= +golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -474,8 +472,8 @@ golang.org/x/sys v0.0.0-20211107104306-e0b2ad06fe42/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU= -golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.9.0 h1:KS/R3tvhPqvJvwcKfnBHJwwthS11LRhmM5D59eEXa0s= +golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -484,6 +482,7 @@ golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -630,7 +629,7 @@ google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2 google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= -google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= +google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= diff --git a/main.go b/main.go index 9efba18..7c3d651 100644 --- a/main.go +++ b/main.go @@ -25,7 +25,7 @@ import ( ) var ( - version = "2.4.9" + version = "2.4.10-dev" log = logrus.New() logFile *os.File ) From e51e4ccf83988c4a27e910fb8552bf98baa52235 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Sun, 30 Jul 2023 22:50:21 -0700 Subject: [PATCH 090/113] seed is no longer needed since 1.20 --- agent/utils.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/agent/utils.go b/agent/utils.go index 8db3341..623126e 100644 --- a/agent/utils.go +++ b/agent/utils.go @@ -128,7 +128,6 @@ func (a *Agent) PublicIP() string { // GenerateAgentID creates and returns a unique agent id func GenerateAgentID() string { - rand.Seed(time.Now().UnixNano()) letters := []rune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ") b := make([]rune, 40) for i := range b { @@ -297,7 +296,6 @@ func ByteCountSI(b uint64) string { } func randRange(min, max int) int { - rand.Seed(time.Now().UnixNano()) return rand.Intn(max-min) + min } From 8e6858778bcf717d5cea8d2dc17a28c4aad4efb9 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Mon, 31 Jul 2023 19:11:02 -0700 Subject: [PATCH 091/113] ventura mesh fix --- agent/embed_darwin.go | 24 +++++++ agent/embed_stub.go | 17 +++++ agent/scripts/macos_fix_mesh_install.sh | 90 +++++++++++++++++++++++++ agent/svc.go | 4 ++ main.go | 2 + 5 files changed, 137 insertions(+) create mode 100644 agent/embed_darwin.go create mode 100644 agent/embed_stub.go create mode 100644 agent/scripts/macos_fix_mesh_install.sh diff --git a/agent/embed_darwin.go b/agent/embed_darwin.go new file mode 100644 index 0000000..6a42a6d --- /dev/null +++ b/agent/embed_darwin.go @@ -0,0 +1,24 @@ +//go:build darwin +// +build darwin + +/* +Copyright 2023 Amidaware Inc. + +Licensed under the Tactical RMM License Version 1.0 (the “License”). +You may only use the Licensed Software in accordance with the License. +A copy of the License is available at: + +https://license.tacticalrmm.com + +*/ + +package agent + +import _ "embed" + +//go:embed scripts/macos_fix_mesh_install.sh +var ventura_mesh_fix string + +func (a *Agent) FixVenturaMesh() { + a.RunScript(ventura_mesh_fix, "foo", []string{}, 45, false, []string{}) +} diff --git a/agent/embed_stub.go b/agent/embed_stub.go new file mode 100644 index 0000000..68f799f --- /dev/null +++ b/agent/embed_stub.go @@ -0,0 +1,17 @@ +//go:build !darwin +// +build !darwin + +/* +Copyright 2023 Amidaware Inc. + +Licensed under the Tactical RMM License Version 1.0 (the “License”). +You may only use the Licensed Software in accordance with the License. +A copy of the License is available at: + +https://license.tacticalrmm.com + +*/ + +package agent + +func (a *Agent) FixVenturaMesh() {} diff --git a/agent/scripts/macos_fix_mesh_install.sh b/agent/scripts/macos_fix_mesh_install.sh new file mode 100644 index 0000000..b6e9c0b --- /dev/null +++ b/agent/scripts/macos_fix_mesh_install.sh @@ -0,0 +1,90 @@ +#!/usr/bin/env bash + +# source: https://github.com/amidaware/community-scripts/blob/main/scripts_staging/macos_fix_mesh_install.sh +# author: https://github.com/NiceGuyIT + +# This script fixes MeshAgent issue #161: MacOS Ventura - Not starting meshagent on boot (Maybe Solved) +# https://github.com/Ylianst/MeshAgent/issues/161 +# +# The following actions are taken: +# 1) Add the eXecute bit for directory traversal for the installation directory. This allows regular users +# access to run the binary inside the directory, fixing the "meshagent" LaunchAgent integration with the +# user. +# 2) Rename the LaunchAgent "meshagent.plist" to prevent conflicts with the LaunchDaemon "meshagent.plist". +# This may not be needed but is done for good measure. +# 3) Rename the service Label inside the plist. Using "defaults" causes the plist to be rewritten in plist +# format, not ascii. +# +# Here's the original plist from my install. +# +# +# +# +# Label +# meshagent +# ProgramArguments +# +# /opt/tacticalmesh/meshagent +# -kvm1 +# +# +# WorkingDirectory +# /opt/tacticalmesh +# +# RunAtLoad +# +# LimitLoadToSessionType +# +# LoginWindow +# +# KeepAlive +# +# Crashed +# +# +# +# + + +mesh_install_dir="/opt/tacticalmesh/" +mesh_agent_plist_old="/Library/LaunchAgents/meshagent.plist" +mesh_agent_plist="/Library/LaunchAgents/meshagent-agent.plist" +mesh_daemon_plist="/Library/LaunchDaemons/meshagent.plist" + +if [ ! -f "${mesh_daemon_plist}" ] +then + echo "meshagent LaunchDaemon does not exist to cause the duplicate service name issue. Exiting." + exit 0 +fi + +if /usr/bin/stat -f "%Sp" "${mesh_install_dir}" | grep -v 'x$' >/dev/null +then + echo "Fixing permissions on meshagent installation directory: ${mesh_install_dir}" + chmod o+X "${mesh_install_dir}" +else + echo "No action taken. Permissions on meshagent installation directory have already been fixed." +fi +echo + +if [ -f "${mesh_agent_plist_old}" ] +then + echo "Renaming agent plist: ${mesh_agent_plist_old}" + mv "${mesh_agent_plist_old}" "${mesh_agent_plist}" +else + echo "No action taken. meshagent.plist was already renamed: ${mesh_agent_plist}" +fi +echo + +# New file has to exist before renaming the label. +if [ -f "${mesh_agent_plist}" ] +then + label=$(defaults read "${mesh_agent_plist}" Label) + if [ "${label}" != "meshagent-agent" ] + then + echo "Renaming meshagent label in plist: ${mesh_agent_plist}" + echo "Warning: This will convert the plist from a text file to a binary plist file." + defaults write "${mesh_agent_plist}" Label "meshagent-agent" + else + echo "No action taken. meshagent label was already renamed: ${label}" + fi +fi diff --git a/agent/svc.go b/agent/svc.go index 9e7f9c0..eacc8c0 100644 --- a/agent/svc.go +++ b/agent/svc.go @@ -80,6 +80,10 @@ func (a *Agent) AgentSvc(nc *nats.Conn) { a.SendSoftware() } + if runtime.GOOS == "darwin" { + go a.FixVenturaMesh() + } + checkInHelloTicker := time.NewTicker(time.Duration(conf.Hello) * time.Second) checkInAgentInfoTicker := time.NewTicker(time.Duration(conf.AgentInfo) * time.Second) checkInWinSvcTicker := time.NewTicker(time.Duration(conf.WinSvc) * time.Second) diff --git a/main.go b/main.go index 7c3d651..d882274 100644 --- a/main.go +++ b/main.go @@ -119,6 +119,8 @@ func main() { a.RunMigrations() case "recovermesh": a.RecoverMesh() + case "macventurafix": + a.FixVenturaMesh() case "taskrunner": if len(os.Args) < 5 || *taskPK == 0 { return From f00b03b973ba40414b45c9421f1bdfdbf15f5b1d Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Tue, 1 Aug 2023 04:42:37 +0000 Subject: [PATCH 092/113] fix format --- agent/agent_unix.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/agent/agent_unix.go b/agent/agent_unix.go index aa633b3..bcd0e02 100644 --- a/agent/agent_unix.go +++ b/agent/agent_unix.go @@ -273,7 +273,7 @@ func (a *Agent) AgentUpdate(url, inno, version string) error { se := a.NewCMDOpts() se.Command = fmt.Sprintf("restorecon -rv %s", self) out := a.CmdV2(se) - a.Logger.Debugln("%+v\n", out) + a.Logger.Debugf("%+v\n", out) } opts := a.NewCMDOpts() From 830f41888800e18a53bc2d58870ac1d56abd5828 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Tue, 1 Aug 2023 05:07:59 +0000 Subject: [PATCH 093/113] add timeout flag to installer closes #28 --- agent/install.go | 1 + 1 file changed, 1 insertion(+) diff --git a/agent/install.go b/agent/install.go index 241d64b..35c354c 100644 --- a/agent/install.go +++ b/agent/install.go @@ -186,6 +186,7 @@ func (a *Agent) Install(i *Installer) { } else { opts := a.NewCMDOpts() opts.Command = fmt.Sprintf("%s -install --installPath=%s", meshOutput, nixMeshDir) + opts.Timeout = i.Timeout out := a.CmdV2(opts) if out.Status.Exit != 0 { a.Logger.Fatalln("Error installing mesh agent:", out.Stderr) From 6c1fa2f06150e9c24ee155f55259b28abf950831 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Tue, 1 Aug 2023 05:09:48 +0000 Subject: [PATCH 094/113] fix timeout not working on linux/mac --- agent/agent.go | 56 ++++++++++++++++++++++++++++---------------------- 1 file changed, 32 insertions(+), 24 deletions(-) diff --git a/agent/agent.go b/agent/agent.go index a8db028..4020052 100644 --- a/agent/agent.go +++ b/agent/agent.go @@ -254,7 +254,7 @@ type CmdOptions struct { func (a *Agent) NewCMDOpts() *CmdOptions { return &CmdOptions{ Shell: "/bin/bash", - Timeout: 30, + Timeout: 60, } } @@ -322,38 +322,46 @@ func (a *Agent) CmdV2(c *CmdOptions) CmdStatus { } }() + statusChan := make(chan gocmd.Status, 1) // workaround for https://github.com/golang/go/issues/22315 - for i := 0; i < 5; i++ { - <-envCmd.Start() - - <-doneChan - - status := envCmd.Status() - - if errors.Is(status.Error, syscall.ETXTBSY) { - a.Logger.Errorln("CmdV2 syscall.ETXTBSY, retrying...") - time.Sleep(500 * time.Millisecond) - } else { - break - } - } - go func() { - select { - case <-doneChan: + for i := 0; i < 5; i++ { + finalStatus := <-envCmd.Start() + if errors.Is(finalStatus.Error, syscall.ETXTBSY) { + a.Logger.Errorln("CmdV2 syscall.ETXTBSY, retrying...") + time.Sleep(500 * time.Millisecond) + continue + } + statusChan <- finalStatus return - case <-ctx.Done(): - a.Logger.Debugf("Command timed out after %d seconds\n", c.Timeout) - pid := envCmd.Status().PID - a.Logger.Debugln("Killing process with PID", pid) - KillProc(int32(pid)) } }() + var finalStatus gocmd.Status + + select { + case <-ctx.Done(): + a.Logger.Debugf("Command timed out after %d seconds\n", c.Timeout) + pid := envCmd.Status().PID + a.Logger.Debugln("Killing process with PID", pid) + KillProc(int32(pid)) + finalStatus.Exit = 98 + ret := CmdStatus{ + Status: finalStatus, + Stdout: CleanString(stdoutBuf.String()), + Stderr: fmt.Sprintf("%s\nTimed out after %d seconds", CleanString(stderrBuf.String()), c.Timeout), + } + a.Logger.Debugf("%+v\n", ret) + return ret + case finalStatus = <-statusChan: + // done + } + // Wait for goroutine to print everything <-doneChan + ret := CmdStatus{ - Status: envCmd.Status(), + Status: finalStatus, Stdout: CleanString(stdoutBuf.String()), Stderr: CleanString(stderrBuf.String()), } From c4b006b21285ee6d30971517355c7979e2435c3c Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Sun, 6 Aug 2023 11:19:00 -0700 Subject: [PATCH 095/113] update deps --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 72869eb..ac512b9 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/shirou/gopsutil/v3 v3.23.6 github.com/sirupsen/logrus v1.9.3 github.com/ugorji/go/codec v1.2.11 - github.com/wh1te909/go-win64api v0.0.0-20210906074314-ab23795a6ae5 + github.com/wh1te909/go-win64api v0.0.0-20230802051600-21b24f62e846 github.com/wh1te909/trmm-shared v0.0.0-20220227075846-f9f757361139 golang.org/x/net v0.10.0 // indirect golang.org/x/sys v0.9.0 diff --git a/go.sum b/go.sum index d1f81d5..8ac1a15 100644 --- a/go.sum +++ b/go.sum @@ -301,6 +301,8 @@ github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4d github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= github.com/wh1te909/go-win64api v0.0.0-20210906074314-ab23795a6ae5 h1:8tp/+fGR+qjDQ00vm0ZorHzskquo76MY9/ChmFFunEA= github.com/wh1te909/go-win64api v0.0.0-20210906074314-ab23795a6ae5/go.mod h1:qypF+Tf23flzLX5IXuodDb1314BrDrsbwK/OhTh6HBM= +github.com/wh1te909/go-win64api v0.0.0-20230802051600-21b24f62e846 h1:w/2L2xArf30zPrE/8IsqbKrU1FecRtR68Kbw/jj6ep4= +github.com/wh1te909/go-win64api v0.0.0-20230802051600-21b24f62e846/go.mod h1:qypF+Tf23flzLX5IXuodDb1314BrDrsbwK/OhTh6HBM= github.com/wh1te909/trmm-shared v0.0.0-20220227075846-f9f757361139 h1:PfOl03o+Y+svWrfXAAu1QWUDePu1yqTq0pf4rpnN8eA= github.com/wh1te909/trmm-shared v0.0.0-20220227075846-f9f757361139/go.mod h1:ILUz1utl5KgwrxmNHv0RpgMtKeh8gPAABvK2MiXBqv8= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= From 2cff41f719340f6c157ca5f77a0fda75a6c399ce Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Sun, 6 Aug 2023 22:39:36 -0700 Subject: [PATCH 096/113] update ci --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 87b6ac2..e54679e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ jobs: - uses: actions/setup-go@v4 with: - go-version: '1.20.6' + go-version: '1.20.7' - name: Ensure linux agent compiles run: | From 9f3f5c2f9b9c981f23dfc642cc3b8f6b46979f0f Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Sun, 13 Aug 2023 23:54:31 -0700 Subject: [PATCH 097/113] bump version --- build/rmm.exe.manifest | 2 +- build/setup.iss | 2 +- main.go | 2 +- versioninfo.json | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/build/rmm.exe.manifest b/build/rmm.exe.manifest index 1ca074c..2071286 100644 --- a/build/rmm.exe.manifest +++ b/build/rmm.exe.manifest @@ -3,7 +3,7 @@ diff --git a/build/setup.iss b/build/setup.iss index 296f3fd..720e4eb 100644 --- a/build/setup.iss +++ b/build/setup.iss @@ -1,5 +1,5 @@ #define MyAppName "Tactical RMM Agent" -#define MyAppVersion "2.4.9" +#define MyAppVersion "2.4.10" #define MyAppPublisher "AmidaWare LLC" #define MyAppURL "https://github.com/amidaware" #define MyAppExeName "tacticalrmm.exe" diff --git a/main.go b/main.go index d882274..52730fe 100644 --- a/main.go +++ b/main.go @@ -25,7 +25,7 @@ import ( ) var ( - version = "2.4.10-dev" + version = "2.4.10" log = logrus.New() logFile *os.File ) diff --git a/versioninfo.json b/versioninfo.json index 14ec152..2d29460 100644 --- a/versioninfo.json +++ b/versioninfo.json @@ -3,13 +3,13 @@ "FileVersion": { "Major": 2, "Minor": 4, - "Patch": 9, + "Patch": 10, "Build": 0 }, "ProductVersion": { "Major": 2, "Minor": 4, - "Patch": 9, + "Patch": 10, "Build": 0 }, "FileFlagsMask": "3f", @@ -22,14 +22,14 @@ "Comments": "", "CompanyName": "AmidaWare LLC", "FileDescription": "Tactical RMM Agent", - "FileVersion": "v2.4.9.0", + "FileVersion": "v2.4.10.0", "InternalName": "tacticalrmm.exe", "LegalCopyright": "Copyright (c) 2023 AmidaWare LLC", "LegalTrademarks": "", "OriginalFilename": "tacticalrmm.exe", "PrivateBuild": "", "ProductName": "Tactical RMM Agent", - "ProductVersion": "v2.4.9.0", + "ProductVersion": "v2.4.10.0", "SpecialBuild": "" }, "VarFileInfo": { From 9f225761365be961e776043bad9972c55bb67f7e Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Mon, 14 Aug 2023 13:25:42 -0700 Subject: [PATCH 098/113] fix lowercase hostname --- agent/agent.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/agent/agent.go b/agent/agent.go index 4020052..2f94140 100644 --- a/agent/agent.go +++ b/agent/agent.go @@ -104,6 +104,11 @@ func New(logger *logrus.Logger, version string) *Agent { winTempDir := defaultWinTmpDir winRunAsUserTmpDir := defaultWinTmpDir + hostname, err := os.Hostname() + if err != nil { + hostname = info.Hostname + } + var pybin string switch runtime.GOARCH { case "amd64": @@ -201,7 +206,7 @@ func New(logger *logrus.Logger, version string) *Agent { } return &Agent{ - Hostname: info.Hostname, + Hostname: hostname, BaseURL: ac.BaseURL, AgentID: ac.AgentID, ApiURL: ac.APIURL, From 0777195423cd26fe2f39e787f5e94c4689671e0e Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Mon, 14 Aug 2023 13:34:38 -0700 Subject: [PATCH 099/113] bump version --- build/rmm.exe.manifest | 2 +- build/setup.iss | 2 +- main.go | 2 +- versioninfo.json | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/build/rmm.exe.manifest b/build/rmm.exe.manifest index 2071286..a1ed766 100644 --- a/build/rmm.exe.manifest +++ b/build/rmm.exe.manifest @@ -3,7 +3,7 @@ diff --git a/build/setup.iss b/build/setup.iss index 720e4eb..7b18ad4 100644 --- a/build/setup.iss +++ b/build/setup.iss @@ -1,5 +1,5 @@ #define MyAppName "Tactical RMM Agent" -#define MyAppVersion "2.4.10" +#define MyAppVersion "2.4.11" #define MyAppPublisher "AmidaWare LLC" #define MyAppURL "https://github.com/amidaware" #define MyAppExeName "tacticalrmm.exe" diff --git a/main.go b/main.go index 52730fe..56dc178 100644 --- a/main.go +++ b/main.go @@ -25,7 +25,7 @@ import ( ) var ( - version = "2.4.10" + version = "2.4.11" log = logrus.New() logFile *os.File ) diff --git a/versioninfo.json b/versioninfo.json index 2d29460..0d85476 100644 --- a/versioninfo.json +++ b/versioninfo.json @@ -3,13 +3,13 @@ "FileVersion": { "Major": 2, "Minor": 4, - "Patch": 10, + "Patch": 11, "Build": 0 }, "ProductVersion": { "Major": 2, "Minor": 4, - "Patch": 10, + "Patch": 11, "Build": 0 }, "FileFlagsMask": "3f", @@ -22,14 +22,14 @@ "Comments": "", "CompanyName": "AmidaWare LLC", "FileDescription": "Tactical RMM Agent", - "FileVersion": "v2.4.10.0", + "FileVersion": "v2.4.11.0", "InternalName": "tacticalrmm.exe", "LegalCopyright": "Copyright (c) 2023 AmidaWare LLC", "LegalTrademarks": "", "OriginalFilename": "tacticalrmm.exe", "PrivateBuild": "", "ProductName": "Tactical RMM Agent", - "ProductVersion": "v2.4.10.0", + "ProductVersion": "v2.4.11.0", "SpecialBuild": "" }, "VarFileInfo": { From 90d0bbf0203fa51da7ca87cfa3d9e99db3367f4a Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Thu, 24 Aug 2023 12:17:52 -0700 Subject: [PATCH 100/113] add insecure flag to allow self-signed certs to work --- agent/agent.go | 17 +++++++++++++ agent/agent_unix.go | 8 ++++++ agent/agent_windows.go | 9 +++++++ agent/install.go | 55 +++++++++++++++++++++++++--------------- agent/install_unix.go | 6 ++++- agent/install_windows.go | 16 +++++++++++- main.go | 40 ++++++++++++++++------------- shared/types.go | 1 + 8 files changed, 112 insertions(+), 40 deletions(-) diff --git a/agent/agent.go b/agent/agent.go index 2f94140..27ab548 100644 --- a/agent/agent.go +++ b/agent/agent.go @@ -14,6 +14,7 @@ package agent import ( "bytes" "context" + "crypto/tls" "errors" "fmt" "math" @@ -73,6 +74,7 @@ type Agent struct { NatsProxyPort string NatsPingInterval int NatsWSCompression bool + Insecure bool } const ( @@ -125,12 +127,20 @@ func New(logger *logrus.Logger, version string) *Agent { headers["Authorization"] = fmt.Sprintf("Token %s", ac.Token) } + insecure := ac.Insecure == "true" + restyC := resty.New() restyC.SetBaseURL(ac.BaseURL) restyC.SetCloseConnection(true) restyC.SetHeaders(headers) restyC.SetTimeout(15 * time.Second) restyC.SetDebug(logger.IsLevelEnabled(logrus.DebugLevel)) + if insecure { + insecureConf := &tls.Config{ + InsecureSkipVerify: true, + } + restyC.SetTLSClientConfig(insecureConf) + } if len(ac.Proxy) > 0 { restyC.SetProxy(ac.Proxy) @@ -236,6 +246,7 @@ func New(logger *logrus.Logger, version string) *Agent { NatsProxyPort: natsProxyPort, NatsPingInterval: natsPingInterval, NatsWSCompression: natsWsCompression, + Insecure: insecure, } } @@ -477,6 +488,12 @@ func (a *Agent) setupNatsOptions() []nats.Option { a.Logger.Errorln("NATS error:", err) a.Logger.Errorf("%+v\n", sub) })) + if a.Insecure { + insecureConf := &tls.Config{ + InsecureSkipVerify: true, + } + opts = append(opts, nats.Secure(insecureConf)) + } return opts } diff --git a/agent/agent_unix.go b/agent/agent_unix.go index bcd0e02..dc5b01b 100644 --- a/agent/agent_unix.go +++ b/agent/agent_unix.go @@ -16,6 +16,7 @@ package agent import ( "bufio" + "crypto/tls" "errors" "fmt" "os" @@ -160,6 +161,7 @@ func NewAgentConfig() *rmm.AgentConfig { NatsProxyPort: viper.GetString("natsproxyport"), NatsStandardPort: viper.GetString("natsstandardport"), NatsPingInterval: viper.GetInt("natspinginterval"), + Insecure: viper.GetString("insecure"), } return ret } @@ -248,6 +250,12 @@ func (a *Agent) AgentUpdate(url, inno, version string) error { if len(a.Proxy) > 0 { rClient.SetProxy(a.Proxy) } + if a.Insecure { + insecureConf := &tls.Config{ + InsecureSkipVerify: true, + } + rClient.SetTLSClientConfig(insecureConf) + } r, err := rClient.R().SetOutput(f.Name()).Get(url) if err != nil { diff --git a/agent/agent_windows.go b/agent/agent_windows.go index ebdce00..c9f8935 100644 --- a/agent/agent_windows.go +++ b/agent/agent_windows.go @@ -14,6 +14,7 @@ package agent import ( "bytes" "context" + "crypto/tls" "errors" "fmt" "os" @@ -68,6 +69,7 @@ func NewAgentConfig() *rmm.AgentConfig { natsStandardPort, _, _ := k.GetStringValue("NatsStandardPort") natsPingInterval, _, _ := k.GetStringValue("NatsPingInterval") npi, _ := strconv.Atoi(natsPingInterval) + insecure, _, _ := k.GetStringValue("Insecure") return &rmm.AgentConfig{ BaseURL: baseurl, @@ -85,6 +87,7 @@ func NewAgentConfig() *rmm.AgentConfig { NatsProxyPort: natsProxyPort, NatsStandardPort: natsStandardPort, NatsPingInterval: npi, + Insecure: insecure, } } @@ -615,6 +618,12 @@ func (a *Agent) AgentUpdate(url, inno, version string) error { if len(a.Proxy) > 0 { rClient.SetProxy(a.Proxy) } + if a.Insecure { + insecureConf := &tls.Config{ + InsecureSkipVerify: true, + } + rClient.SetTLSClientConfig(insecureConf) + } r, err := rClient.R().SetOutput(updater).Get(url) if err != nil { a.Logger.Errorln(err) diff --git a/agent/install.go b/agent/install.go index 35c354c..59a0cb9 100644 --- a/agent/install.go +++ b/agent/install.go @@ -12,6 +12,7 @@ https://license.tacticalrmm.com package agent import ( + "crypto/tls" "fmt" "io" "net/url" @@ -28,25 +29,27 @@ import ( ) type Installer struct { - Headers map[string]string - RMM string - ClientID int - SiteID int - Description string - AgentType string - Power bool - RDP bool - Ping bool - Token string - LocalMesh string - Cert string - Proxy string - Timeout time.Duration - SaltMaster string - Silent bool - NoMesh bool - MeshDir string - MeshNodeID string + Headers map[string]string + RMM string + ClientID int + SiteID int + Description string + AgentType string + Power bool + RDP bool + Ping bool + Token string + LocalMesh string + Cert string + Proxy string + Timeout time.Duration + SaltMaster string + Silent bool + NoMesh bool + MeshDir string + MeshNodeID string + Insecure bool + NatsStandardPort string } func (a *Agent) Install(i *Installer) { @@ -97,6 +100,14 @@ func (a *Agent) Install(i *Installer) { iClient.SetProxy(i.Proxy) } + insecureConf := &tls.Config{ + InsecureSkipVerify: true, + } + + if i.Insecure { + iClient.SetTLSClientConfig(insecureConf) + } + creds, cerr := iClient.R().Get(fmt.Sprintf("%s/api/v3/installer/", baseURL)) if cerr != nil { a.installerMsg(cerr.Error(), "error", i.Silent) @@ -133,6 +144,10 @@ func (a *Agent) Install(i *Installer) { rClient.SetProxy(i.Proxy) } + if i.Insecure { + rClient.SetTLSClientConfig(insecureConf) + } + var installerMeshSystemEXE string if len(i.MeshDir) > 0 { installerMeshSystemEXE = filepath.Join(i.MeshDir, "MeshAgent.exe") @@ -230,7 +245,7 @@ func (a *Agent) Install(i *Installer) { a.Logger.Debugln("Agent token:", agentToken) a.Logger.Debugln("Agent PK:", agentPK) - createAgentConfig(baseURL, a.AgentID, i.SaltMaster, agentToken, strconv.Itoa(agentPK), i.Cert, i.Proxy, i.MeshDir) + createAgentConfig(baseURL, a.AgentID, i.SaltMaster, agentToken, strconv.Itoa(agentPK), i.Cert, i.Proxy, i.MeshDir, i.NatsStandardPort, i.Insecure) time.Sleep(1 * time.Second) // refresh our agent with new values a = New(a.Logger, a.Version) diff --git a/agent/install_unix.go b/agent/install_unix.go index 1c9ba5d..da0298b 100644 --- a/agent/install_unix.go +++ b/agent/install_unix.go @@ -33,7 +33,7 @@ func (a *Agent) installerMsg(msg, alert string, silent bool) { } } -func createAgentConfig(baseurl, agentid, apiurl, token, agentpk, cert, proxy, meshdir string) { +func createAgentConfig(baseurl, agentid, apiurl, token, agentpk, cert, proxy, meshdir, natsport string, insecure bool) { viper.SetConfigType("json") viper.Set("baseurl", baseurl) viper.Set("agentid", agentid) @@ -43,6 +43,10 @@ func createAgentConfig(baseurl, agentid, apiurl, token, agentpk, cert, proxy, me viper.Set("cert", cert) viper.Set("proxy", proxy) viper.Set("meshdir", meshdir) + viper.Set("natsstandardport", natsport) + if insecure { + viper.Set("insecure", "true") + } viper.SetConfigPermissions(0660) err := viper.SafeWriteConfigAs(etcConfig) if err != nil { diff --git a/agent/install_windows.go b/agent/install_windows.go index 3f8b630..04a24c2 100644 --- a/agent/install_windows.go +++ b/agent/install_windows.go @@ -21,7 +21,7 @@ import ( "golang.org/x/sys/windows/registry" ) -func createAgentConfig(baseurl, agentid, apiurl, token, agentpk, cert, proxy, meshdir string) { +func createAgentConfig(baseurl, agentid, apiurl, token, agentpk, cert, proxy, meshdir, natsport string, insecure bool) { k, _, err := registry.CreateKey(registry.LOCAL_MACHINE, `SOFTWARE\TacticalRMM`, registry.ALL_ACCESS) if err != nil { log.Fatalln("Error creating registry key:", err) @@ -73,6 +73,20 @@ func createAgentConfig(baseurl, agentid, apiurl, token, agentpk, cert, proxy, me log.Fatalln("Error creating MeshDir registry key:", err) } } + + if len(natsport) > 0 { + err = k.SetStringValue("NatsStandardPort", natsport) + if err != nil { + log.Fatalln("Error creating NatsStandardPort registry key:", err) + } + } + + if insecure { + err = k.SetStringValue("Insecure", "true") + if err != nil { + log.Fatalln("Error creating Insecure registry key:", err) + } + } } func (a *Agent) checkExistingAndRemove(silent bool) { diff --git a/main.go b/main.go index 56dc178..cfbc32f 100644 --- a/main.go +++ b/main.go @@ -25,7 +25,7 @@ import ( ) var ( - version = "2.4.11" + version = "2.4.12-dev" log = logrus.New() logFile *os.File ) @@ -53,6 +53,8 @@ func main() { cert := flag.String("cert", "", "Path to domain CA .pem") silent := flag.Bool("silent", false, "Do not popup any message boxes during installation") proxy := flag.String("proxy", "", "Use a http proxy") + insecure := flag.Bool("insecure", false, "Insecure for testing only") + natsport := flag.String("natsport", "", "nats standard port") flag.Parse() if *ver { @@ -141,23 +143,25 @@ func main() { return } a.Install(&agent.Installer{ - RMM: *api, - ClientID: *clientID, - SiteID: *siteID, - Description: *desc, - AgentType: *atype, - Power: *power, - RDP: *rdp, - Ping: *ping, - Token: *token, - LocalMesh: *localMesh, - Cert: *cert, - Proxy: *proxy, - Timeout: *timeout, - Silent: *silent, - NoMesh: *noMesh, - MeshDir: *meshDir, - MeshNodeID: *meshNodeID, + RMM: *api, + ClientID: *clientID, + SiteID: *siteID, + Description: *desc, + AgentType: *atype, + Power: *power, + RDP: *rdp, + Ping: *ping, + Token: *token, + LocalMesh: *localMesh, + Cert: *cert, + Proxy: *proxy, + Timeout: *timeout, + Silent: *silent, + NoMesh: *noMesh, + MeshDir: *meshDir, + MeshNodeID: *meshNodeID, + Insecure: *insecure, + NatsStandardPort: *natsport, }) default: agent.ShowStatus(version) diff --git a/shared/types.go b/shared/types.go index 3fbf3f4..72ed50a 100644 --- a/shared/types.go +++ b/shared/types.go @@ -48,6 +48,7 @@ type AgentConfig struct { NatsProxyPort string NatsStandardPort string NatsPingInterval int + Insecure string } type RunScriptResp struct { From 4f9114875334c2d4e71bddf4e6530203077845a6 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Thu, 24 Aug 2023 12:35:11 -0700 Subject: [PATCH 101/113] fix env vars in runasuser fixes amidaware/tacticalrmm#1614 --- agent/agent_windows.go | 27 ++++++++++++++++++----- agent/syscall_windows.go | 47 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+), 6 deletions(-) diff --git a/agent/agent_windows.go b/agent/agent_windows.go index c9f8935..75b148c 100644 --- a/agent/agent_windows.go +++ b/agent/agent_windows.go @@ -161,22 +161,37 @@ func (a *Agent) RunScript(code string, shell string, args []string, timeout int, defer cancel() var timedOut = false + var token *wintoken.Token + var envBlock *uint16 + usingEnvVars := len(envVars) > 0 cmd := exec.Command(exe, cmdArgs...) if runasuser { - token, err := wintoken.GetInteractiveToken(wintoken.TokenImpersonation) + token, err = wintoken.GetInteractiveToken(wintoken.TokenImpersonation) if err == nil { defer token.Close() cmd.SysProcAttr = &syscall.SysProcAttr{Token: syscall.Token(token.Token()), HideWindow: true} + + if usingEnvVars { + envBlock, err = CreateEnvironmentBlock(syscall.Token(token.Token())) + if err == nil { + defer DestroyEnvironmentBlock(envBlock) + userEnv := EnvironmentBlockToSlice(envBlock) + cmd.Env = userEnv + } else { + cmd.Env = os.Environ() + } + } } + } else if usingEnvVars { + cmd.Env = os.Environ() + } + + if usingEnvVars { + cmd.Env = append(cmd.Env, envVars...) } cmd.Stdout = &outb cmd.Stderr = &errb - if len(envVars) > 0 { - cmd.Env = os.Environ() - cmd.Env = append(cmd.Env, envVars...) - } - if cmdErr := cmd.Start(); cmdErr != nil { a.Logger.Debugln(cmdErr) return "", cmdErr.Error(), 65, cmdErr diff --git a/agent/syscall_windows.go b/agent/syscall_windows.go index 26173ef..e7eccfd 100644 --- a/agent/syscall_windows.go +++ b/agent/syscall_windows.go @@ -24,11 +24,14 @@ var _ unsafe.Pointer var ( modadvapi32 = windows.NewLazySystemDLL("advapi32.dll") modkernel32 = windows.NewLazySystemDLL("kernel32.dll") + userenv = windows.NewLazyDLL("userenv.dll") procFormatMessageW = modkernel32.NewProc("FormatMessageW") procGetOldestEventLogRecord = modadvapi32.NewProc("GetOldestEventLogRecord") procLoadLibraryExW = modkernel32.NewProc("LoadLibraryExW") procReadEventLogW = modadvapi32.NewProc("ReadEventLogW") + procCreateEnvironmentBlock = userenv.NewProc("CreateEnvironmentBlock") + procDestroyEnvironmentBlock = userenv.NewProc("DestroyEnvironmentBlock") ) // https://docs.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-eventlogrecord @@ -114,3 +117,47 @@ func ReadEventLog(eventLog w32.HANDLE, readFlags ReadFlag, recordOffset uint32, } return } + +func CreateEnvironmentBlock(token syscall.Token) (*uint16, error) { + var envBlock *uint16 + + ret, _, err := procCreateEnvironmentBlock.Call( + uintptr(unsafe.Pointer(&envBlock)), + uintptr(token), + 0, + ) + if ret == 0 { + return nil, err + } + + return envBlock, nil +} + +func DestroyEnvironmentBlock(envBlock *uint16) error { + ret, _, err := procDestroyEnvironmentBlock.Call(uintptr(unsafe.Pointer(envBlock))) + if ret == 0 { + return err + } + return nil +} + +func EnvironmentBlockToSlice(envBlock *uint16) []string { + var envs []string + + for { + len := 0 + for *(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(envBlock)) + uintptr(len*2))) != 0 { + len++ + } + + if len == 0 { + break + } + + env := syscall.UTF16ToString((*[1 << 29]uint16)(unsafe.Pointer(envBlock))[:len]) + envs = append(envs, env) + envBlock = (*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(envBlock)) + uintptr((len+1)*2))) + } + + return envs +} From e0f2957e9649e7dc1990419ab6176ea5e732e426 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Tue, 29 Aug 2023 17:03:50 -0700 Subject: [PATCH 102/113] update reqs --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index ac512b9..641c939 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.20 require ( github.com/StackExchange/wmi v1.2.1 - github.com/elastic/go-sysinfo v1.11.0 + github.com/elastic/go-sysinfo v1.11.1 github.com/go-ole/go-ole v1.2.6 github.com/go-ping/ping v1.1.0 github.com/go-resty/resty/v2 v2.7.0 diff --git a/go.sum b/go.sum index 8ac1a15..13f963d 100644 --- a/go.sum +++ b/go.sum @@ -64,6 +64,8 @@ github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKoh github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= github.com/elastic/go-sysinfo v1.11.0 h1:QW+6BF1oxBoAprH3w2yephF7xLkrrSXj7gl2xC2BM4w= github.com/elastic/go-sysinfo v1.11.0/go.mod h1:6KQb31j0QeWBDF88jIdWSxE8cwoOB9tO4Y4osN7Q70E= +github.com/elastic/go-sysinfo v1.11.1 h1:g9mwl05njS4r69TisC+vwHWTSKywZFYYUu3so3T/Lao= +github.com/elastic/go-sysinfo v1.11.1/go.mod h1:6KQb31j0QeWBDF88jIdWSxE8cwoOB9tO4Y4osN7Q70E= github.com/elastic/go-windows v1.0.1 h1:AlYZOldA+UJ0/2nBuqWdo90GFCgG9xuyw9SYzGUtJm0= github.com/elastic/go-windows v1.0.1/go.mod h1:FoVvqWSun28vaDQPbj2Elfc0JahhPB7WQEGa3c814Ss= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= From 08488cee15064fd54f142852737d83b24dac7075 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Fri, 1 Sep 2023 14:33:43 -0700 Subject: [PATCH 103/113] update name --- LICENSE.md | 14 +++++++------- agent/agent.go | 2 +- agent/agent_unix.go | 2 +- agent/agent_windows.go | 2 +- agent/checkin.go | 2 +- agent/checks.go | 2 +- agent/choco_windows.go | 2 +- agent/eventlog_windows.go | 2 +- agent/install.go | 2 +- agent/install_unix.go | 2 +- agent/install_windows.go | 2 +- agent/patches_windows.go | 2 +- agent/process.go | 2 +- agent/rpc.go | 2 +- agent/services_windows.go | 2 +- agent/software_windows_386.go | 2 +- agent/software_windows_amd64.go | 2 +- agent/svc.go | 2 +- agent/syscall_windows.go | 2 +- agent/tasks_windows.go | 2 +- agent/utils.go | 2 +- agent/wmi_windows.go | 2 +- agent/wua_windows.go | 2 +- build/setup.iss | 2 +- main.go | 2 +- shared/types.go | 2 +- versioninfo.json | 4 ++-- 27 files changed, 34 insertions(+), 34 deletions(-) diff --git a/LICENSE.md b/LICENSE.md index 530804b..3549ac5 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,11 +1,11 @@ ### Tactical RMM License Version 1.0 -Text of license:   Copyright © 2022 AmidaWare LLC. All rights reserved.
+Text of license:   Copyright © 2022 AmidaWare Inc. All rights reserved.
          Amending the text of this license is not permitted. -Trade Mark:    "Tactical RMM" is a trade mark of AmidaWare LLC. +Trade Mark:    "Tactical RMM" is a trade mark of AmidaWare Inc. -Licensor:       AmidaWare LLC of 1968 S Coast Hwy PMB 3847 Laguna Beach, CA, USA. +Licensor:       AmidaWare Inc. of 1968 S Coast Hwy PMB 3847 Laguna Beach, CA, USA. Licensed Software:  The software known as Tactical RMM Version v0.12.0 (and all subsequent releases and versions) and the Tactical RMM Agent v2.0.0 (and all subsequent releases and versions). @@ -26,7 +26,7 @@ This license does not allow the functionality of the Licensed Software (whether * the offering of installation and/or configuration services; * the offer for sale, distribution or sale of any service or product (whether or not branded as Tactical RMM). -The prior written approval of AmidaWare LLC must be obtained for all commercial use and/or for-profit service use of the (i) Licensed Software (whether in whole or in part), (ii) a modified version of the Licensed Software and/or (iii) a derivative work. +The prior written approval of AmidaWare Inc. must be obtained for all commercial use and/or for-profit service use of the (i) Licensed Software (whether in whole or in part), (ii) a modified version of the Licensed Software and/or (iii) a derivative work. The terms of this license apply to all copies of the Licensed Software (including modified versions) and derivative works. @@ -38,7 +38,7 @@ If a derivative work is created which is based on or otherwise incorporates all ### 4. Copyright Notice The following copyright notice shall be included in all copies of the Licensed Software: -   Copyright © 2022 AmidaWare LLC. +   Copyright © 2022 AmidaWare Inc.    Licensed under the Tactical RMM License Version 1.0 (the “License”).
   You may only use the Licensed Software in accordance with the License.
@@ -54,13 +54,13 @@ THE FOLLOWING EXCLUSIONS SHALL APPLY TO THE FULLEST EXTENT PERMISSIBLE AT LAW. This license shall terminate with immediate effect if there is a material breach of any of its terms. ### 8. No partnership, agency or joint venture -Nothing in this license agreement is intended to, or shall be deemed to, establish any partnership or joint venture or any relationship of agency between AmidaWare LLC and any other person. +Nothing in this license agreement is intended to, or shall be deemed to, establish any partnership or joint venture or any relationship of agency between AmidaWare Inc. and any other person. ### 9. No endorsement The names of the authors and/or the copyright holders must not be used to promote or endorse any products or services which are in any way derived from the Licensed Software without prior written consent. ### 10. Trademarks -No permission is granted to use the trademark “Tactical RMM” or any other trade name, trademark, service mark or product name of AmidaWare LLC except to the extent necessary to comply with the notice requirements in Section 4 (Copyright Notice). +No permission is granted to use the trademark “Tactical RMM” or any other trade name, trademark, service mark or product name of AmidaWare Inc. except to the extent necessary to comply with the notice requirements in Section 4 (Copyright Notice). ### 11. Entire agreement This license contains the whole agreement relating to its subject matter. diff --git a/agent/agent.go b/agent/agent.go index 27ab548..53b8d83 100644 --- a/agent/agent.go +++ b/agent/agent.go @@ -1,5 +1,5 @@ /* -Copyright 2022 AmidaWare LLC. +Copyright 2022 AmidaWare Inc. Licensed under the Tactical RMM License Version 1.0 (the “License”). You may only use the Licensed Software in accordance with the License. diff --git a/agent/agent_unix.go b/agent/agent_unix.go index dc5b01b..dddb5aa 100644 --- a/agent/agent_unix.go +++ b/agent/agent_unix.go @@ -2,7 +2,7 @@ // +build !windows /* -Copyright 2022 AmidaWare LLC. +Copyright 2022 AmidaWare Inc. Licensed under the Tactical RMM License Version 1.0 (the “License”). You may only use the Licensed Software in accordance with the License. diff --git a/agent/agent_windows.go b/agent/agent_windows.go index 75b148c..4ddc414 100644 --- a/agent/agent_windows.go +++ b/agent/agent_windows.go @@ -1,5 +1,5 @@ /* -Copyright 2022 AmidaWare LLC. +Copyright 2022 AmidaWare Inc. Licensed under the Tactical RMM License Version 1.0 (the “License”). You may only use the Licensed Software in accordance with the License. diff --git a/agent/checkin.go b/agent/checkin.go index 9990198..b9bf977 100644 --- a/agent/checkin.go +++ b/agent/checkin.go @@ -1,5 +1,5 @@ /* -Copyright 2022 AmidaWare LLC. +Copyright 2022 AmidaWare Inc. Licensed under the Tactical RMM License Version 1.0 (the “License”). You may only use the Licensed Software in accordance with the License. diff --git a/agent/checks.go b/agent/checks.go index 00925d7..0f06015 100644 --- a/agent/checks.go +++ b/agent/checks.go @@ -1,5 +1,5 @@ /* -Copyright 2022 AmidaWare LLC. +Copyright 2022 AmidaWare Inc. Licensed under the Tactical RMM License Version 1.0 (the “License”). You may only use the Licensed Software in accordance with the License. diff --git a/agent/choco_windows.go b/agent/choco_windows.go index 5053f09..40e6210 100644 --- a/agent/choco_windows.go +++ b/agent/choco_windows.go @@ -1,5 +1,5 @@ /* -Copyright 2022 AmidaWare LLC. +Copyright 2022 AmidaWare Inc. Licensed under the Tactical RMM License Version 1.0 (the “License”). You may only use the Licensed Software in accordance with the License. diff --git a/agent/eventlog_windows.go b/agent/eventlog_windows.go index c1313ef..6a93e25 100644 --- a/agent/eventlog_windows.go +++ b/agent/eventlog_windows.go @@ -1,5 +1,5 @@ /* -Copyright 2022 AmidaWare LLC. +Copyright 2022 AmidaWare Inc. Licensed under the Tactical RMM License Version 1.0 (the “License”). You may only use the Licensed Software in accordance with the License. diff --git a/agent/install.go b/agent/install.go index 59a0cb9..000de7f 100644 --- a/agent/install.go +++ b/agent/install.go @@ -1,5 +1,5 @@ /* -Copyright 2022 AmidaWare LLC. +Copyright 2022 AmidaWare Inc. Licensed under the Tactical RMM License Version 1.0 (the “License”). You may only use the Licensed Software in accordance with the License. diff --git a/agent/install_unix.go b/agent/install_unix.go index da0298b..caefc30 100644 --- a/agent/install_unix.go +++ b/agent/install_unix.go @@ -2,7 +2,7 @@ // +build !windows /* -Copyright 2022 AmidaWare LLC. +Copyright 2022 AmidaWare Inc. Licensed under the Tactical RMM License Version 1.0 (the “License”). You may only use the Licensed Software in accordance with the License. diff --git a/agent/install_windows.go b/agent/install_windows.go index 04a24c2..6142eee 100644 --- a/agent/install_windows.go +++ b/agent/install_windows.go @@ -1,5 +1,5 @@ /* -Copyright 2022 AmidaWare LLC. +Copyright 2022 AmidaWare Inc. Licensed under the Tactical RMM License Version 1.0 (the “License”). You may only use the Licensed Software in accordance with the License. diff --git a/agent/patches_windows.go b/agent/patches_windows.go index 7d41baf..3074244 100644 --- a/agent/patches_windows.go +++ b/agent/patches_windows.go @@ -1,5 +1,5 @@ /* -Copyright 2022 AmidaWare LLC. +Copyright 2022 AmidaWare Inc. Licensed under the Tactical RMM License Version 1.0 (the “License”). You may only use the Licensed Software in accordance with the License. diff --git a/agent/process.go b/agent/process.go index ae7c392..35e8008 100644 --- a/agent/process.go +++ b/agent/process.go @@ -1,5 +1,5 @@ /* -Copyright 2022 AmidaWare LLC. +Copyright 2022 AmidaWare Inc. Licensed under the Tactical RMM License Version 1.0 (the “License”). You may only use the Licensed Software in accordance with the License. diff --git a/agent/rpc.go b/agent/rpc.go index ed975d9..5ee17d8 100644 --- a/agent/rpc.go +++ b/agent/rpc.go @@ -1,5 +1,5 @@ /* -Copyright 2022 AmidaWare LLC. +Copyright 2022 AmidaWare Inc. Licensed under the Tactical RMM License Version 1.0 (the “License”). You may only use the Licensed Software in accordance with the License. diff --git a/agent/services_windows.go b/agent/services_windows.go index 75624f5..f7e0436 100644 --- a/agent/services_windows.go +++ b/agent/services_windows.go @@ -1,5 +1,5 @@ /* -Copyright 2022 AmidaWare LLC. +Copyright 2022 AmidaWare Inc. Licensed under the Tactical RMM License Version 1.0 (the “License”). You may only use the Licensed Software in accordance with the License. diff --git a/agent/software_windows_386.go b/agent/software_windows_386.go index 1be5cd0..e0b1e79 100644 --- a/agent/software_windows_386.go +++ b/agent/software_windows_386.go @@ -1,5 +1,5 @@ /* -Copyright 2022 AmidaWare LLC. +Copyright 2022 AmidaWare Inc. Licensed under the Tactical RMM License Version 1.0 (the “License”). You may only use the Licensed Software in accordance with the License. diff --git a/agent/software_windows_amd64.go b/agent/software_windows_amd64.go index ce84005..802b1d9 100644 --- a/agent/software_windows_amd64.go +++ b/agent/software_windows_amd64.go @@ -1,5 +1,5 @@ /* -Copyright 2022 AmidaWare LLC. +Copyright 2022 AmidaWare Inc. Licensed under the Tactical RMM License Version 1.0 (the “License”). You may only use the Licensed Software in accordance with the License. diff --git a/agent/svc.go b/agent/svc.go index eacc8c0..5110489 100644 --- a/agent/svc.go +++ b/agent/svc.go @@ -1,5 +1,5 @@ /* -Copyright 2022 AmidaWare LLC. +Copyright 2022 AmidaWare Inc. Licensed under the Tactical RMM License Version 1.0 (the “License”). You may only use the Licensed Software in accordance with the License. diff --git a/agent/syscall_windows.go b/agent/syscall_windows.go index e7eccfd..5759743 100644 --- a/agent/syscall_windows.go +++ b/agent/syscall_windows.go @@ -1,5 +1,5 @@ /* -Copyright 2022 AmidaWare LLC. +Copyright 2022 AmidaWare Inc. Licensed under the Tactical RMM License Version 1.0 (the “License”). You may only use the Licensed Software in accordance with the License. diff --git a/agent/tasks_windows.go b/agent/tasks_windows.go index 086b80e..e4236ac 100644 --- a/agent/tasks_windows.go +++ b/agent/tasks_windows.go @@ -1,5 +1,5 @@ /* -Copyright 2022 AmidaWare LLC. +Copyright 2022 AmidaWare Inc. Licensed under the Tactical RMM License Version 1.0 (the “License”). You may only use the Licensed Software in accordance with the License. diff --git a/agent/utils.go b/agent/utils.go index 623126e..3b2f177 100644 --- a/agent/utils.go +++ b/agent/utils.go @@ -1,5 +1,5 @@ /* -Copyright 2022 AmidaWare LLC. +Copyright 2022 AmidaWare Inc. Licensed under the Tactical RMM License Version 1.0 (the “License”). You may only use the Licensed Software in accordance with the License. diff --git a/agent/wmi_windows.go b/agent/wmi_windows.go index 194ecb0..2fcade5 100644 --- a/agent/wmi_windows.go +++ b/agent/wmi_windows.go @@ -1,5 +1,5 @@ /* -Copyright 2022 AmidaWare LLC. +Copyright 2022 AmidaWare Inc. Licensed under the Tactical RMM License Version 1.0 (the “License”). You may only use the Licensed Software in accordance with the License. diff --git a/agent/wua_windows.go b/agent/wua_windows.go index bc76230..9c0eb68 100644 --- a/agent/wua_windows.go +++ b/agent/wua_windows.go @@ -1,5 +1,5 @@ /* -Copyright 2022 AmidaWare LLC. +Copyright 2022 AmidaWare Inc. Licensed under the Tactical RMM License Version 1.0 (the “License”). You may only use the Licensed Software in accordance with the License. diff --git a/build/setup.iss b/build/setup.iss index 7b18ad4..18c8f84 100644 --- a/build/setup.iss +++ b/build/setup.iss @@ -1,6 +1,6 @@ #define MyAppName "Tactical RMM Agent" #define MyAppVersion "2.4.11" -#define MyAppPublisher "AmidaWare LLC" +#define MyAppPublisher "AmidaWare Inc" #define MyAppURL "https://github.com/amidaware" #define MyAppExeName "tacticalrmm.exe" #define MESHEXE "meshagent.exe" diff --git a/main.go b/main.go index cfbc32f..3cb0a93 100644 --- a/main.go +++ b/main.go @@ -1,5 +1,5 @@ /* -Copyright 2022 AmidaWare LLC. +Copyright 2022 AmidaWare Inc. Licensed under the Tactical RMM License Version 1.0 (the “License”). You may only use the Licensed Software in accordance with the License. diff --git a/shared/types.go b/shared/types.go index 72ed50a..cc0fa82 100644 --- a/shared/types.go +++ b/shared/types.go @@ -1,5 +1,5 @@ /* -Copyright 2022 AmidaWare LLC. +Copyright 2022 AmidaWare Inc. Licensed under the Tactical RMM License Version 1.0 (the “License”). You may only use the Licensed Software in accordance with the License. diff --git a/versioninfo.json b/versioninfo.json index 0d85476..0b75389 100644 --- a/versioninfo.json +++ b/versioninfo.json @@ -20,11 +20,11 @@ }, "StringFileInfo": { "Comments": "", - "CompanyName": "AmidaWare LLC", + "CompanyName": "AmidaWare Inc", "FileDescription": "Tactical RMM Agent", "FileVersion": "v2.4.11.0", "InternalName": "tacticalrmm.exe", - "LegalCopyright": "Copyright (c) 2023 AmidaWare LLC", + "LegalCopyright": "Copyright (c) 2023 AmidaWare Inc", "LegalTrademarks": "", "OriginalFilename": "tacticalrmm.exe", "PrivateBuild": "", From 2e0a42a6a153a2742f45ea3f62017255824d2a25 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Fri, 1 Sep 2023 14:34:48 -0700 Subject: [PATCH 104/113] update year --- LICENSE.md | 4 ++-- agent/agent.go | 2 +- agent/agent_unix.go | 2 +- agent/agent_windows.go | 2 +- agent/checkin.go | 2 +- agent/checks.go | 2 +- agent/choco_windows.go | 2 +- agent/eventlog_windows.go | 2 +- agent/install.go | 2 +- agent/install_unix.go | 2 +- agent/install_windows.go | 2 +- agent/patches_windows.go | 2 +- agent/process.go | 2 +- agent/rpc.go | 2 +- agent/services_windows.go | 2 +- agent/software_windows_386.go | 2 +- agent/software_windows_amd64.go | 2 +- agent/svc.go | 2 +- agent/syscall_windows.go | 2 +- agent/tasks_windows.go | 2 +- agent/utils.go | 2 +- agent/wmi_windows.go | 2 +- agent/wua_windows.go | 2 +- main.go | 2 +- shared/types.go | 2 +- 25 files changed, 26 insertions(+), 26 deletions(-) diff --git a/LICENSE.md b/LICENSE.md index 3549ac5..8783c2a 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,6 +1,6 @@ ### Tactical RMM License Version 1.0 -Text of license:   Copyright © 2022 AmidaWare Inc. All rights reserved.
+Text of license:   Copyright © 2023 AmidaWare Inc. All rights reserved.
          Amending the text of this license is not permitted. Trade Mark:    "Tactical RMM" is a trade mark of AmidaWare Inc. @@ -38,7 +38,7 @@ If a derivative work is created which is based on or otherwise incorporates all ### 4. Copyright Notice The following copyright notice shall be included in all copies of the Licensed Software: -   Copyright © 2022 AmidaWare Inc. +   Copyright © 2023 AmidaWare Inc.    Licensed under the Tactical RMM License Version 1.0 (the “License”).
   You may only use the Licensed Software in accordance with the License.
diff --git a/agent/agent.go b/agent/agent.go index 53b8d83..1cc74cf 100644 --- a/agent/agent.go +++ b/agent/agent.go @@ -1,5 +1,5 @@ /* -Copyright 2022 AmidaWare Inc. +Copyright 2023 AmidaWare Inc. Licensed under the Tactical RMM License Version 1.0 (the “License”). You may only use the Licensed Software in accordance with the License. diff --git a/agent/agent_unix.go b/agent/agent_unix.go index dddb5aa..80d81c1 100644 --- a/agent/agent_unix.go +++ b/agent/agent_unix.go @@ -2,7 +2,7 @@ // +build !windows /* -Copyright 2022 AmidaWare Inc. +Copyright 2023 AmidaWare Inc. Licensed under the Tactical RMM License Version 1.0 (the “License”). You may only use the Licensed Software in accordance with the License. diff --git a/agent/agent_windows.go b/agent/agent_windows.go index 4ddc414..140c403 100644 --- a/agent/agent_windows.go +++ b/agent/agent_windows.go @@ -1,5 +1,5 @@ /* -Copyright 2022 AmidaWare Inc. +Copyright 2023 AmidaWare Inc. Licensed under the Tactical RMM License Version 1.0 (the “License”). You may only use the Licensed Software in accordance with the License. diff --git a/agent/checkin.go b/agent/checkin.go index b9bf977..6c9923a 100644 --- a/agent/checkin.go +++ b/agent/checkin.go @@ -1,5 +1,5 @@ /* -Copyright 2022 AmidaWare Inc. +Copyright 2023 AmidaWare Inc. Licensed under the Tactical RMM License Version 1.0 (the “License”). You may only use the Licensed Software in accordance with the License. diff --git a/agent/checks.go b/agent/checks.go index 0f06015..930e947 100644 --- a/agent/checks.go +++ b/agent/checks.go @@ -1,5 +1,5 @@ /* -Copyright 2022 AmidaWare Inc. +Copyright 2023 AmidaWare Inc. Licensed under the Tactical RMM License Version 1.0 (the “License”). You may only use the Licensed Software in accordance with the License. diff --git a/agent/choco_windows.go b/agent/choco_windows.go index 40e6210..f75b15f 100644 --- a/agent/choco_windows.go +++ b/agent/choco_windows.go @@ -1,5 +1,5 @@ /* -Copyright 2022 AmidaWare Inc. +Copyright 2023 AmidaWare Inc. Licensed under the Tactical RMM License Version 1.0 (the “License”). You may only use the Licensed Software in accordance with the License. diff --git a/agent/eventlog_windows.go b/agent/eventlog_windows.go index 6a93e25..f4c9fec 100644 --- a/agent/eventlog_windows.go +++ b/agent/eventlog_windows.go @@ -1,5 +1,5 @@ /* -Copyright 2022 AmidaWare Inc. +Copyright 2023 AmidaWare Inc. Licensed under the Tactical RMM License Version 1.0 (the “License”). You may only use the Licensed Software in accordance with the License. diff --git a/agent/install.go b/agent/install.go index 000de7f..1d6c75a 100644 --- a/agent/install.go +++ b/agent/install.go @@ -1,5 +1,5 @@ /* -Copyright 2022 AmidaWare Inc. +Copyright 2023 AmidaWare Inc. Licensed under the Tactical RMM License Version 1.0 (the “License”). You may only use the Licensed Software in accordance with the License. diff --git a/agent/install_unix.go b/agent/install_unix.go index caefc30..b1e76b0 100644 --- a/agent/install_unix.go +++ b/agent/install_unix.go @@ -2,7 +2,7 @@ // +build !windows /* -Copyright 2022 AmidaWare Inc. +Copyright 2023 AmidaWare Inc. Licensed under the Tactical RMM License Version 1.0 (the “License”). You may only use the Licensed Software in accordance with the License. diff --git a/agent/install_windows.go b/agent/install_windows.go index 6142eee..aa2c434 100644 --- a/agent/install_windows.go +++ b/agent/install_windows.go @@ -1,5 +1,5 @@ /* -Copyright 2022 AmidaWare Inc. +Copyright 2023 AmidaWare Inc. Licensed under the Tactical RMM License Version 1.0 (the “License”). You may only use the Licensed Software in accordance with the License. diff --git a/agent/patches_windows.go b/agent/patches_windows.go index 3074244..81c71cd 100644 --- a/agent/patches_windows.go +++ b/agent/patches_windows.go @@ -1,5 +1,5 @@ /* -Copyright 2022 AmidaWare Inc. +Copyright 2023 AmidaWare Inc. Licensed under the Tactical RMM License Version 1.0 (the “License”). You may only use the Licensed Software in accordance with the License. diff --git a/agent/process.go b/agent/process.go index 35e8008..b4d5f5a 100644 --- a/agent/process.go +++ b/agent/process.go @@ -1,5 +1,5 @@ /* -Copyright 2022 AmidaWare Inc. +Copyright 2023 AmidaWare Inc. Licensed under the Tactical RMM License Version 1.0 (the “License”). You may only use the Licensed Software in accordance with the License. diff --git a/agent/rpc.go b/agent/rpc.go index 5ee17d8..8ecae5c 100644 --- a/agent/rpc.go +++ b/agent/rpc.go @@ -1,5 +1,5 @@ /* -Copyright 2022 AmidaWare Inc. +Copyright 2023 AmidaWare Inc. Licensed under the Tactical RMM License Version 1.0 (the “License”). You may only use the Licensed Software in accordance with the License. diff --git a/agent/services_windows.go b/agent/services_windows.go index f7e0436..e782021 100644 --- a/agent/services_windows.go +++ b/agent/services_windows.go @@ -1,5 +1,5 @@ /* -Copyright 2022 AmidaWare Inc. +Copyright 2023 AmidaWare Inc. Licensed under the Tactical RMM License Version 1.0 (the “License”). You may only use the Licensed Software in accordance with the License. diff --git a/agent/software_windows_386.go b/agent/software_windows_386.go index e0b1e79..b747268 100644 --- a/agent/software_windows_386.go +++ b/agent/software_windows_386.go @@ -1,5 +1,5 @@ /* -Copyright 2022 AmidaWare Inc. +Copyright 2023 AmidaWare Inc. Licensed under the Tactical RMM License Version 1.0 (the “License”). You may only use the Licensed Software in accordance with the License. diff --git a/agent/software_windows_amd64.go b/agent/software_windows_amd64.go index 802b1d9..bb5dc50 100644 --- a/agent/software_windows_amd64.go +++ b/agent/software_windows_amd64.go @@ -1,5 +1,5 @@ /* -Copyright 2022 AmidaWare Inc. +Copyright 2023 AmidaWare Inc. Licensed under the Tactical RMM License Version 1.0 (the “License”). You may only use the Licensed Software in accordance with the License. diff --git a/agent/svc.go b/agent/svc.go index 5110489..e7f03ea 100644 --- a/agent/svc.go +++ b/agent/svc.go @@ -1,5 +1,5 @@ /* -Copyright 2022 AmidaWare Inc. +Copyright 2023 AmidaWare Inc. Licensed under the Tactical RMM License Version 1.0 (the “License”). You may only use the Licensed Software in accordance with the License. diff --git a/agent/syscall_windows.go b/agent/syscall_windows.go index 5759743..2d8b8c8 100644 --- a/agent/syscall_windows.go +++ b/agent/syscall_windows.go @@ -1,5 +1,5 @@ /* -Copyright 2022 AmidaWare Inc. +Copyright 2023 AmidaWare Inc. Licensed under the Tactical RMM License Version 1.0 (the “License”). You may only use the Licensed Software in accordance with the License. diff --git a/agent/tasks_windows.go b/agent/tasks_windows.go index e4236ac..ab199f4 100644 --- a/agent/tasks_windows.go +++ b/agent/tasks_windows.go @@ -1,5 +1,5 @@ /* -Copyright 2022 AmidaWare Inc. +Copyright 2023 AmidaWare Inc. Licensed under the Tactical RMM License Version 1.0 (the “License”). You may only use the Licensed Software in accordance with the License. diff --git a/agent/utils.go b/agent/utils.go index 3b2f177..6eacaca 100644 --- a/agent/utils.go +++ b/agent/utils.go @@ -1,5 +1,5 @@ /* -Copyright 2022 AmidaWare Inc. +Copyright 2023 AmidaWare Inc. Licensed under the Tactical RMM License Version 1.0 (the “License”). You may only use the Licensed Software in accordance with the License. diff --git a/agent/wmi_windows.go b/agent/wmi_windows.go index 2fcade5..13ca8ef 100644 --- a/agent/wmi_windows.go +++ b/agent/wmi_windows.go @@ -1,5 +1,5 @@ /* -Copyright 2022 AmidaWare Inc. +Copyright 2023 AmidaWare Inc. Licensed under the Tactical RMM License Version 1.0 (the “License”). You may only use the Licensed Software in accordance with the License. diff --git a/agent/wua_windows.go b/agent/wua_windows.go index 9c0eb68..913bcd4 100644 --- a/agent/wua_windows.go +++ b/agent/wua_windows.go @@ -1,5 +1,5 @@ /* -Copyright 2022 AmidaWare Inc. +Copyright 2023 AmidaWare Inc. Licensed under the Tactical RMM License Version 1.0 (the “License”). You may only use the Licensed Software in accordance with the License. diff --git a/main.go b/main.go index 3cb0a93..fe2e842 100644 --- a/main.go +++ b/main.go @@ -1,5 +1,5 @@ /* -Copyright 2022 AmidaWare Inc. +Copyright 2023 AmidaWare Inc. Licensed under the Tactical RMM License Version 1.0 (the “License”). You may only use the Licensed Software in accordance with the License. diff --git a/shared/types.go b/shared/types.go index cc0fa82..d7a6f24 100644 --- a/shared/types.go +++ b/shared/types.go @@ -1,5 +1,5 @@ /* -Copyright 2022 AmidaWare Inc. +Copyright 2023 AmidaWare Inc. Licensed under the Tactical RMM License Version 1.0 (the “License”). You may only use the Licensed Software in accordance with the License. From 753242a9493dcba22f90ad08597bd94aaffbbfd5 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Fri, 1 Sep 2023 14:48:17 -0700 Subject: [PATCH 105/113] bump version --- build/rmm.exe.manifest | 2 +- build/setup.iss | 2 +- main.go | 2 +- versioninfo.json | 12 ++++++------ 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/build/rmm.exe.manifest b/build/rmm.exe.manifest index a1ed766..f6a3836 100644 --- a/build/rmm.exe.manifest +++ b/build/rmm.exe.manifest @@ -3,7 +3,7 @@ diff --git a/build/setup.iss b/build/setup.iss index 18c8f84..bc2ed6d 100644 --- a/build/setup.iss +++ b/build/setup.iss @@ -1,5 +1,5 @@ #define MyAppName "Tactical RMM Agent" -#define MyAppVersion "2.4.11" +#define MyAppVersion "2.5.0" #define MyAppPublisher "AmidaWare Inc" #define MyAppURL "https://github.com/amidaware" #define MyAppExeName "tacticalrmm.exe" diff --git a/main.go b/main.go index fe2e842..cc302ca 100644 --- a/main.go +++ b/main.go @@ -25,7 +25,7 @@ import ( ) var ( - version = "2.4.12-dev" + version = "2.5.0" log = logrus.New() logFile *os.File ) diff --git a/versioninfo.json b/versioninfo.json index 0b75389..b389cf0 100644 --- a/versioninfo.json +++ b/versioninfo.json @@ -2,14 +2,14 @@ "FixedFileInfo": { "FileVersion": { "Major": 2, - "Minor": 4, - "Patch": 11, + "Minor": 5, + "Patch": 0, "Build": 0 }, "ProductVersion": { "Major": 2, - "Minor": 4, - "Patch": 11, + "Minor": 5, + "Patch": 0, "Build": 0 }, "FileFlagsMask": "3f", @@ -22,14 +22,14 @@ "Comments": "", "CompanyName": "AmidaWare Inc", "FileDescription": "Tactical RMM Agent", - "FileVersion": "v2.4.11.0", + "FileVersion": "v2.5.0.0", "InternalName": "tacticalrmm.exe", "LegalCopyright": "Copyright (c) 2023 AmidaWare Inc", "LegalTrademarks": "", "OriginalFilename": "tacticalrmm.exe", "PrivateBuild": "", "ProductName": "Tactical RMM Agent", - "ProductVersion": "v2.4.11.0", + "ProductVersion": "v2.5.0.0", "SpecialBuild": "" }, "VarFileInfo": { From e6fea56198d5fb4196449969e008196be4dd53ec Mon Sep 17 00:00:00 2001 From: sadnub Date: Tue, 21 Nov 2023 23:08:53 -0500 Subject: [PATCH 106/113] change run once task trigger to on registration --- agent/tasks_windows.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/agent/tasks_windows.go b/agent/tasks_windows.go index ab199f4..8fc0b4f 100644 --- a/agent/tasks_windows.go +++ b/agent/tasks_windows.go @@ -180,6 +180,10 @@ func (a *Agent) CreateSchedTask(st SchedTask) (bool, error) { Enabled: st.Enabled, StartBoundary: now, } + } else if st.Trigger == "runonce" { + tasktrigger = taskmaster.TaskTrigger{ + Enabled: st.Enabled, + } } else { tasktrigger = taskmaster.TaskTrigger{ Enabled: st.Enabled, @@ -201,9 +205,9 @@ func (a *Agent) CreateSchedTask(st SchedTask) (bool, error) { switch st.Trigger { case "runonce": - trigger = taskmaster.TimeTrigger{ + trigger = taskmaster.RegistrationTrigger{ TaskTrigger: tasktrigger, - RandomDelay: st.RandomDelay, + Delay: st.RandomDelay, } case "daily": From 021f4febbbb596cecc5b5b7df4b4b26037464880 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Wed, 22 Nov 2023 14:15:50 -0800 Subject: [PATCH 107/113] update ci --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e54679e..8ad7e95 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ jobs: - uses: actions/setup-go@v4 with: - go-version: '1.20.7' + go-version: '1.20.11' - name: Ensure linux agent compiles run: | From 1814d0f19d9d4a688e0813e307e32f6b3b0eb925 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Wed, 22 Nov 2023 14:24:30 -0800 Subject: [PATCH 108/113] update reqs --- go.mod | 44 ++++++++++--------- go.sum | 131 ++++++++++++++++++++++++++++++++++----------------------- 2 files changed, 102 insertions(+), 73 deletions(-) diff --git a/go.mod b/go.mod index 641c939..9cf4082 100644 --- a/go.mod +++ b/go.mod @@ -5,21 +5,20 @@ go 1.20 require ( github.com/StackExchange/wmi v1.2.1 github.com/elastic/go-sysinfo v1.11.1 - github.com/go-ole/go-ole v1.2.6 + github.com/go-ole/go-ole v1.3.0 github.com/go-ping/ping v1.1.0 - github.com/go-resty/resty/v2 v2.7.0 - github.com/gonutz/w32/v2 v2.4.0 + github.com/go-resty/resty/v2 v2.10.0 + github.com/gonutz/w32/v2 v2.11.1 github.com/iamacarpet/go-win64api v0.0.0-20230324134531-ef6dbdd6db97 - github.com/nats-io/nats-server/v2 v2.9.20 // indirect - github.com/nats-io/nats.go v1.28.0 + github.com/nats-io/nats.go v1.31.0 github.com/rickb777/date v1.19.1 - github.com/shirou/gopsutil/v3 v3.23.6 + github.com/shirou/gopsutil/v3 v3.23.10 github.com/sirupsen/logrus v1.9.3 github.com/ugorji/go/codec v1.2.11 github.com/wh1te909/go-win64api v0.0.0-20230802051600-21b24f62e846 github.com/wh1te909/trmm-shared v0.0.0-20220227075846-f9f757361139 - golang.org/x/net v0.10.0 // indirect - golang.org/x/sys v0.9.0 + golang.org/x/net v0.17.0 // indirect + golang.org/x/sys v0.14.0 ) require ( @@ -31,7 +30,7 @@ require ( github.com/fourcorelabs/wintoken v1.0.0 github.com/jaypipes/ghw v0.12.0 github.com/kardianos/service v1.2.2 - github.com/spf13/viper v1.16.0 + github.com/spf13/viper v1.17.0 ) require ( @@ -44,32 +43,37 @@ require ( github.com/hashicorp/hcl v1.0.0 // indirect github.com/jaypipes/pcidb v1.0.0 // indirect github.com/joeshaw/multierror v0.0.0-20140124173710-69b34d4ec901 // indirect - github.com/klauspost/compress v1.16.5 // indirect + github.com/klauspost/compress v1.17.2 // indirect github.com/lufia/plan9stats v0.0.0-20220517141722-cf486979b281 // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect - github.com/nats-io/nkeys v0.4.4 // indirect + github.com/nats-io/nkeys v0.4.6 // indirect github.com/nats-io/nuid v1.0.1 // indirect github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d // indirect - github.com/pelletier/go-toml/v2 v2.0.8 // indirect + github.com/pelletier/go-toml/v2 v2.1.0 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c // indirect github.com/prometheus/procfs v0.8.0 // indirect github.com/rickb777/plural v1.4.1 // indirect + github.com/sagikazarmark/locafero v0.3.0 // indirect + github.com/sagikazarmark/slog-shim v0.1.0 // indirect github.com/scjalliance/comshim v0.0.0-20190308082608-cf06d2532c4e // indirect github.com/shoenig/go-m1cpu v0.1.6 // indirect - github.com/spf13/afero v1.9.5 // indirect + github.com/sourcegraph/conc v0.3.0 // indirect + github.com/spf13/afero v1.10.0 // indirect github.com/spf13/cast v1.5.1 // indirect - github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect - github.com/subosito/gotenv v1.4.2 // indirect - github.com/tklauser/go-sysconf v0.3.11 // indirect - github.com/tklauser/numcpus v0.6.0 // indirect + github.com/subosito/gotenv v1.6.0 // indirect + github.com/tklauser/go-sysconf v0.3.12 // indirect + github.com/tklauser/numcpus v0.6.1 // indirect github.com/yusufpapurcu/wmi v1.2.3 // indirect - golang.org/x/crypto v0.9.0 // indirect - golang.org/x/sync v0.1.0 // indirect - golang.org/x/text v0.9.0 // indirect + go.uber.org/atomic v1.9.0 // indirect + go.uber.org/multierr v1.9.0 // indirect + golang.org/x/crypto v0.15.0 // indirect + golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect + golang.org/x/sync v0.3.0 // indirect + golang.org/x/text v0.14.0 // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/toast.v1 v1.0.0-20180812000517-0a84660828b2 // indirect diff --git a/go.sum b/go.sum index 13f963d..c475d0e 100644 --- a/go.sum +++ b/go.sum @@ -56,14 +56,12 @@ github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnht github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/creachadair/staticfile v0.1.3/go.mod h1:a3qySzCIXEprDGxk6tSxSI+dBBdLzqeBOMhZ+o2d3pM= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8= github.com/docker/docker v23.0.3+incompatible h1:9GhVsShNWz1hO//9BNg/dpMnZW25KydO4wtVxWAIbho= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= -github.com/elastic/go-sysinfo v1.11.0 h1:QW+6BF1oxBoAprH3w2yephF7xLkrrSXj7gl2xC2BM4w= -github.com/elastic/go-sysinfo v1.11.0/go.mod h1:6KQb31j0QeWBDF88jIdWSxE8cwoOB9tO4Y4osN7Q70E= github.com/elastic/go-sysinfo v1.11.1 h1:g9mwl05njS4r69TisC+vwHWTSKywZFYYUu3so3T/Lao= github.com/elastic/go-sysinfo v1.11.1/go.mod h1:6KQb31j0QeWBDF88jIdWSxE8cwoOB9tO4Y4osN7Q70E= github.com/elastic/go-windows v1.0.1 h1:AlYZOldA+UJ0/2nBuqWdo90GFCgG9xuyw9SYzGUtJm0= @@ -90,12 +88,13 @@ github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2 github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-ole/go-ole v1.2.4/go.mod h1:XCwSNxSkXRo4vlyPy93sltvi/qJq0jqQhjqQNIwKuxM= github.com/go-ole/go-ole v1.2.5/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= -github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= +github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE= +github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78= github.com/go-ping/ping v1.1.0 h1:3MCGhVX4fyEUuhsfwPrsEdQw6xspHkv5zHsiSoDFZYw= github.com/go-ping/ping v1.1.0/go.mod h1:xIFjORFzTxqIV/tDVGO4eDy/bLuSyawEeojSm3GfRGk= -github.com/go-resty/resty/v2 v2.7.0 h1:me+K9p3uhSmXtrBZ4k9jcEAfJmuC8IivWHwaLZwPrFY= -github.com/go-resty/resty/v2 v2.7.0/go.mod h1:9PWDzw47qPphMRFfhsyk0NnSgvluHcljSMVIq3w7q0I= +github.com/go-resty/resty/v2 v2.10.0 h1:Qla4W/+TMmv0fOeeRqzEpXPLfTUnR5HZ1+lGs+CkiCo= +github.com/go-resty/resty/v2 v2.10.0/go.mod h1:iiP/OpA0CkcL3IGt1O0+/SIItFUbkkyw5BGXiVdTu+A= github.com/go-test/deep v1.1.0 h1:WOcxcdHcvdgThNXjw0t76K42FXTU7HpNQWHpA2HHNlg= github.com/godbus/dbus v4.1.0+incompatible/go.mod h1:/YcGZj5zSblfDWMMoOzV4fas9FZnQYTkDnsGvmh2Grw= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= @@ -125,9 +124,8 @@ github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvq github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/gonutz/w32/v2 v2.4.0 h1:k+R8/ddsnb9dwVDsTDWvkJGFmYJDI3ZMgcKgdpLuMpw= -github.com/gonutz/w32/v2 v2.4.0/go.mod h1:MgtHx0AScDVNKyB+kjyPder4xIi3XAcHS6LDDU2DmdE= +github.com/gonutz/w32/v2 v2.11.1 h1:plG738ZY7VIkPGf3adZ6lFeAf2evCKrULKyZT5GrPoc= +github.com/gonutz/w32/v2 v2.11.1/go.mod h1:MgtHx0AScDVNKyB+kjyPder4xIi3XAcHS6LDDU2DmdE= github.com/google/aukera v0.0.0-20201117230544-d145c8357fea/go.mod h1:oXqTZORBzdwQ6L32YjJmaPajqIV/hoGEouwpFMf4cJE= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= @@ -149,8 +147,9 @@ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/logger v1.1.0/go.mod h1:w7O8nrRr0xufejBlQMI83MXqRusvREoJdaAxV+CoAB4= github.com/google/logger v1.1.1/go.mod h1:BkeJZ+1FhQ+/d087r4dzojEg1u2ZX+ZqG1jTUrLM+zQ= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= @@ -199,8 +198,8 @@ github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/X github.com/kardianos/service v1.2.2 h1:ZvePhAHfvo0A7Mftk/tEzqEZ7Q4lgnR8sGz4xu1YX60= github.com/kardianos/service v1.2.2/go.mod h1:CIMRFEJVL+0DS1a3Nx06NaMn4Dz63Ng6O7dl0qH0zVM= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.16.5 h1:IFV2oUNUzZaz+XyusxpLzpzS8Pt5rh0Z16For/djlyI= -github.com/klauspost/compress v1.16.5/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/klauspost/compress v1.17.2 h1:RlWWUY/Dr4fL8qk9YG7DTZ7PDgME2V4csBXA8L/ixi4= +github.com/klauspost/compress v1.17.2/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= @@ -213,18 +212,14 @@ github.com/lufia/plan9stats v0.0.0-20220517141722-cf486979b281 h1:aczX6NMOtt6L4Y github.com/lufia/plan9stats v0.0.0-20220517141722-cf486979b281/go.mod h1:lc+czkgO/8F7puNki5jk8QyujbfK1LOT7Wl0ON2hxyk= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= -github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA/g= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/nats-io/jwt/v2 v2.4.1 h1:Y35W1dgbbz2SQUYDPCaclXcuqleVmpbRa7646Jf2EX4= -github.com/nats-io/nats-server/v2 v2.9.20 h1:bt1dW6xsL1hWWwv7Hovm+EJt5L6iplyqlgEFkoEUk0k= -github.com/nats-io/nats-server/v2 v2.9.20/go.mod h1:aTb/xtLCGKhfTFLxP591CMWfkdgBmcUUSkiSOe5A3gw= -github.com/nats-io/nats.go v1.28.0 h1:Th4G6zdsz2d0OqXdfzKLClo6bOfoI/b1kInhRtFIy5c= -github.com/nats-io/nats.go v1.28.0/go.mod h1:XpbWUlOElGwTYbMR7imivs7jJj9GtK7ypv321Wp6pjc= -github.com/nats-io/nkeys v0.4.4 h1:xvBJ8d69TznjcQl9t6//Q5xXuVhyYiSos6RPtvQNTwA= -github.com/nats-io/nkeys v0.4.4/go.mod h1:XUkxdLPTufzlihbamfzQ7mw/VGx6ObUs+0bN5sNvt64= +github.com/nats-io/nats.go v1.31.0 h1:/WFBHEc/dOKBF6qf1TZhrdEfTmOZ5JzdJ+Y3m6Y/p7E= +github.com/nats-io/nats.go v1.31.0/go.mod h1:di3Bm5MLsoB4Bx61CBTsxuarI36WbhAwOm8QrW39+i8= +github.com/nats-io/nkeys v0.4.6 h1:IzVe95ru2CT6ta874rt9saQRkWfe2nFj1NtvYSLqMzY= +github.com/nats-io/nkeys v0.4.6/go.mod h1:4DxZNzenSVd1cYQoAa8948QY3QDjrHfcfVADymtkpts= github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw= github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d h1:VhgPp6v9qf9Agr/56bj7Y/xa04UccTW04VP0Qed4vnQ= @@ -237,14 +232,14 @@ github.com/onsi/gomega v1.10.2/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1y github.com/onsi/gomega v1.19.0 h1:4ieX6qQjPP/BfC3mpsAtIGGlxTWPeA3Inl/7DtXw1tw= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/image-spec v1.0.2 h1:9yCKha/T5XdGtO0q9Q9a6T5NUCsTn/DrBg0D7ufOcFM= -github.com/pelletier/go-toml/v2 v2.0.8 h1:0ctb6s9mE31h0/lhu+J6OPmVeDxJn+kYnJc2jZR9tGQ= -github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNcZljzZR9VXg+4= +github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6/MHO4= +github.com/pelletier/go-toml/v2 v2.1.0/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c h1:NRoLoZvkBTKvR5gQLgA3e0hqjkY9u1wm+iOL45VN/qI= github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= @@ -260,49 +255,49 @@ github.com/rickb777/plural v1.4.1/go.mod h1:kdmXUpmKBJTS0FtG/TFumd//VBWsNTD7zOw7 github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= +github.com/sagikazarmark/locafero v0.3.0 h1:zT7VEGWC2DTflmccN/5T1etyKvxSxpHsjb9cJvm4SvQ= +github.com/sagikazarmark/locafero v0.3.0/go.mod h1:w+v7UsPNFwzF1cHuOajOOzoq4U7v/ig1mpRjqV+Bu1U= +github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE= +github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWRIczQRv+GVI1AkeQ= github.com/scjalliance/comshim v0.0.0-20190308082608-cf06d2532c4e h1:+/AzLkOdIXEPrAQtwAeWOBnPQ0BnYlBW0aCZmSb47u4= github.com/scjalliance/comshim v0.0.0-20190308082608-cf06d2532c4e/go.mod h1:9Tc1SKnfACJb9N7cw2eyuI6xzy845G7uZONBsi5uPEA= -github.com/shirou/gopsutil/v3 v3.23.6 h1:5y46WPI9QBKBbK7EEccUPNXpJpNrvPuTD0O2zHEHT08= -github.com/shirou/gopsutil/v3 v3.23.6/go.mod h1:j7QX50DrXYggrpN30W0Mo+I4/8U2UUIQrnrhqUeWrAU= +github.com/shirou/gopsutil/v3 v3.23.10 h1:/N42opWlYzegYaVkWejXWJpbzKv2JDy3mrgGzKsh9hM= +github.com/shirou/gopsutil/v3 v3.23.10/go.mod h1:JIE26kpucQi+innVlAUnIEOSBhBUkirr5b44yr55+WE= github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= github.com/shoenig/test v0.6.4 h1:kVTaSd7WLz5WZ2IaoM0RSzRsUD+m8wRR+5qvntpn4LU= github.com/shoenig/test v0.6.4/go.mod h1:byHiCGXqrVaflBLAMq/srcZIHynQPQgeyvkvXnjqq0k= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= -github.com/spf13/afero v1.9.5 h1:stMpOSZFs//0Lv29HduCmli3GUfpFoF3Y1Q/aXj/wVM= -github.com/spf13/afero v1.9.5/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= +github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= +github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0= +github.com/spf13/afero v1.10.0 h1:EaGW2JJh15aKOejeuJ+wpFSHnbd7GE6Wvp3TsNhb6LY= +github.com/spf13/afero v1.10.0/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA= github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48= -github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= -github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/viper v1.16.0 h1:rGGH0XDZhdUOryiDWjmIvUSWpbNqisK8Wk0Vyefw8hc= -github.com/spf13/viper v1.16.0/go.mod h1:yg78JgCJcbrQOvV9YLXgkLaZqUidkY9K+Dd1FofRzQg= +github.com/spf13/viper v1.17.0 h1:I5txKw7MJasPL/BrfkbA0Jyo/oELqVmux4pR/UxOMfI= +github.com/spf13/viper v1.17.0/go.mod h1:BmMMMLQXSbcHK6KAOiFLz0l5JHrU89OdIRHvsk0+yVI= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8= -github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= -github.com/tklauser/go-sysconf v0.3.11 h1:89WgdJhk5SNwJfu+GKyYveZ4IaJ7xAkecBo+KdJV0CM= -github.com/tklauser/go-sysconf v0.3.11/go.mod h1:GqXfhXY3kiPa0nAXPDIQIWzJbMCB7AmcWpGR8lSZfqI= -github.com/tklauser/numcpus v0.6.0 h1:kebhY2Qt+3U6RNK7UqpYNA+tJ23IBEGKkB7JQBfDYms= -github.com/tklauser/numcpus v0.6.0/go.mod h1:FEZLMke0lhOUG6w2JadTzp0a+Nl8PF/GFkQ5UVIcaL4= +github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= +github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= +github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU= +github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= +github.com/tklauser/numcpus v0.6.1 h1:ng9scYS7az0Bk4OZLvrNXNSAO2Pxr1XXRAPyjhIx+Fk= +github.com/tklauser/numcpus v0.6.1/go.mod h1:1XfjsgE2zo8GVw7POkMbHENHzVg3GzmoZ9fESEdAacY= github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU= github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= -github.com/wh1te909/go-win64api v0.0.0-20210906074314-ab23795a6ae5 h1:8tp/+fGR+qjDQ00vm0ZorHzskquo76MY9/ChmFFunEA= -github.com/wh1te909/go-win64api v0.0.0-20210906074314-ab23795a6ae5/go.mod h1:qypF+Tf23flzLX5IXuodDb1314BrDrsbwK/OhTh6HBM= github.com/wh1te909/go-win64api v0.0.0-20230802051600-21b24f62e846 h1:w/2L2xArf30zPrE/8IsqbKrU1FecRtR68Kbw/jj6ep4= github.com/wh1te909/go-win64api v0.0.0-20230802051600-21b24f62e846/go.mod h1:qypF+Tf23flzLX5IXuodDb1314BrDrsbwK/OhTh6HBM= github.com/wh1te909/trmm-shared v0.0.0-20220227075846-f9f757361139 h1:PfOl03o+Y+svWrfXAAu1QWUDePu1yqTq0pf4rpnN8eA= @@ -311,6 +306,7 @@ github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/yusufpapurcu/wmi v1.2.3 h1:E1ctvB7uKFMOJw3fdOW32DwGE9I7t++CRUEMKvFoFiw= github.com/yusufpapurcu/wmi v1.2.3/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= @@ -319,15 +315,21 @@ go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= +go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE= +go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/multierr v1.9.0 h1:7fIwc/ZtS0q++VgcfqFDxSBZVv/Xo49/SYnDFupUwlI= +go.uber.org/multierr v1.9.0/go.mod h1:X2jQV1h+kxSjClGpnseKVIxpmcjrj7MNnI0bnlfKTVQ= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.9.0 h1:LF6fAI+IutBocDJ2OT0Q1g8plpYljMZ4+lty+dsqw3g= -golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= +golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= +golang.org/x/crypto v0.15.0 h1:frVn1TEaCEaZcn3Tmd7Y2b5KKPaZ+I32Q2OA3kYp5TA= +golang.org/x/crypto v0.15.0/go.mod h1:4ChreQoLWfG3xLDer1WdlH5NdlQ3+mwnQq1YTKY+72g= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -338,6 +340,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= +golang.org/x/exp v0.0.0-20230905200255-921286631fa9 h1:GoHiUyI/Tp2nVkLI2mCxVkOjsbSXD66ic0XW0js0R9g= +golang.org/x/exp v0.0.0-20230905200255-921286631fa9/go.mod h1:S2oDrQGGwySpoQPVqRShND87VCbxmc6bL1Yd2oYrm6k= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -361,7 +365,9 @@ golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.8.0 h1:LUYupSeNrTNCGzR/hVBk2NHZO4hXcVaW1k4Qx7rjPx8= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -398,10 +404,12 @@ golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211029224645-99673261e6eb/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= +golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= +golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -422,8 +430,10 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= +golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -473,12 +483,22 @@ golang.org/x/sys v0.0.0-20210601080250-7ecdf8ef093b/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211107104306-e0b2ad06fe42/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.9.0 h1:KS/R3tvhPqvJvwcKfnBHJwwthS11LRhmM5D59eEXa0s= -golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q= +golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= +golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -487,12 +507,16 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= +golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= @@ -540,7 +564,9 @@ golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= -golang.org/x/tools v0.6.0 h1:BOw41kyTf3PuCW1pVQf8+Cyg8pMlkYB1oo9iJ6D/lKM= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= +golang.org/x/tools v0.13.0 h1:Iey4qkscZuv0VvIt8E0neZjtPVQFSc870HQ448QgEmQ= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -633,7 +659,6 @@ google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2 google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= -google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= From db17e3e28ec0351597c02c7049255f90c85c9e7a Mon Sep 17 00:00:00 2001 From: sadnub Date: Wed, 22 Nov 2023 23:38:20 -0500 Subject: [PATCH 109/113] add onboarding task type and revert runonce --- agent/tasks_windows.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/agent/tasks_windows.go b/agent/tasks_windows.go index 8fc0b4f..95a5cfc 100644 --- a/agent/tasks_windows.go +++ b/agent/tasks_windows.go @@ -180,7 +180,7 @@ func (a *Agent) CreateSchedTask(st SchedTask) (bool, error) { Enabled: st.Enabled, StartBoundary: now, } - } else if st.Trigger == "runonce" { + } else if st.Trigger == "onboarding" { tasktrigger = taskmaster.TaskTrigger{ Enabled: st.Enabled, } @@ -205,6 +205,12 @@ func (a *Agent) CreateSchedTask(st SchedTask) (bool, error) { switch st.Trigger { case "runonce": + trigger = taskmaster.TimeTrigger{ + TaskTrigger: tasktrigger, + RandomDelay: st.RandomDelay, + } + + case "onboarding": trigger = taskmaster.RegistrationTrigger{ TaskTrigger: tasktrigger, Delay: st.RandomDelay, From 751b50e071174981da329d530505971e18e21dde Mon Sep 17 00:00:00 2001 From: Soarinferret Date: Fri, 24 Nov 2023 18:39:20 -0600 Subject: [PATCH 110/113] Fix bug where you cannot use '/usr/bin/env bash' as the shell for systems where bash is in a different location --- agent/agent.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/agent/agent.go b/agent/agent.go index 1cc74cf..67afef2 100644 --- a/agent/agent.go +++ b/agent/agent.go @@ -306,7 +306,8 @@ func (a *Agent) CmdV2(c *CmdOptions) CmdStatus { } else if c.IsExecutable { envCmd = gocmd.NewCmdOptions(cmdOptions, c.Shell, c.Command) // c.Shell: bin + c.Command: args as one string } else { - envCmd = gocmd.NewCmdOptions(cmdOptions, c.Shell, "-c", c.Command) // /bin/bash -c 'ls -l /var/log/...' + commandArray := append(strings.Fields(c.Shell), "-c", c.Command) + envCmd = gocmd.NewCmdOptions(cmdOptions, commandArray[0], commandArray[1:]...) // /bin/bash -c 'ls -l /var/log/...' } var stdoutBuf bytes.Buffer From 060d222941b11ade8b0471f86a0ee2952f5e465e Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Fri, 1 Dec 2023 11:27:28 -0800 Subject: [PATCH 111/113] use switch --- agent/tasks_windows.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/agent/tasks_windows.go b/agent/tasks_windows.go index 95a5cfc..e475a57 100644 --- a/agent/tasks_windows.go +++ b/agent/tasks_windows.go @@ -175,16 +175,17 @@ func (a *Agent) CreateSchedTask(st SchedTask) (bool, error) { var tasktrigger taskmaster.TaskTrigger var now = time.Now() - if st.Trigger == "manual" { + switch st.Trigger { + case "manual": tasktrigger = taskmaster.TaskTrigger{ Enabled: st.Enabled, StartBoundary: now, } - } else if st.Trigger == "onboarding" { + case "onboarding": tasktrigger = taskmaster.TaskTrigger{ - Enabled: st.Enabled, + Enabled: st.Enabled, } - } else { + default: tasktrigger = taskmaster.TaskTrigger{ Enabled: st.Enabled, StartBoundary: time.Date(st.StartYear, st.StartMonth, st.StartDay, st.StartHour, st.StartMinute, 0, 0, now.Location()), @@ -209,11 +210,10 @@ func (a *Agent) CreateSchedTask(st SchedTask) (bool, error) { TaskTrigger: tasktrigger, RandomDelay: st.RandomDelay, } - case "onboarding": trigger = taskmaster.RegistrationTrigger{ TaskTrigger: tasktrigger, - Delay: st.RandomDelay, + Delay: st.RandomDelay, } case "daily": From f0736faf4bcb20f3f83fb0e65dddbc3e595699ad Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Mon, 4 Dec 2023 12:33:41 -0800 Subject: [PATCH 112/113] bump version --- build/rmm.exe.manifest | 2 +- build/setup.iss | 2 +- main.go | 2 +- versioninfo.json | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/build/rmm.exe.manifest b/build/rmm.exe.manifest index f6a3836..108f3cf 100644 --- a/build/rmm.exe.manifest +++ b/build/rmm.exe.manifest @@ -3,7 +3,7 @@ diff --git a/build/setup.iss b/build/setup.iss index bc2ed6d..ed7620d 100644 --- a/build/setup.iss +++ b/build/setup.iss @@ -1,5 +1,5 @@ #define MyAppName "Tactical RMM Agent" -#define MyAppVersion "2.5.0" +#define MyAppVersion "2.6.0" #define MyAppPublisher "AmidaWare Inc" #define MyAppURL "https://github.com/amidaware" #define MyAppExeName "tacticalrmm.exe" diff --git a/main.go b/main.go index cc302ca..458525f 100644 --- a/main.go +++ b/main.go @@ -25,7 +25,7 @@ import ( ) var ( - version = "2.5.0" + version = "2.6.0" log = logrus.New() logFile *os.File ) diff --git a/versioninfo.json b/versioninfo.json index b389cf0..bae1ef1 100644 --- a/versioninfo.json +++ b/versioninfo.json @@ -2,13 +2,13 @@ "FixedFileInfo": { "FileVersion": { "Major": 2, - "Minor": 5, + "Minor": 6, "Patch": 0, "Build": 0 }, "ProductVersion": { "Major": 2, - "Minor": 5, + "Minor": 6, "Patch": 0, "Build": 0 }, @@ -22,14 +22,14 @@ "Comments": "", "CompanyName": "AmidaWare Inc", "FileDescription": "Tactical RMM Agent", - "FileVersion": "v2.5.0.0", + "FileVersion": "v2.6.0.0", "InternalName": "tacticalrmm.exe", "LegalCopyright": "Copyright (c) 2023 AmidaWare Inc", "LegalTrademarks": "", "OriginalFilename": "tacticalrmm.exe", "PrivateBuild": "", "ProductName": "Tactical RMM Agent", - "ProductVersion": "v2.5.0.0", + "ProductVersion": "v2.6.0.0", "SpecialBuild": "" }, "VarFileInfo": { From 7dc08fdbf3d100cd491fc7776e7d80775ae99f31 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Sat, 23 Dec 2023 16:17:33 -0800 Subject: [PATCH 113/113] bump version --- build/rmm.exe.manifest | 2 +- build/setup.iss | 2 +- main.go | 2 +- versioninfo.json | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/build/rmm.exe.manifest b/build/rmm.exe.manifest index 108f3cf..126fa9d 100644 --- a/build/rmm.exe.manifest +++ b/build/rmm.exe.manifest @@ -3,7 +3,7 @@ diff --git a/build/setup.iss b/build/setup.iss index ed7620d..8c58b27 100644 --- a/build/setup.iss +++ b/build/setup.iss @@ -1,5 +1,5 @@ #define MyAppName "Tactical RMM Agent" -#define MyAppVersion "2.6.0" +#define MyAppVersion "2.6.1" #define MyAppPublisher "AmidaWare Inc" #define MyAppURL "https://github.com/amidaware" #define MyAppExeName "tacticalrmm.exe" diff --git a/main.go b/main.go index 458525f..382fd5c 100644 --- a/main.go +++ b/main.go @@ -25,7 +25,7 @@ import ( ) var ( - version = "2.6.0" + version = "2.6.1" log = logrus.New() logFile *os.File ) diff --git a/versioninfo.json b/versioninfo.json index bae1ef1..08967a6 100644 --- a/versioninfo.json +++ b/versioninfo.json @@ -3,13 +3,13 @@ "FileVersion": { "Major": 2, "Minor": 6, - "Patch": 0, + "Patch": 1, "Build": 0 }, "ProductVersion": { "Major": 2, "Minor": 6, - "Patch": 0, + "Patch": 1, "Build": 0 }, "FileFlagsMask": "3f", @@ -22,14 +22,14 @@ "Comments": "", "CompanyName": "AmidaWare Inc", "FileDescription": "Tactical RMM Agent", - "FileVersion": "v2.6.0.0", + "FileVersion": "v2.6.1.0", "InternalName": "tacticalrmm.exe", "LegalCopyright": "Copyright (c) 2023 AmidaWare Inc", "LegalTrademarks": "", "OriginalFilename": "tacticalrmm.exe", "PrivateBuild": "", "ProductName": "Tactical RMM Agent", - "ProductVersion": "v2.6.0.0", + "ProductVersion": "v2.6.1.0", "SpecialBuild": "" }, "VarFileInfo": {