Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
ehsandeep committed Sep 22, 2023
2 parents 729d2c6 + 75f8b85 commit f8b65e8
Show file tree
Hide file tree
Showing 9 changed files with 166 additions and 87 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ UPDATE:

OUTPUT:
-o, -output string file to write output to (optional)
-json write output in JSON lines format
-j, -json write output in JSON lines format
-csv write output in csv format

CONFIGURATION:
Expand Down
19 changes: 19 additions & 0 deletions v2/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Go parameters
GOCMD=go
GOBUILD=$(GOCMD) build
GOMOD=$(GOCMD) mod
GOTEST=$(GOCMD) test
GOFLAGS := -v
LDFLAGS := -s -w

ifneq ($(shell go env GOOS),darwin)
LDFLAGS := -extldflags "-static"
endif

all: build
build:
$(GOBUILD) $(GOFLAGS) -ldflags '$(LDFLAGS)' -o "naabu" cmd/naabu/main.go
test:
$(GOTEST) $(GOFLAGS) ./...
tidy:
$(GOMOD) tidy
25 changes: 25 additions & 0 deletions v2/cmd/integration-test/cli.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package main

import (
"github.com/projectdiscovery/naabu/v2/internal/testutils"
)

var cliTestcases = map[string]testutils.TestCase{
"cli with passive flag": &cliWithPassiveFlag{},
}

type cliWithPassiveFlag struct {
}

