How to Check if Suspicious IP Addresses are Tor Exit Node Servers using Go
With all the browsing secrecy afforded by Tor Node Servers, it’s no surprise that cyber criminals make frequent use of them to carry out various clandestine activities. As such, it’s important to take stock of Tor Exit Node IP addresses as much as possible — that way, any directly ensuing network breach attempts won’t take you by complete surprise. Thankfully, you can quickly & easily identify Tor Exit Node IP Addresses using our “Check if IP Address is a Tor Node Server” API. This API simply checks an input IP address string to identify its origin, and returns an ‘isTorNode’ Boolean response.
Below, I’ve provided complementary code examples to help structure your API call in Go. In addition to these, you’ll just need a valid Cloudmersive API key to authenticate the service. You can get an API key for free (with a hard limit of 800 API calls per month) by registering a free account on our website; otherwise, there are several enterprise-level options to choose from.
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.cloudmersive.com/security/threat-detection/network/ip/is-tor-node"
method := "POST"
payload := strings.NewReader(`"<string>"`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Apikey", "YOUR-API-KEY-HERE")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}