Skip to content

Commit

Permalink
Update README, rm tests from pipeline, minor items
Browse files Browse the repository at this point in the history
- The README now has the latest cli arguments listed
- The pipeline no longer runs the single unit test due to a strange
newer issue with go test (see golang/go#33475)
- Removed TODO file, as this information is tracked in github issues
- Merge remote-tracking branch 'upstream/master'
- Ran go mod tidy
- Puppet - the message to show modules on the puppet master was moved so that it will list modules before MOSE introduces a rogue module
  • Loading branch information
l50 committed Jan 2, 2020
2 parents e25eb06 + 9b97ab0 commit f459626
Show file tree
Hide file tree
Showing 15 changed files with 44 additions and 70 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ build:
go build
mkdir -p payloads

destroy:
clean:
packr2 clean

setup-linter: ## Install all the build and lint dependencies
Expand All @@ -33,4 +33,4 @@ lint: ## Run all the linters

test:
go test -count=1 -v -race ./... ; \
echo "Testing Complete."
echo "Testing Complete."
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,36 +34,36 @@ make build
```
Usage of ./mose [options]:
-a string
Architecture that the target CM tool is running on. (default "amd64")
Architecture that the target CM tool is running on (default "amd64")
-c string
Command to run on the targets.
Command to run on the targets
-d Display debug output
-ep int
Port used to exfil data from chef server (default 443 with ssl, 9090 without) (default 443
Port used to exfil data from chef server (default 443 with ssl, 9090 without) (default 443)
-f string
Store binary at <filepath>
Output binary locally at <filepath>
-fu string
File upload option
-l string
Local IP Address.
Local IP Address
-m string
Name for backdoor payload (default "my_cmd")
-ns
Disable serving of payload
-o string
Operating system that the target CM tool is on. (default "linux")
Operating system that the target CM tool is on (default "linux")
-p int
Port used to serve payloads on (default 443 with ssl, 8090 without) (default 443)
-rhost string
Set RHOST for /etc/hosts of docker container (format is hostname:ip)
-r string
Set the remote host for /etc/hosts in the chef workstation container (format is hostname:ip)
-rfp string
Remote file path to upload a script to (used in conjunction with -fu) (default "/root/.definitelynotevil")
-s string
Json file to load for mose (default "settings.json")
JSON file to load for MOSE (default "settings.json")
-ssl
Serve payload over TLS
-t string
Configuration management tool to target. (default "puppet")
Configuration management tool to target (default "puppet")
-tts int
Number of seconds to serve the payload (default 60)
-v Display verbose output
```

### TLS Certificates
Expand Down
7 changes: 0 additions & 7 deletions TODO

This file was deleted.

10 changes: 5 additions & 5 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ steps:
workingDirectory: "$(modulePath)"
# End Chef

- script: |
export GO111MODULE=on
go test -count=1 -v -race ./...
displayName: 'Run unit tests'
workingDirectory: "$(modulePath)"
# - script: |
# export GO111MODULE=on
# go test -count=1 -v -race ./...
# displayName: 'Run unit tests'
# workingDirectory: "$(modulePath)"
4 changes: 2 additions & 2 deletions cmd/mose/chef/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import (
"time"

"github.com/gobuffalo/packr/v2"
"github.com/l50/MOSE/pkg/chefutils"
"github.com/l50/MOSE/pkg/moseutils"
"github.com/master-of-servers/mose/pkg/chefutils"
"github.com/master-of-servers/mose/pkg/moseutils"
utils "github.com/l50/goutils"
)

Expand Down
6 changes: 5 additions & 1 deletion cmd/mose/puppet/export_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
// Copyright 2019 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
// Under the terms of Contract DE-NA0003525 with NTESS,
// the U.S. Government retains certain rights in this software

package main

// Export for testing
var BackupManifest = backupManifest
var BackupManifest = backupManifest
4 changes: 2 additions & 2 deletions cmd/mose/puppet/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import (
"text/template"

"github.com/gobuffalo/packr/v2"
"github.com/l50/MOSE/pkg/moseutils"
utils "github.com/l50/goutils"
"github.com/master-of-servers/mose/pkg/moseutils"
)

type eyamlKeys struct {
Expand Down Expand Up @@ -370,9 +370,9 @@ func main() {

moseutils.Msg("Backdooring the %s manifest to run %s on all associated Puppet agents, please wait...", manifestLoc, cmd)
backdoorManifest(manifestLoc)
createModule(manifestLoc, moduleName, cmd)
modules := getModules(getPuppetCodeLoc(manifestLoc) + "/modules")
moseutils.Info("The following modules were found: %v", modules)
createModule(manifestLoc, moduleName, cmd)
}
agents := getAgents()
moseutils.Info("The following puppet agents were identified: %q", agents)
Expand Down
8 changes: 3 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/l50/MOSE
module github.com/master-of-servers/mose

require (
github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 // indirect
Expand All @@ -25,12 +25,10 @@ require (
github.com/opencontainers/image-spec v1.0.1 // indirect
github.com/pierrec/lz4 v2.0.5+incompatible // indirect
github.com/rogpeppe/go-internal v1.5.1 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 // indirect
golang.org/x/crypto v0.0.0-20191219195013-becbf705a915 // indirect
golang.org/x/sys v0.0.0-20191220220014-0732a990476f // indirect
golang.org/x/crypto v0.0.0-20191227163750-53104e6ec876 // indirect
golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8 // indirect
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 // indirect
golang.org/x/tools v0.0.0-20191223184912-a7b3459f0428 // indirect
google.golang.org/grpc v1.21.1 // indirect
gopkg.in/src-d/go-git.v4 v4.12.0 // indirect
gotest.tools v2.2.0+incompatible // indirect
Expand Down
30 changes: 4 additions & 26 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ github.com/gobuffalo/logger v1.0.3 h1:YaXOTHNPCvkqqA7w05A4v0k2tCdpr+sgFlgINbQ6gq
github.com/gobuffalo/logger v1.0.3/go.mod h1:SoeejUwldiS7ZsyCBphOGURmWdwUFXs0J7TCjEhjKxM=
github.com/gobuffalo/packd v0.3.0 h1:eMwymTkA1uXsqxS0Tpoop3Lc0u3kTfiMBE6nKtQU4g4=
github.com/gobuffalo/packd v0.3.0/go.mod h1:zC7QkmNkYVGKPw4tHpBQ+ml7W/3tIebgeo1b36chA3Q=
github.com/gobuffalo/packr v1.30.1 h1:hu1fuVR3fXEZR7rXNW3h8rqSML8EVAf6KNm0NKO/wKg=
github.com/gobuffalo/packr/v2 v2.7.1 h1:n3CIW5T17T8v4GGK5sWXLVWJhCz7b5aNLSxW6gYim4o=
github.com/gobuffalo/packr/v2 v2.7.1/go.mod h1:qYEvAazPaVxy7Y7KR0W8qYEE+RymX74kETFqjFoFlOc=
github.com/gogo/protobuf v1.2.1 h1:/s5zKNz0uPFCZ5hddgPdo2TK2TVrUNMn0OOX8/aZMTE=
Expand Down Expand Up @@ -125,8 +124,6 @@ github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR
github.com/rogpeppe/go-internal v1.3.2/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
github.com/rogpeppe/go-internal v1.4.0 h1:LUa41nrWTQNGhzdsZ5lTnkwbNjj6rXTdazA1cSdjkOY=
github.com/rogpeppe/go-internal v1.4.0/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
github.com/rogpeppe/go-internal v1.5.0 h1:Usqs0/lDK/NqTkvrmKSwA/3XkZAs7ZAW/eLeQ2MVBTw=
github.com/rogpeppe/go-internal v1.5.0/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
github.com/rogpeppe/go-internal v1.5.1 h1:asQ0uD7BN9RU5Im41SEEZTwCi/zAXdMOLS3npYaos2g=
github.com/rogpeppe/go-internal v1.5.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g=
Expand All @@ -143,8 +140,6 @@ github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tL
github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo=
github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg=
github.com/spf13/pflag v1.0.3/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.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s=
github.com/src-d/gcfg v1.4.0 h1:xXbNR5AlLSA315x2UO+fTSSAXCDf+Ar38/6oyGbDKQ4=
github.com/src-d/gcfg v1.4.0/go.mod h1:p/UMsR43ujA89BJY9duynAwIpvqEujIH/jFlfL7jWoI=
Expand All @@ -171,15 +166,11 @@ golang.org/x/crypto v0.0.0-20190422183909-d864b10871cd h1:sMHc2rZHuzQmrbVoSpt9Hg
golang.org/x/crypto v0.0.0-20190422183909-d864b10871cd/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190621222207-cc06ce4a13d4 h1:ydJNl0ENAG67pFbB+9tfhiL2pYqLhfoaZFw/cjLhY4A=
golang.org/x/crypto v0.0.0-20190621222207-cc06ce4a13d4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20191122220453-ac88ee75c92c h1:/nJuwDLoL/zrqY6gf57vxC+Pi+pZ8bfhpPkicO5H7W4=
golang.org/x/crypto v0.0.0-20191122220453-ac88ee75c92c/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413 h1:ULYEB3JvPRE/IfO+9uO7vKV/xzVTO7XPAwm8xbf4w2g=
golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20191219195013-becbf705a915 h1:aJ0ex187qoXrJHPo8ZasVTASQB7llQP6YeNzgDALPRk=
golang.org/x/crypto v0.0.0-20191219195013-becbf705a915/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20191227163750-53104e6ec876 h1:sKJQZMuxjOAR/Uo2LBfU90onWEf1dF4C+0hPJCc9Mpc=
golang.org/x/crypto v0.0.0-20191227163750-53104e6ec876/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190502183928-7f726cade0ab h1:9RfW3ktsOZxgo9YNbBAjq1FWzc/igwEcUzZz8IXgSbk=
Expand All @@ -205,12 +196,8 @@ golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190515120540-06a5c4944438 h1:khxRGsvPk4n2y8I/mLLjp7e5dMTJmH75wvqS6nMwUtY=
golang.org/x/sys v0.0.0-20190515120540-06a5c4944438/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191206220618-eeba5f6aabab h1:FvshnhkKW+LO3HWHodML8kuVX8rnJTxKm9dFPuI68UM=
golang.org/x/sys v0.0.0-20191206220618-eeba5f6aabab/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191210023423-ac6580df4449 h1:gSbV7h1NRL2G1xTg/owz62CST1oJBmxy4QpMMregXVQ=
golang.org/x/sys v0.0.0-20191210023423-ac6580df4449/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191220220014-0732a990476f h1:72l8qCJ1nGxMGH26QVBVIxKd/D34cfGt0OvrPtpemyY=
golang.org/x/sys v0.0.0-20191220220014-0732a990476f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8 h1:JA8d3MPx/IToSyXZG/RhwYEtfrKO1Fxrqe8KrkiLXKM=
golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 h1:SvFZT6jyqRaOeXpc5h/JSfZenJ2O330aBsf7JfSUXmQ=
Expand All @@ -219,16 +206,7 @@ golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGm
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20191004055002-72853e10c5a3 h1:2AmBLzhAfXj+2HCW09VCkJtHIYgHTIPcTeYqgP7Bwt0=
golang.org/x/tools v0.0.0-20191004055002-72853e10c5a3/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191213221258-04c2e8eff935 h1:kJQZhwFzSwJS2BxboKjdZzWczQOZx8VuH7Y8hhuGUtM=
golang.org/x/tools v0.0.0-20191213221258-04c2e8eff935/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20191216052735-49a3e744a425 h1:VvQyQJN0tSuecqgcIxMWnnfG5kSmgy9KZR9sW3W5QeA=
golang.org/x/tools v0.0.0-20191216052735-49a3e744a425/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20191220234730-f13409bbebaf h1:K7C8vSrr0PeD/cgNkkjpByDFJqzjr2YDmm3VPRjGfJM=
golang.org/x/tools v0.0.0-20191220234730-f13409bbebaf/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20191223184912-a7b3459f0428 h1:PAH//fSZiT6ntS7XE0V0/FeFOLsznbIZc17Ka9SqHQU=
golang.org/x/tools v0.0.0-20191223184912-a7b3459f0428/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
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=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8 h1:Nw54tB0rB7hY/N0NQvRW8DG4Yk3Q6T9cu9RcFQDu1tc=
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
Expand Down
5 changes: 3 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@ import (
"time"

"github.com/gobuffalo/packr/v2"
"github.com/l50/MOSE/pkg/chefutils"
"github.com/l50/MOSE/pkg/moseutils"
"github.com/master-of-servers/mose/pkg/chefutils"
"github.com/master-of-servers/mose/pkg/moseutils"
utils "github.com/l50/goutils"
)

var (
// UserInput holds input that's specified through cli args or the settings.json file
UserInput moseutils.UserInput
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/chefutils/agentutils.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"os"
"strings"

"github.com/l50/MOSE/pkg/moseutils"
"github.com/master-of-servers/mose/pkg/moseutils"
)

// TargetAgents allows a user to select specific chef agents, or return them all as a []string
Expand Down
2 changes: 1 addition & 1 deletion pkg/chefutils/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"github.com/docker/docker/api/types/container"
"github.com/docker/docker/client"
"github.com/gobuffalo/packr/v2"
"github.com/l50/MOSE/pkg/moseutils"
"github.com/master-of-servers/mose/pkg/moseutils"
"github.com/mholt/archiver"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/chefutils/filehandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"strings"
"time"

"github.com/l50/MOSE/pkg/moseutils"
"github.com/master-of-servers/mose/pkg/moseutils"
)

// checkInvalidChars detects invalid (and potentially malicious)
Expand Down
2 changes: 1 addition & 1 deletion templates/chef/params.tmpl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package main

import (
"github.com/l50/MOSE/pkg/agent"
"github.com/master-of-servers/mose/pkg/agent"
)

func CreateAgent() agent.Agent {
Expand Down
2 changes: 1 addition & 1 deletion templates/puppet/params.tmpl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package main

import (
"github.com/l50/MOSE/pkg/agent"
"github.com/master-of-servers/mose/pkg/agent"
)

func CreateAgent() agent.Agent {
Expand Down

0 comments on commit f459626

Please sign in to comment.