You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
59 lines
1.3 KiB
Go
59 lines
1.3 KiB
Go
//go:build !dyngoogips
|
|
|
|
package fuckgoogle
|
|
|
|
import (
|
|
"context"
|
|
)
|
|
|
|
var (
|
|
// source: _spf.google.com
|
|
googRanges = []string{
|
|
"108.177.8.0/21",
|
|
"108.177.96.0/19",
|
|
"130.211.0.0/22",
|
|
"172.217.0.0/19",
|
|
"172.217.128.0/19",
|
|
"172.217.160.0/20",
|
|
"172.217.192.0/19",
|
|
"172.217.32.0/20",
|
|
"172.253.112.0/20",
|
|
"172.253.56.0/21",
|
|
"173.194.0.0/16",
|
|
"2001:4860:4000::/36",
|
|
"209.85.128.0/17",
|
|
"216.239.32.0/19",
|
|
"216.58.192.0/19",
|
|
"2404:6800:4000::/36",
|
|
"2607:f8b0:4000::/36",
|
|
"2800:3f0:4000::/36",
|
|
"2a00:1450:4000::/36",
|
|
"2c0f:fb50:4000::/36",
|
|
"35.190.247.0/24",
|
|
"35.191.0.0/16",
|
|
"64.233.160.0/19",
|
|
"66.102.0.0/20",
|
|
"66.249.80.0/20",
|
|
"72.14.192.0/18",
|
|
"74.125.0.0/16",
|
|
}
|
|
// these are advertised on _netblocks{>3}.google.com, idk
|
|
googRangesExtra = []string{
|
|
"136.112.0.0/12",
|
|
"172.217.224.0/19",
|
|
"208.81.188.0/22",
|
|
"74.114.24.0/21",
|
|
}
|
|
)
|
|
|
|
// FetchGoogleIPRanges gets IP ranges via the advertised DNS SPF records
|
|
func FetchGoogleIPRanges(ctx context.Context) ([]string, error) {
|
|
return googRanges, nil
|
|
}
|
|
|
|
// FetchGoogleIPRangesFull gets IP ranges via DNS SPF records, and includes
|
|
// all that can be trivially found (FetchGoogleIPRanges will miss a couple..)
|
|
func FetchGoogleIPRangesFull(ctx context.Context) ([]string, error) {
|
|
return append(googRanges, googRangesExtra...), nil
|
|
}
|