diff --git a/cmd/health.go b/cmd/health.go index e527558..9fc334c 100644 --- a/cmd/health.go +++ b/cmd/health.go @@ -89,6 +89,7 @@ func runHealth(_ *cobra.Command, args []string) error { } fmt.Printf(color.GreenString("\n🦾 Everything is in order. Happy Hacking 🦾\n")) fmt.Printf("šŸ’” Refer to this page if you're uncertain about which workflow to run: %v\n", color.GreenString("https://docs.osmedeus.org/installation/running-your-first-scan/ ")) + fmt.Printf("ā±ļø The current baseline threads hold is %v\n", color.GreenString("%v", options.Threads)) return nil } diff --git a/core/module.go b/core/module.go index 17afac0..0374f51 100644 --- a/core/module.go +++ b/core/module.go @@ -32,8 +32,7 @@ func (r *Runner) RunModule(module libs.Module) { r.CurrentModule = module.Name timeStart := time.Now() - utils.TSPrintF("The %v module has begun", color.HiGreenString(module.Name)) - utils.TSPrintF("The objective of %v module: %v", color.HiGreenString(module.Name), color.HiCyanString(module.Desc)) + utils.TSPrintF("The %v module has begun with the objective %v", color.HiGreenString(module.Name), color.HiCyanString(module.Desc)) // create report record first because I don't want to wait for them to show up in UI until the module done r.DBNewReports(module) diff --git a/core/step.go b/core/step.go index 04de397..361c225 100644 --- a/core/step.go +++ b/core/step.go @@ -83,18 +83,17 @@ func printReports(module libs.Module) { return } - utils.PrintLine() - utils.TSPrintF("List of %v reports generated by the %v module", color.HiMagentaString("%v", len(reports)), color.HiGreenString(module.Name)) + utils.PrefixF(" ", strings.Repeat("-", 40)) + utils.PrefixF("šŸ“„ ", "List of %v reports generated by the %v module", color.HiMagentaString("%v", len(reports)), color.HiGreenString(module.Name)) for _, report := range reports { if !utils.FileExists(report) && utils.EmptyFile(report, 0) { if !utils.FolderExists(report) && utils.EmptyDir(report) { continue } } - utils.TSPrintF("report file: %v", report) + utils.PrefixF(" ", "|-- %v", color.HiCyanString(report)) } - utils.PrintLine() - + utils.PrefixF(" ", strings.Repeat("-", 40)) } // CheckRequired check if required file exist or not diff --git a/execution/beautify.go b/execution/beautify.go index 7b74092..55cc948 100644 --- a/execution/beautify.go +++ b/execution/beautify.go @@ -11,6 +11,7 @@ import ( func PrintCSV(filename string) { filename = utils.NormalizePath(filename) if !utils.FileExists(filename) { + utils.ErrorF("File %v not found", filename) return } @@ -38,8 +39,9 @@ func PrintCSV(filename string) { table.Append(record) } table.SetRowLine(false) - table.SetBorders(tablewriter.Border{Left: false, Top: true, Right: false, Bottom: true}) + table.SetBorders(tablewriter.Border{Left: true, Top: true, Right: true, Bottom: true}) table.SetColWidth(100) + table.SetHeaderLine(true) table.SetAutoWrapText(true) table.Render() } diff --git a/execution/clean.go b/execution/clean.go index 063f10d..963a800 100644 --- a/execution/clean.go +++ b/execution/clean.go @@ -317,7 +317,7 @@ func CleanJSONDnsx(filename string, dest string) { } if len(results) > 0 { - utils.WriteToFile(dest, strings.Join(results, "\n")) + utils.AppendToContent(dest, strings.Join(results, "\n")) } } @@ -477,13 +477,12 @@ func CleanJSONHttpx(filename string, dest string) { } - data := fmt.Sprintf("%s,%s,%s,%s", URL, hash, title, techs) + data := fmt.Sprintf("%s,%s,%s,%s", URL, title, techs, hash) results = append(results, data) - } if len(results) > 0 { - utils.WriteToFile(dest, strings.Join(results, "\n")) + utils.AppendToContent(dest, strings.Join(results, "\n")) } } @@ -522,6 +521,6 @@ func CleanFFUFJson(filename string, dest string) { } if len(results) > 0 { - utils.WriteToFile(dest, strings.Join(results, "\n")) + utils.AppendToContent(dest, strings.Join(results, "\n")) } } diff --git a/libs/version.go b/libs/version.go index ddd8b7e..83785ce 100644 --- a/libs/version.go +++ b/libs/version.go @@ -4,7 +4,7 @@ import "fmt" const ( // VERSION of this project - VERSION = "v4.6.2" + VERSION = "v4.6.3" // DESC description of the tool DESC = "A Workflow Engine for Offensive Security" // BINARY name of osmedeus diff --git a/provider/building.go b/provider/building.go index 0c6f017..39e0d55 100644 --- a/provider/building.go +++ b/provider/building.go @@ -145,6 +145,9 @@ func (p *Provider) RunBuild() error { // really start to build stuff here utils.TSPrintF("Start packer build for: %s", color.HiCyanString(p.ProviderConfig.BuildFile)) cmd = fmt.Sprintf("%s build %s", packerBinary, p.ProviderConfig.BuildFile) + if p.Opt.Debug { + cmd = fmt.Sprintf("%s build -debug %s", packerBinary, p.ProviderConfig.BuildFile) + } out, _ = utils.RunCommandWithErr(cmd) if !strings.Contains(out, fmt.Sprintf("%v scan -f", libs.BINARY)) { diff --git a/utils/log.go b/utils/log.go index c17363a..42a5a8f 100644 --- a/utils/log.go +++ b/utils/log.go @@ -78,7 +78,15 @@ func PrintLine() { func GoodF(format string, args ...interface{}) { t := time.Now() ts := t.Format("2006-01-02T15:04:05") - prefix := fmt.Sprintf("%v %v", color.HiBlackString("[%v]", ts), color.HiGreenString(" ā–¶ā–¶ ")) + prefix := fmt.Sprintf("%v %v", color.HiBlackString("[%v]", ts), color.HiBlueString(" ā–¶ā–¶ ")) + fmt.Printf(fmt.Sprintf("%v%v\n", prefix, fmt.Sprintf(format, args...))) +} + +// PrefixF print good message +func PrefixF(symbol string, format string, args ...interface{}) { + t := time.Now() + ts := t.Format("2006-01-02T15:04:05") + prefix := fmt.Sprintf("%v %v", color.HiBlackString("[%v]", ts), color.HiGreenString(symbol)) fmt.Printf(fmt.Sprintf("%v%v\n", prefix, fmt.Sprintf(format, args...))) } @@ -100,7 +108,7 @@ func BlockF(name string, data string) { func TSPrintF(format string, args ...interface{}) { t := time.Now() ts := t.Format("2006-01-02T15:04:05") - prefix := fmt.Sprintf("%v %v", color.HiBlackString("[%v]", ts), color.HiGreenString(" ā–¶ ")) + prefix := fmt.Sprintf("%v %v", color.HiBlackString("[%v]", ts), color.HiBlueString(" ā–¶ ")) fmt.Printf(fmt.Sprintf("%v%v\n", prefix, fmt.Sprintf(format, args...))) }