func (h *cliWithPassiveFlag) Execute() error {
results, err := testutils.RunNaabuAndGetResults("projectdiscovery.io", false, "-ec", "-passive")
if err != nil {
return err
}

if len(results) <= 0 {
return errIncorrectResultsCount(results)
}

return nil
}
9 changes: 5 additions & 4 deletions v2/cmd/integration-test/integration-test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ func main() {

tests := map[string]map[string]testutils.TestCase{
"library": libraryTestcases,
"cli": cliTestcases,
}
for proto, tests := range tests {
if protocol == "" || protocol == proto {
Expand All @@ -47,11 +48,11 @@ func main() {
}
}

// Currently not used
// func errIncorrectResultsCount(results []string) error {
// return fmt.Errorf("incorrect number of results %s", strings.Join(results, "\n\t"))
// }
func errIncorrectResultsCount(results []string) error {
return fmt.Errorf("incorrect number of results %s", strings.Join(results, "\n\t"))
}

// Currently not used
// func errIncorrectResult(expected, got string) error {
// return fmt.Errorf("incorrect result: expected \"%s\" got \"%s\"", expected, got)
// }
46 changes: 24 additions & 22 deletions v2/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,29 @@ require (
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2
github.com/google/gopacket v1.1.19
github.com/logrusorgru/aurora v2.0.3+incompatible
github.com/miekg/dns v1.1.55
github.com/miekg/dns v1.1.56
github.com/pkg/errors v0.9.1
github.com/projectdiscovery/blackrock v0.0.1
github.com/projectdiscovery/cdncheck v1.0.9
github.com/projectdiscovery/clistats v0.0.19
github.com/projectdiscovery/dnsx v1.1.4
github.com/projectdiscovery/fdmax v0.0.4
github.com/projectdiscovery/freeport v0.0.5
github.com/projectdiscovery/goflags v0.1.16
github.com/projectdiscovery/goflags v0.1.20
github.com/projectdiscovery/gologger v1.1.11
github.com/projectdiscovery/ipranger v0.0.8
github.com/projectdiscovery/ipranger v0.0.12
github.com/projectdiscovery/mapcidr v1.1.2
github.com/projectdiscovery/networkpolicy v0.0.6
github.com/projectdiscovery/ratelimit v0.0.9
github.com/projectdiscovery/retryablehttp-go v1.0.22
github.com/projectdiscovery/uncover v1.0.5
github.com/projectdiscovery/utils v0.0.49
github.com/projectdiscovery/retryablehttp-go v1.0.27
github.com/projectdiscovery/uncover v1.0.6
github.com/projectdiscovery/utils v0.0.55
github.com/remeh/sizedwaitgroup v1.0.0
github.com/stretchr/testify v1.8.4
go.uber.org/multierr v1.11.0
golang.org/x/exp v0.0.0-20230420155640-133eef4313cb
golang.org/x/net v0.14.0
golang.org/x/sys v0.11.0
golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63
golang.org/x/net v0.15.0
golang.org/x/sys v0.12.0
)

require (
Expand All @@ -38,25 +38,26 @@ require (
github.com/VividCortex/ewma v1.2.0 // indirect
github.com/akrylysov/pogreb v0.10.1 // indirect
github.com/alecthomas/chroma v0.10.0 // indirect
github.com/andybalholm/brotli v1.0.4 // indirect
github.com/andybalholm/brotli v1.0.5 // indirect
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
github.com/aymerick/douceur v0.2.0 // indirect
github.com/charmbracelet/glamour v0.6.0 // indirect
github.com/cheggaaa/pb/v3 v3.1.4 // indirect
github.com/cloudflare/circl v1.3.3 // indirect
github.com/cnf/structhash v0.0.0-20201127153200-e1b16c1ebc08 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dimchansky/utfbom v1.1.1 // indirect
github.com/dlclark/regexp2 v1.8.1 // indirect
github.com/dsnet/compress v0.0.1 // indirect
github.com/fatih/color v1.15.0 // indirect
github.com/gaukas/godicttls v0.0.3 // indirect
github.com/gaukas/godicttls v0.0.4 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/go-github/v30 v30.1.0 // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/gorilla/css v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/compress v1.15.15 // indirect
github.com/klauspost/compress v1.16.7 // indirect
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
Expand All @@ -73,36 +74,37 @@ require (
github.com/pierrec/lz4 v2.6.1+incompatible // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/projectdiscovery/asnmap v1.0.4 // indirect
github.com/projectdiscovery/fastdialer v0.0.35 // indirect
github.com/projectdiscovery/hmap v0.0.14 // indirect
github.com/projectdiscovery/retryabledns v1.0.31 // indirect
github.com/refraction-networking/utls v1.3.2 // indirect
github.com/projectdiscovery/fastdialer v0.0.37 // indirect
github.com/projectdiscovery/hmap v0.0.18 // indirect
github.com/projectdiscovery/retryabledns v1.0.35 // indirect
github.com/quic-go/quic-go v0.38.1 // indirect
github.com/refraction-networking/utls v1.5.2 // indirect
github.com/rivo/uniseg v0.4.4 // indirect
github.com/saintfish/chardet v0.0.0-20230101081208-5e3ef4b5456d // indirect
github.com/syndtr/goleveldb v1.0.0 // indirect
github.com/tidwall/btree v1.6.0 // indirect
github.com/tidwall/buntdb v1.3.0 // indirect
github.com/tidwall/gjson v1.14.4 // indirect
github.com/tidwall/gjson v1.16.0 // indirect
github.com/tidwall/grect v0.1.4 // indirect
github.com/tidwall/match v1.1.1 // indirect
github.com/tidwall/pretty v1.2.1 // indirect
github.com/tidwall/rtred v0.1.2 // indirect
github.com/tidwall/tinyqueue v0.1.1 // indirect
github.com/ulikunitz/xz v0.5.11 // indirect
github.com/ulule/deepcopier v0.0.0-20200430083143-45decc6639b6 // indirect
github.com/weppos/publicsuffix-go v0.30.1-0.20230422193905-8fecedd899db // indirect
github.com/weppos/publicsuffix-go v0.30.2-0.20230730094716-a20f9abcc222 // indirect
github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 // indirect
github.com/yl2chen/cidranger v1.0.2 // indirect
github.com/yuin/goldmark v1.5.4 // indirect
github.com/yuin/goldmark-emoji v1.0.1 // indirect
github.com/zmap/rc2 v0.0.0-20190804163417-abaa70531248 // indirect
github.com/zmap/zcrypto v0.0.0-20230422215203-9a665e1e9968 // indirect
github.com/zmap/zcrypto v0.0.0-20230814193918-dbe676986518 // indirect
go.etcd.io/bbolt v1.3.7 // indirect
golang.org/x/crypto v0.12.0 // indirect
golang.org/x/crypto v0.13.0 // indirect
golang.org/x/mod v0.12.0 // indirect
golang.org/x/oauth2 v0.11.0 // indirect
golang.org/x/text v0.12.0 // indirect
golang.org/x/tools v0.11.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/tools v0.13.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/djherbis/times.v1 v1.3.0 // indirect
Expand Down
Loading

0 comments on commit f8b65e8

Please sign in to comment.