Skip to content

Commit

Permalink
updated mythic-cli's regex matching for getting/setting env variables
Browse files Browse the repository at this point in the history
  • Loading branch information
its-a-feature committed Jan 29, 2024
1 parent 3a8ed47 commit c855cb2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions Mythic_CLI/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## 0.2.7 - 2024-01-29

### Changed

- Updated the config get/set regex matching to search for matching settings as all upper case or all lower case

## 0.2.6 - 2024-01-29

### Changed
Expand Down
4 changes: 2 additions & 2 deletions Mythic_CLI/src/cmd/config/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ func GetConfigStrings(args []string) map[string]string {
log.Fatalf("[!] bad regex: %v", err)
}
for _, setting := range allSettings {
if searchRegex.MatchString(setting) {
if searchRegex.MatchString(strings.ToUpper(setting)) || searchRegex.MatchString(strings.ToLower(setting)) {
val := mythicEnv.GetString(setting)
if val == "" {
log.Fatalf("Config variable `%s` not found", setting)
Expand All @@ -333,7 +333,7 @@ func SetConfigStrings(key string, value string) {
}
found := false
for _, setting := range allSettings {
if searchRegex.MatchString(setting) {
if searchRegex.MatchString(strings.ToUpper(setting)) || searchRegex.MatchString(strings.ToLower(setting)) {
mythicEnv.Set(setting, value)
found = true
}
Expand Down
2 changes: 1 addition & 1 deletion Mythic_CLI/src/cmd/config/vars.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ package config

var (
// Version Mythic CLI version
Version = "v0.2.6"
Version = "v0.2.7"
)

0 comments on commit c855cb2

Please sign in to comment.