Skip to content

Commit

Permalink
2.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
zan8in committed Apr 5, 2023
1 parent 0a09c84 commit 6987238
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions cmd/afrog/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ func readConfig() {
flagSet.BoolVarP(&options.NoFinger, "nofinger", "nf", false, "disable fingerprint"),
flagSet.IntVar(&options.Retries, "retries", 1, "number of times to retry a failed request"),
flagSet.IntVar(&options.Timeout, "timeout", 10, "time to wait in seconds before timeout"),
flagSet.IntVar(&options.MaxHostNum, "mhe", 3, "max errors for a host before skipping from scan"),
)

flagSet.CreateGroup("update", "Update",
Expand Down
2 changes: 1 addition & 1 deletion pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ type Ceye struct {
}

const afrogConfigFilename = "afrog-config.yaml"
const Version = "2.2.1"
const Version = "2.2.2"

// Create and initialize afrog-config.yaml configuration info
func New() (*Config, error) {
Expand Down
3 changes: 3 additions & 0 deletions pkg/config/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ type Options struct {
// number of times to retry a failed request (default 1)
Retries int

//
MaxHostNum int

// time to wait in seconds before timeout (default 10)
Timeout int

Expand Down
5 changes: 1 addition & 4 deletions pkg/core/checker.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,14 +166,11 @@ func (c *Checker) Check(ctx context.Context, target string, pocItem *poc.Poc) (e
return err
}

var MaxCheckNum = 1

func (c *Checker) checkURL(target string) (string, error) {
var err error

// if target check num more than MaxCheckNum
if c.Options.Targets.Num(target) > MaxCheckNum {
fmt.Printf("%s is blacklisted\n", target)
if c.Options.Targets.Num(target) > c.Options.MaxHostNum {
return "", fmt.Errorf("%s is blacklisted", target)
}

Expand Down

0 comments on commit 6987238

Please sign in to comment.