-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4575 from projectdiscovery/feat-fastdialer-exclude
pass exclude list to layer 4 fast dialer
- Loading branch information
Showing
4 changed files
with
48 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package expand | ||
|
||
import ( | ||
"github.com/projectdiscovery/mapcidr" | ||
"github.com/projectdiscovery/mapcidr/asn" | ||
) | ||
|
||
// Expands CIDR to IPs | ||
func CIDR(value string) []string { | ||
var ips []string | ||
ipsCh, _ := mapcidr.IPAddressesAsStream(value) | ||
for ip := range ipsCh { | ||
ips = append(ips, ip) | ||
} | ||
return ips | ||
} | ||
|
||
// Expand ASN to IPs | ||
func ASN(value string) []string { | ||
var ips []string | ||
cidrs, _ := asn.GetCIDRsForASNNum(value) | ||
for _, cidr := range cidrs { | ||
ips = append(ips, CIDR(cidr.String())...) | ||
} | ||
return ips | ||
} |