mirror of
https://github.com/j3ssie/osmedeus.git
synced 2026-09-27 20:14:54 +02:00
Release v4.6.0
This commit is contained in:
@@ -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.")
|
||||
@@ -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())
|
||||
}
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
+18
-13
@@ -5,6 +5,7 @@ import (
|
||||
"os"
|
||||
"path"
|
||||
"sort"
|
||||
"strings"
|
||||
|
||||
"github.com/fatih/color"
|
||||
"github.com/j3ssie/osmedeus/core"
|
||||
@@ -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")
|
||||
}
|
||||
_, 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, "subfinder"))); err != nil {
|
||||
errorBinary = append(errorBinary, "subfinder")
|
||||
}
|
||||
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("✔"))
|
||||
|
||||
@@ -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")
|
||||
@@ -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")
|
||||
|
||||
@@ -264,7 +264,6 @@ func ConfigHelp(cmd *cobra.Command, _ []string) {
|
||||
fmt.Println(cmd.UsageString())
|
||||
}
|
||||
h := ConfigUsage()
|
||||
|
||||
fmt.Println(h)
|
||||
printDocs(cmd)
|
||||
}
|
||||
|
||||
+5
-1
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user