Skip to content

Commit

Permalink
Release v4.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
j3ssie committed Sep 8, 2023
1 parent 89a7d36 commit 13b05be
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 15 deletions.
10 changes: 10 additions & 0 deletions cmd/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ func runConfig(cmd *cobra.Command, args []string) error {
}

switch action {
case "check":
err := generalCheck()
if err != nil {
fmt.Printf("‼️ There is might be something wrong with your setup: %v\n", color.HiRedString("%v", err))
return nil
}
break
case "init":
if utils.FolderExists(fmt.Sprintf("%vcore", options.Env.RootFolder)) {
utils.GoodF("Look like you got properly setup.")
Expand Down Expand Up @@ -93,6 +100,9 @@ func runConfig(cmd *cobra.Command, args []string) error {
break
default:
utils.ErrorF("Unknown action: %v", color.HiRedString(action))
if options.FullHelp {
fmt.Println(cmd.UsageString())
}
fmt.Println(ConfigUsage())
}

Expand Down
6 changes: 6 additions & 0 deletions cmd/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ func init() {
execCmd.Flags().String("script", "", "Scripts to run (Multiple -s flags are accepted)")
execCmd.Flags().StringP("scriptFile", "S", "", "File contain list of scripts")
RootCmd.AddCommand(execCmd)
execCmd.PreRun = func(cmd *cobra.Command, args []string) {
if options.FullHelp {
cmd.Help()
os.Exit(0)
}
}
}

func runExec(cmd *cobra.Command, _ []string) error {
Expand Down
31 changes: 18 additions & 13 deletions cmd/health.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"os"
"path"
"sort"
"strings"

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

// check core programs
var err error
// if _, err = utils.RunCommandWithErr("jaeles -h"); err != nil {
// color.Red("[-] Core program setup incorrectly")
// return fmt.Errorf("error checking core programs: %v", "jaeles")
// }
var errorBinary []string
if _, err = utils.RunCommandWithErr("timeout --help"); err != nil {
color.Red("[-] Core program setup incorrectly")
return fmt.Errorf("error checking core programs: %v", "timeout")
errorBinary = append(errorBinary, "timeout")
}
if _, err = utils.RunCommandWithErr("amass -h"); err != nil {
color.Red("[-] Core program setup incorrectly")
return fmt.Errorf("error checking core programs: %v", "amass")
errorBinary = append(errorBinary, "amass")
}
if _, err = utils.RunCommandWithErr(fmt.Sprintf("%s -h", path.Join(options.Env.BinariesFolder, "subfinder"))); err != nil {
errorBinary = append(errorBinary, "subfinder")
}
_, err = utils.RunCommandWithErr(fmt.Sprintf("%s -h", path.Join(options.Env.BinariesFolder, "httprobe")))
if err != nil {
if _, err = utils.RunCommandWithErr(fmt.Sprintf("%s -h", path.Join(options.Env.BinariesFolder, "httprobe"))); err != nil {
errorBinary = append(errorBinary, "httprobe")
}
if _, err = utils.RunCommandWithErr(fmt.Sprintf("%s -h", path.Join(options.Env.BinariesFolder, "nuclei"))); err != nil {
errorBinary = append(errorBinary, "nuclei")
}

if len(errorBinary) > 0 {
color.Red("[-] Core program setup incorrectly")
return fmt.Errorf("error checking core programs: %v", fmt.Sprintf("%s -h", path.Join(options.Env.BinariesFolder, "httprobe")))
return fmt.Errorf("error checking core programs: %v", color.HiCyanString(strings.Join(errorBinary, ", ")))
}
fmt.Printf("[+] Health Check Core Programs: %s\n", color.GreenString("✔"))

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

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

h := color.HiCyanString("\nModule Usage:\n")
Expand Down
1 change: 0 additions & 1 deletion cmd/usage.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,6 @@ func ConfigHelp(cmd *cobra.Command, _ []string) {
fmt.Println(cmd.UsageString())
}
h := ConfigUsage()

fmt.Println(h)
printDocs(cmd)
}
Expand Down
6 changes: 5 additions & 1 deletion core/token.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,11 @@ func SetupOSEnv(options *libs.Options) {
continue
}

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

err := os.Setenv(name, value)
if err != nil {
Expand Down

0 comments on commit 13b05be

Please sign in to comment.