To start working with censys you have to create an account and get an application Key and application secret First. You can do this at https://censys.io.
Download the package:
go get github.com/oucema001/censys-go
You can now use the library in your own projects :-)
package main
import (
"log"
"github.com/oucema001/censys-go"
)
func main() {
client := censys.NewClient(nil, "MY_APPID", "MY_APPSECRET")
dns, err := client.GetDNSResolve([]string{"google.com", "ya.ru"})
a, err := client.Search(context.Background(), "www.google.com", censys.WEBSITES)
if err != nil {
log.Panic(err)
} else {
fmt.Println("alexa rank : %d",a.Results[0].AlexaRank)
}
}
This will output :
alexa rank : 1
###Implemented Censys APIs :
- /api/v1/account
- /api/v1/search/ipv4
- /api/v1/search/websites
- /api/v1/search/certificates
- /api/v1/view/:index/:id
- /api/v1/view/ipv4/:id
- /api/v1/view/websites/:id
- /api/v1/view/certificates/:id
- /api/v1/data
- /api/v1/report/:index
- /api/v1/report/ipv4
- /api/v1/report/websites
- /api/v1/report/certificates