这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion v2/pkg/runner/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ type Options struct {
Proxy string // HTTP proxy
RateLimit int // Maximum number of HTTP requests to send per second
// YAMLConfig contains the unmarshalled yaml config file
Providers *Providers
Providers *Providers
ExcludeIps bool
}

// ParseOptions parses the command line flags provided by a user
Expand Down Expand Up @@ -116,6 +117,7 @@ func ParseOptions() *Options {
flagSet.StringVarP(&options.ResolverList, "rlist", "rL", "", "file containing list of resolvers to use"),
flagSet.BoolVarP(&options.RemoveWildcard, "active", "nW", false, "display active subdomains only"),
flagSet.StringVar(&options.Proxy, "proxy", "", "http proxy to use with subfinder"),
flagSet.BoolVarP(&options.ExcludeIps, "exclude-ip", "ei", false, "Exclude ips from the list of domains"),
)

createGroup(flagSet, "debug", "Debug",
Expand Down
5 changes: 4 additions & 1 deletion v2/pkg/runner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"io"
"os"
"path"
"regexp"
"strings"

"github.com/pkg/errors"
Expand Down Expand Up @@ -71,9 +72,11 @@ func (r *Runner) RunEnumeration(ctx context.Context) error {
// We keep enumerating subdomains for a given domain until we reach an error
func (r *Runner) EnumerateMultipleDomains(ctx context.Context, reader io.Reader, outputs []io.Writer) error {
scanner := bufio.NewScanner(reader)
ip, _ := regexp.Compile(`^([0-9\.]+$)`)
for scanner.Scan() {
domain, err := sanitize(scanner.Text())
if errors.Is(err, ErrEmptyInput) {
isIp := ip.MatchString(domain)
if errors.Is(err, ErrEmptyInput) || (r.options.ExcludeIps && isIp) {
continue
}

Expand Down