mirror of
https://github.com/projectdiscovery/httpx.git
synced 2024-09-11 17:46:08 +03:00
bumping asnmap + mapcidr
This commit is contained in:
parent
f47e77a95a
commit
576863f843
6
go.mod
6
go.mod
@ -21,7 +21,7 @@ require (
|
||||
github.com/projectdiscovery/gologger v1.1.7
|
||||
github.com/projectdiscovery/hmap v0.0.7
|
||||
github.com/projectdiscovery/iputil v0.0.2 // indirect
|
||||
github.com/projectdiscovery/mapcidr v1.0.3
|
||||
github.com/projectdiscovery/mapcidr v1.1.0
|
||||
github.com/projectdiscovery/rawhttp v0.1.9-0.20230208140210-81c468e769ed
|
||||
github.com/projectdiscovery/retryablehttp-go v1.0.11-0.20230208144003-54f3176b2916
|
||||
github.com/projectdiscovery/stringsutil v0.0.2 // indirect
|
||||
@ -43,7 +43,7 @@ require (
|
||||
github.com/hdm/jarm-go v0.0.7
|
||||
github.com/mfonda/simhash v0.0.0-20151007195837-79f94a1100d6
|
||||
github.com/mitchellh/mapstructure v1.5.0
|
||||
github.com/projectdiscovery/asnmap v0.0.1
|
||||
github.com/projectdiscovery/asnmap v1.0.0
|
||||
github.com/projectdiscovery/dsl v0.0.3
|
||||
github.com/projectdiscovery/fastdialer v0.0.23
|
||||
github.com/projectdiscovery/ratelimit v0.0.6
|
||||
@ -87,7 +87,7 @@ require (
|
||||
github.com/nxadm/tail v1.4.8 // indirect
|
||||
github.com/pierrec/lz4 v2.6.0+incompatible // indirect
|
||||
github.com/pmezard/go-difflib v1.0.0 // indirect
|
||||
github.com/projectdiscovery/blackrock v0.0.0-20220628111055-35616c71b2dc // indirect
|
||||
github.com/projectdiscovery/blackrock v0.0.0-20221025011524-9e4efe804fb4 // indirect
|
||||
github.com/projectdiscovery/freeport v0.0.4 // indirect
|
||||
github.com/projectdiscovery/networkpolicy v0.0.3 // indirect
|
||||
github.com/projectdiscovery/reflectutil v0.0.0-20210804085554-4d90952bf92f // indirect
|
||||
|
13
go.sum
13
go.sum
@ -257,10 +257,10 @@ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
|
||||
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/projectdiscovery/asnmap v0.0.1 h1:n4YCz1ljUaDA3dOUCkjI/bUOtiS7ge1KJ39qpURCd/o=
|
||||
github.com/projectdiscovery/asnmap v0.0.1/go.mod h1:CjCVDhQPVtmlE247L6YFeIVX9c4m8pOX8V8BmB0JkX8=
|
||||
github.com/projectdiscovery/blackrock v0.0.0-20220628111055-35616c71b2dc h1:jqZK68yPOnNNRmwuXqytl+T9EbwneEUCvMDRjLe0J04=
|
||||
github.com/projectdiscovery/blackrock v0.0.0-20220628111055-35616c71b2dc/go.mod h1:5tNGQP9kOfW+X5+40pZP8aqPYLHs45nJkFaSHLxdeH8=
|
||||
github.com/projectdiscovery/asnmap v1.0.0 h1:SrUb+bDqpFecmbHSKhwFppPtNk4trWJs3MhNhwpY/p8=
|
||||
github.com/projectdiscovery/asnmap v1.0.0/go.mod h1:hnRnit0vGBYj0rT937CbeuLwZ2+SN8yKTToIIdjWKhs=
|
||||
github.com/projectdiscovery/blackrock v0.0.0-20221025011524-9e4efe804fb4 h1:EsrQ/zkotVodSJLOch3pV/UYt1vQcwyIs5HX0sm1ljE=
|
||||
github.com/projectdiscovery/blackrock v0.0.0-20221025011524-9e4efe804fb4/go.mod h1:5tNGQP9kOfW+X5+40pZP8aqPYLHs45nJkFaSHLxdeH8=
|
||||
github.com/projectdiscovery/cdncheck v0.0.4-0.20220413175814-b47bc2d578b1 h1:QtTPPx0uu42AsQJiXT86/wqdHS7/iVcgz1VM38tjv20=
|
||||
github.com/projectdiscovery/cdncheck v0.0.4-0.20220413175814-b47bc2d578b1/go.mod h1:EevMeCG1ogBoUJYaa0Mv9R1VUboDm/DiynId7DboKy0=
|
||||
github.com/projectdiscovery/clistats v0.0.12 h1:KLYJxpiwEFidduU4PbcwEcCQ2L7c5wrf7DI5IN5fZ+8=
|
||||
@ -283,8 +283,8 @@ github.com/projectdiscovery/hmap v0.0.7 h1:pGNR+XLEOEDM3He3P0PXzszA0vCxNocXHLGeu
|
||||
github.com/projectdiscovery/hmap v0.0.7/go.mod h1:xXSxFWk/zyiBrreQqgLTEnGYhufafVcCSXESBnqKOBU=
|
||||
github.com/projectdiscovery/iputil v0.0.2 h1:f6IGnZF4RImJLysPSPG3D84jyTH34q3lihCFeP+eZzI=
|
||||
github.com/projectdiscovery/iputil v0.0.2/go.mod h1:J3Pcz1q51pi4/JL871mQztg0KOzyWDPxnPLOYJm2pVQ=
|
||||
github.com/projectdiscovery/mapcidr v1.0.3 h1:SGtOOEz0AxthVO7ZonMvhrJ/AQkHIXCVgyZqJdY0cAY=
|
||||
github.com/projectdiscovery/mapcidr v1.0.3/go.mod h1:/0lEXlu/q0t5u34vIVF6odHR+JCdD3CIHNsMXo7nwrU=
|
||||
github.com/projectdiscovery/mapcidr v1.1.0 h1:Yeb+CGVsRYvHmZ9YSHb9iy4tzY9YuOm3oTFX/xzGhVU=
|
||||
github.com/projectdiscovery/mapcidr v1.1.0/go.mod h1:hck0bWXka5ZkUaBG+TWt99bzLy+4hAg9oANhEmm3GNs=
|
||||
github.com/projectdiscovery/networkpolicy v0.0.3 h1:OZFPkMVY6SJxc1ncuRXB2VlT6xlzJl5eWDkvpWn/GMM=
|
||||
github.com/projectdiscovery/networkpolicy v0.0.3/go.mod h1:DIXwKs3sQyfCoWHKRLQiRrEorSQW4Zrh4ftu7oDVK6w=
|
||||
github.com/projectdiscovery/ratelimit v0.0.6 h1:SAD2ArdT9F8NmbkAIZpl7DjNnbiXdUQLnMZt5dbVmZ0=
|
||||
@ -297,7 +297,6 @@ github.com/projectdiscovery/retryabledns v1.0.20 h1:grRyh4EzuyqsaK07iNkJKgrGLu/q
|
||||
github.com/projectdiscovery/retryabledns v1.0.20/go.mod h1:97Et22Kw2iPyvz/Vn41/i3dSbhLMHfeWP/S7EaLgmtg=
|
||||
github.com/projectdiscovery/retryablehttp-go v1.0.11-0.20230208144003-54f3176b2916 h1:9kdsj7NGuj/5treBvUbK+vQ8wQrUhi0LcIGvpfKrBpw=
|
||||
github.com/projectdiscovery/retryablehttp-go v1.0.11-0.20230208144003-54f3176b2916/go.mod h1:RWViUDjf9NTx1j8HatkstoSj2hE4xrrDIum1SsQqZfE=
|
||||
github.com/projectdiscovery/sliceutil v0.0.1 h1:YoCqCMcdwz+gqNfW5hFY8UvNHoA6SfyBSNkVahatleg=
|
||||
github.com/projectdiscovery/stringsutil v0.0.2 h1:uzmw3IVLJSMW1kEg8eCStG/cGbYYZAja8BH3LqqJXMA=
|
||||
github.com/projectdiscovery/stringsutil v0.0.2/go.mod h1:EJ3w6bC5fBYjVou6ryzodQq37D5c6qbAYQpGmAy+DC0=
|
||||
github.com/projectdiscovery/tlsx v1.0.4 h1:aVkoxl1Vq6Uh7Ietpv2X5TfXPRRBj3VGCtoelhj9BE0=
|
||||
|
@ -77,14 +77,12 @@ type Runner struct {
|
||||
stats clistats.StatisticsClient
|
||||
ratelimiter ratelimit.Limiter
|
||||
HostErrorsCache gcache.Cache
|
||||
asnClinet asn.ASNClient
|
||||
}
|
||||
|
||||
// New creates a new client for running enumeration process.
|
||||
func New(options *Options) (*Runner, error) {
|
||||
runner := &Runner{
|
||||
options: options,
|
||||
asnClinet: asn.New(),
|
||||
options: options,
|
||||
}
|
||||
var err error
|
||||
if options.TechDetect {
|
||||
@ -490,7 +488,6 @@ func (r *Runner) countTargetFromRawTarget(rawTarget string) (numTargets int) {
|
||||
expandedTarget = int(ipsCount)
|
||||
}
|
||||
case asn.IsASN(rawTarget):
|
||||
asn := asn.New()
|
||||
cidrs, _ := asn.GetCIDRsForASNNum(rawTarget)
|
||||
for _, cidr := range cidrs {
|
||||
expandedTarget += int(mapcidr.AddressCountIpnet(cidr))
|
||||
@ -985,7 +982,7 @@ func (r *Runner) targets(hp *httpx.HTTPX, target string) chan httpx.Target {
|
||||
}
|
||||
results <- httpx.Target{Host: target}
|
||||
case asn.IsASN(target):
|
||||
cidrIps, err := r.asnClinet.GetIPAddressesAsStream(target)
|
||||
cidrIps, err := asn.GetIPAddressesAsStream(target)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
@ -1370,11 +1367,12 @@ retry:
|
||||
|
||||
var asnResponse *AsnResponse
|
||||
if r.options.Asn {
|
||||
results := asnmap.NewClient().GetData(asnmap.IP(ip))
|
||||
results, _ := asnmap.DefaultClient.GetData(ip)
|
||||
if len(results) > 0 {
|
||||
var cidrs []string
|
||||
for _, cidr := range asnmap.GetCIDR(results) {
|
||||
cidrs = append(cidrs, cidr.String())
|
||||
ipnets, _ := asnmap.GetCIDR(results)
|
||||
for _, ipnet := range ipnets {
|
||||
cidrs = append(cidrs, ipnet.String())
|
||||
}
|
||||
asnResponse = &AsnResponse{
|
||||
AsNumber: fmt.Sprintf("AS%v", results[0].ASN),
|
||||
|
Loading…
Reference in New Issue
Block a user