Skip to content

A utility to detect various technology for a given IP address.

License

Notifications You must be signed in to change notification settings

MaKyOtOx/cdncheck

 
 

Repository files navigation

cdncheck

Helper library that checks if a given IP belongs to known CDN ranges (akamai, cloudflare, incapsula, sucuri and leaseweb). The library can be used by importing github.com/projectdiscovery/cdncheck. here follows a basic example:

package main

import (
	"log"
	"net"

	"github.com/projectdiscovery/cdncheck"
)

func main() {
	// uses projectdiscovery endpoint with cached data to avoid ip ban
	// Use cdncheck.New() if you want to scrape each endpoint (don't do it too often or your ip can be blocked)
	client, err := cdncheck.NewWithCache()
	if err != nil {
		log.Fatal(err)
	}
	if found, result, err := client.Check(net.ParseIP("173.245.48.12")); found && err == nil {
		log.Println("ip is part of cdn, result:", result)
	}
}

About

A utility to detect various technology for a given IP address.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%