| skipped 64 lines |
65 | 65 | | return nil |
66 | 66 | | } |
67 | 67 | | |
68 | | - | err = generalCheck() |
69 | | - | if err != nil { |
| 68 | + | if err = generalCheck(); err != nil { |
70 | 69 | | fmt.Printf("‼️ There is might be something wrong with your setup: %v\n", err) |
71 | 70 | | return nil |
72 | 71 | | } |
73 | 72 | | |
74 | | - | err = listFlows() |
75 | | - | if err != nil { |
76 | | - | fmt.Printf("‼️ There is might be something wrong with your setup: %v\n", err) |
| 73 | + | if err = listFlows(); err != nil { |
| 74 | + | fmt.Printf("‼️ There is might be something wrong with your workflow setup: %v\n", err) |
| 75 | + | return nil |
| 76 | + | } |
| 77 | + | |
| 78 | + | if err = listDefaultModules(); err != nil { |
| 79 | + | fmt.Printf("‼️ There is might be something wrong with your workflow setup: %v\n", err) |
77 | 80 | | return nil |
78 | 81 | | } |
79 | 82 | | fmt.Printf(color.GreenString("\n🦾 It’s all good. Happy Hacking 🦾\n")) |
| skipped 118 lines |
198 | 201 | | return fmt.Errorf("[-] Error to list workflows: %s", options.Env.WorkFlowsFolder) |
199 | 202 | | } |
200 | 203 | | fmt.Printf("[+] Health Check Workflows: %s\n", color.GreenString("✔")) |
| 204 | + | if options.PremiumPackage { |
| 205 | + | fmt.Printf("💎 Making use of the premium workflow\n") |
| 206 | + | } |
201 | 207 | | |
202 | 208 | | var content [][]string |
203 | 209 | | for _, flow := range flows { |
| skipped 17 lines |
221 | 227 | | table.AppendBulk(content) // Add Bulk Data |
222 | 228 | | table.Render() |
223 | 229 | | |
224 | | - | h := "\nUsage:\n" |
225 | | - | h += color.HiCyanString(" osmedeus scan -f [flowName] -t [target] \n") |
| 230 | + | h := color.HiCyanString("\nUsage:\n") |
| 231 | + | h += color.HiGreenString(" osmedeus scan -f %v", color.HiMagentaString("[flowName]")) + color.HiGreenString(" -t ") + color.HiMagentaString("[target]") + "\n" |
| 232 | + | fmt.Printf(h) |
| 233 | + | return nil |
| 234 | + | } |
| 235 | + | |
| 236 | + | func listDefaultModules() error { |
| 237 | + | defaultModule := path.Join(options.Env.WorkFlowsFolder, "default-modules") |
| 238 | + | modules := core.DefaultWorkflows(options) |
| 239 | + | |
| 240 | + | if len(modules) == 0 { |
| 241 | + | return fmt.Errorf("[-] Error to list default modules: %s", defaultModule) |
| 242 | + | } |
| 243 | + | |
| 244 | + | var content [][]string |
| 245 | + | for _, flow := range modules { |
| 246 | + | parsedModule, err := core.ParseModules(flow) |
| 247 | + | if err != nil { |
| 248 | + | utils.ErrorF("Error parsing flow: %v", flow) |
| 249 | + | continue |
| 250 | + | } |
| 251 | + | row := []string{ |
| 252 | + | parsedModule.Name, parsedModule.Desc, |
| 253 | + | } |
| 254 | + | content = append(content, row) |
| 255 | + | } |
| 256 | + | fmt.Printf("\nFound %v default modules at: %s \n\n", color.HiGreenString("%v", len(content)), color.HiCyanString(defaultModule)) |
| 257 | + | |
| 258 | + | table := tablewriter.NewWriter(os.Stdout) |
| 259 | + | table.SetAutoFormatHeaders(false) |
| 260 | + | table.SetHeader([]string{"Module Name", "Description"}) |
| 261 | + | table.SetBorders(tablewriter.Border{Left: true, Top: true, Right: true, Bottom: true}) |
| 262 | + | table.SetColWidth(120) |
| 263 | + | table.AppendBulk(content) // Add Bulk Data |
| 264 | + | table.Render() |
| 265 | + | |
| 266 | + | h := color.HiCyanString("\nModule Usage:\n") |
| 267 | + | h += color.HiGreenString(" osmedeus scan -m %v", color.HiMagentaString("[moduleName]")) + color.HiGreenString(" -t ") + color.HiMagentaString("[target]") + "\n\n" |
226 | 268 | | fmt.Printf(h) |
227 | 269 | | return nil |
228 | 270 | | } |
| skipped 1 lines |