Skip to content

Commit 13b05be

Browse files
committed
Release v4.6.0
1 parent 89a7d36 commit 13b05be

File tree

5 files changed

+39
-15
lines changed

5 files changed

+39
-15
lines changed

cmd/config.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,13 @@ func runConfig(cmd *cobra.Command, args []string) error {
4343
}
4444

4545
switch action {
46+
case "check":
47+
err := generalCheck()
48+
if err != nil {
49+
fmt.Printf("‼️ There is might be something wrong with your setup: %v\n", color.HiRedString("%v", err))
50+
return nil
51+
}
52+
break
4653
case "init":
4754
if utils.FolderExists(fmt.Sprintf("%vcore", options.Env.RootFolder)) {
4855
utils.GoodF("Look like you got properly setup.")
@@ -93,6 +100,9 @@ func runConfig(cmd *cobra.Command, args []string) error {
93100
break
94101
default:
95102
utils.ErrorF("Unknown action: %v", color.HiRedString(action))
103+
if options.FullHelp {
104+
fmt.Println(cmd.UsageString())
105+
}
96106
fmt.Println(ConfigUsage())
97107
}
98108

cmd/exec.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ func init() {
1919
execCmd.Flags().String("script", "", "Scripts to run (Multiple -s flags are accepted)")
2020
execCmd.Flags().StringP("scriptFile", "S", "", "File contain list of scripts")
2121
RootCmd.AddCommand(execCmd)
22+
execCmd.PreRun = func(cmd *cobra.Command, args []string) {
23+
if options.FullHelp {
24+
cmd.Help()
25+
os.Exit(0)
26+
}
27+
}
2228
}
2329

2430
func runExec(cmd *cobra.Command, _ []string) error {

cmd/health.go

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"os"
66
"path"
77
"sort"
8+
"strings"
89

910
"github.com/fatih/color"
1011
"github.com/j3ssie/osmedeus/core"
@@ -155,22 +156,26 @@ func generalCheck() error {
155156

156157
// check core programs
157158
var err error
158-
// if _, err = utils.RunCommandWithErr("jaeles -h"); err != nil {
159-
// color.Red("[-] Core program setup incorrectly")
160-
// return fmt.Errorf("error checking core programs: %v", "jaeles")
161-
// }
159+
var errorBinary []string
162160
if _, err = utils.RunCommandWithErr("timeout --help"); err != nil {
163-
color.Red("[-] Core program setup incorrectly")
164-
return fmt.Errorf("error checking core programs: %v", "timeout")
161+
errorBinary = append(errorBinary, "timeout")
165162
}
166163
if _, err = utils.RunCommandWithErr("amass -h"); err != nil {
167-
color.Red("[-] Core program setup incorrectly")
168-
return fmt.Errorf("error checking core programs: %v", "amass")
164+
errorBinary = append(errorBinary, "amass")
165+
}
166+
if _, err = utils.RunCommandWithErr(fmt.Sprintf("%s -h", path.Join(options.Env.BinariesFolder, "subfinder"))); err != nil {
167+
errorBinary = append(errorBinary, "subfinder")
169168
}
170-
_, err = utils.RunCommandWithErr(fmt.Sprintf("%s -h", path.Join(options.Env.BinariesFolder, "httprobe")))
171-
if err != nil {
169+
if _, err = utils.RunCommandWithErr(fmt.Sprintf("%s -h", path.Join(options.Env.BinariesFolder, "httprobe"))); err != nil {
170+
errorBinary = append(errorBinary, "httprobe")
171+
}
172+
if _, err = utils.RunCommandWithErr(fmt.Sprintf("%s -h", path.Join(options.Env.BinariesFolder, "nuclei"))); err != nil {
173+
errorBinary = append(errorBinary, "nuclei")
174+
}
175+
176+
if len(errorBinary) > 0 {
172177
color.Red("[-] Core program setup incorrectly")
173-
return fmt.Errorf("error checking core programs: %v", fmt.Sprintf("%s -h", path.Join(options.Env.BinariesFolder, "httprobe")))
178+
return fmt.Errorf("error checking core programs: %v", color.HiCyanString(strings.Join(errorBinary, ", ")))
174179
}
175180
fmt.Printf("[+] Health Check Core Programs: %s\n", color.GreenString("✔"))
176181

@@ -237,7 +242,7 @@ func listFlows() error {
237242
table.SetHeader([]string{"Flow Name", "Description"})
238243
table.SetBorders(tablewriter.Border{Left: true, Top: true, Right: true, Bottom: true})
239244
table.SetColWidth(120)
240-
table.AppendBulk(content) // Add Bulk Data
245+
table.AppendBulk(content)
241246
table.Render()
242247

243248
h := color.HiCyanString("\nUsage:\n")
@@ -273,7 +278,7 @@ func listDefaultModules() error {
273278
table.SetHeader([]string{"Module Name", "Description"})
274279
table.SetBorders(tablewriter.Border{Left: true, Top: true, Right: true, Bottom: true})
275280
table.SetColWidth(120)
276-
table.AppendBulk(content) // Add Bulk Data
281+
table.AppendBulk(content)
277282
table.Render()
278283

279284
h := color.HiCyanString("\nModule Usage:\n")

cmd/usage.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,6 @@ func ConfigHelp(cmd *cobra.Command, _ []string) {
264264
fmt.Println(cmd.UsageString())
265265
}
266266
h := ConfigUsage()
267-
268267
fmt.Println(h)
269268
printDocs(cmd)
270269
}

core/token.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,11 @@ func SetupOSEnv(options *libs.Options) {
113113
continue
114114
}
115115

116-
utils.DebugF("Setting environment variable: %v -- %v", name, value)
116+
redactedValue := "*****"
117+
if len(value) > 5 {
118+
redactedValue = value[:2] + "***" + value[len(value)-2:]
119+
}
120+
utils.DebugF("Setting environment variable: %v -- %v", name, redactedValue)
117121

118122
err := os.Setenv(name, value)
119123
if err != nil {

0 commit comments

Comments
 (0)