commit
5095f9a07d
|
@ -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
|
||||
|
@ -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",
|
||||
|
|
|
@ -6,6 +6,7 @@ import (
|
|||
"io"
|
||||
"os"
|
||||
"path"
|
||||
"regexp"
|
||||
"strings"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue