Skip to content

Commit 6f83f87

Browse files
Fixes in templating
1 parent fc1287e commit 6f83f87

File tree

7 files changed

+23
-13
lines changed

7 files changed

+23
-13
lines changed

config.yml

+3
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ vulnboxes:
1818
farm:
1919
addr: 127.0.0.1:5137
2020

21+
proxy:
22+
addr: 127.0.0.1:8888
23+
2124
mongol:
2225
addr: 127.0.0.1:5138
2326

internal/common/config.go

+5
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ type Neo struct {
2323
Version string `json:"version" mapstructure:"version"`
2424
}
2525

26+
type Proxy struct {
27+
Addr string `json:"addr" mapstructure:"addr"`
28+
}
29+
2630
type Service struct {
2731
Name string `json:"name" mapstructure:"name"`
2832
Proto string `json:"proto" mapstructure:"proto"`
@@ -54,6 +58,7 @@ type Config struct {
5458
Vulnboxes []Vulnbox `json:"vulnboxes" mapstructure:"vulnboxes"`
5559
Farm Farm `json:"farm" mapstructure:"farm"`
5660
Neo Neo `json:"neo" mapstructure:"neo"`
61+
Proxy Proxy `json:"proxy" mapstructure:"proxy"`
5762
ResourcesPath string `json:"resources_path" mapstructure:"resources_path"`
5863
KeyFile string `json:"key_file" mapstructure:"key_file"`
5964
}

internal/web/routes.go

+5-3
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,11 @@ func (s *Server) addSSHKey() gin.HandlerFunc {
8989

9090
func (s *Server) replaceVariables(data []byte) []byte {
9191
replacements := map[string]string{
92-
"VERSION": s.cfg.Neo.Version,
93-
"HOST": s.cfg.Neo.Addr,
94-
"AUTH_KEY": s.cfg.Auth.Password,
92+
"NEO_VERSION": s.cfg.Neo.Version,
93+
"NEO_ADDR": s.cfg.Neo.Addr,
94+
"FARM_ADDR": s.cfg.Farm.Addr,
95+
"PROXY_ADDR": s.cfg.Proxy.Addr,
96+
"PASSWORD": s.cfg.Auth.Password,
9597
}
9698
for k, v := range replacements {
9799
data = bytes.ReplaceAll(data, []byte(fmt.Sprintf("$$%s$$", k)), []byte(v))

resources/neo.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)"
44
COMMAND="$*"
55

66
# shellcheck disable=SC2016
7-
VERSION='v$$VERSION$$'
7+
VERSION='v$$NEO_VERSION$$'
88

99
cat >"${DIR}/client_config.yml" <<-EOT
10-
host: "$$HOST$$"
10+
host: "$$NEO_ADDR$$"
1111
exploit_dir: "data"
12-
grpc_auth_key: "$$AUTH_KEY$$"
12+
grpc_auth_key: "$$PASSWORD$$"
1313
EOT
1414

1515
IMAGE="ghcr.io/pomo-mondreganto/neo_env:${VERSION}"

resources/neo_light.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)"
44
COMMAND="$*"
55

66
# shellcheck disable=SC2016
7-
VERSION='v$$VERSION$$'
7+
VERSION='v$$NEO_VERSION$$'
88

99
cat >"${DIR}/client_config.yml" <<-EOT
10-
host: "$$HOST$$"
10+
host: "$$NEO_ADDR$$"
1111
exploit_dir: "data"
12-
grpc_auth_key: "$$AUTH_KEY$$"
12+
grpc_auth_key: "$$PASSWORD$$"
1313
EOT
1414

1515
IMAGE="ghcr.io/pomo-mondreganto/neo_env_light:${VERSION}"

resources/neo_sage.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)"
44
COMMAND="$*"
55

66
# shellcheck disable=SC2016
7-
VERSION='v$$VERSION$$'
7+
VERSION='v$$NEO_VERSION$$'
88

99
cat >"${DIR}/client_config.yml" <<-EOT
10-
host: "$$HOST$$"
10+
host: "$$NEO_ADDR$$"
1111
exploit_dir: "data"
12-
grpc_auth_key: "$$AUTH_KEY$$"
12+
grpc_auth_key: "$$PASSWORD$$"
1313
EOT
1414

1515
IMAGE="ghcr.io/pomo-mondreganto/neo_env_sage:${VERSION}"

resources/start_sploit.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def parse_args():
7878

7979
parser.add_argument('sploit',
8080
help="Sploit executable (should take a victim's host as the first argument)")
81-
parser.add_argument('--server-url', metavar='URL', default='$$SERVER_URL$$',
81+
parser.add_argument('--server-url', metavar='URL', default='$$FARM_ADDR$$',
8282
help='Server URL')
8383
parser.add_argument('--server-pass', metavar='PASS', default='$$PASSWORD$$',
8484
help='Server password')

0 commit comments

Comments
 (0)