Merge branch 'j3ssie:main' into main

This commit is contained in:
n00b-bot
2023-12-04 18:18:05 +07:00
committed by GitHub
8 changed files with 27 additions and 16 deletions
+1
View File
@@ -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
}
+1 -2
View File
@@ -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)
+4 -5
View File
@@ -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
+3 -1
View File
@@ -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()
}
+4 -5
View File
@@ -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"))
}
}
+1 -1
View File
@@ -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
+3
View File
@@ -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)) {
+10 -2
View File
@@ -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...)))
}