| skipped 37 lines |
38 | 38 | | &cli.BoolFlag{Name: "silent", Destination: &options.Silent, Value: false, Usage: "no progress, only results"}, |
39 | 39 | | &cli.BoolFlag{Name: "nofinger", Aliases: []string{"nf"}, Destination: &options.NoFinger, Value: false, Usage: "disable fingerprint"}, |
40 | 40 | | &cli.BoolFlag{Name: "notips", Aliases: []string{"nt"}, Destination: &options.NoTips, Value: false, Usage: "disable show tips"}, |
| 41 | + | &cli.BoolFlag{Name: "updatepocs", Aliases: []string{"up"}, Destination: &options.UpdatePocs, Value: false, Usage: "update afrog-pocs"}, |
41 | 42 | | } |
42 | 43 | | |
43 | 44 | | app.Action = func(c *cli.Context) error { |
44 | 45 | | upgrade := upgrade.New() |
| 46 | + | upgrade.IsUpdatePocs = options.UpdatePocs |
45 | 47 | | upgrade.UpgradeAfrogPocs() |
46 | 48 | | |
47 | 49 | | runner.ShowBanner2(upgrade.LastestAfrogVersion) |
48 | 50 | | |
49 | | - | fmt.Println("PATH:") |
50 | | - | fmt.Println(" " + options.Config.GetConfigPath()) |
51 | | - | fmt.Println(" " + poc.GetPocPath() + " v" + upgrade.LastestVersion) |
| 51 | + | printPathLog(upgrade) |
52 | 52 | | |
53 | 53 | | if len(options.Output) == 0 { |
54 | 54 | | options.Output = utils.GetNowDateTimeReportName() + ".html" |
| skipped 60 lines |
115 | 115 | | } |
116 | 116 | | } |
117 | 117 | | |
| 118 | + | func printPathLog(upgrade *upgrade.Upgrade) { |
| 119 | + | fmt.Println("PATH:") |
| 120 | + | fmt.Println(" " + options.Config.GetConfigPath()) |
| 121 | + | if options.UpdatePocs { |
| 122 | + | fmt.Println(" " + poc.GetPocPath() + " v" + upgrade.LastestVersion) |
| 123 | + | } else { |
| 124 | + | if utils.Compare(upgrade.LastestVersion, ">", upgrade.CurrVersion) { |
| 125 | + | fmt.Println(" " + poc.GetPocPath() + " v" + upgrade.CurrVersion + " (" + log.LogColor.Vulner(upgrade.LastestVersion) + ")") |
| 126 | + | } else { |
| 127 | + | fmt.Println(" " + poc.GetPocPath() + " v" + upgrade.CurrVersion) |
| 128 | + | } |
| 129 | + | } |
| 130 | + | } |
| 131 | + | |