Check IP and domain reputation, and scan user links for phishing

Whether an address or a domain already has a bad record, how long that record deserves your trust, and a link scanner for comments, messages and profiles.

Lesson 2 asked whether a visitor is hiding. This lesson asks a different question: has this address, or this domain, already been caught doing something bad? That is reputation, and it comes from blocklists that security teams and volunteer projects maintain by watching attacks happen.

Reputation is useful in two places. On the way in, it scores the address a request comes from: an IP that spent last week brute-forcing SSH servers deserves more scrutiny on your login form. On the way out, it protects your users from each other: if your product lets people post links in comments, messages, profiles or support tickets, someone will eventually post a phishing page, and your domain will be the one that delivered it.

Reputation is history, not identity

Every blocklist entry records that an address or domain was seen doing something at some point. Three things weaken that record over time, and your code has to account for all of them.

  • Addresses are reassigned. A residential ISP hands the same address to different subscribers over weeks. A cloud provider hands a released server address to the next customer within minutes. The new holder inherits the old one's listing.
  • Addresses are shared. Behind carrier-grade NAT, one infected phone can get an address listed that thousands of other phones also use. Corporate networks and universities have the same problem at smaller scale.
  • Domains are cleaned up, or not yet listed. A compromised WordPress site may host a phishing kit for two days, get listed, get cleaned and stay listed for a while. A brand-new phishing domain registered this morning is on no list at all.

The practical consequence: a blocklist hit raises the risk of a request; it does not establish guilt. A clean result fails to raise it; it does not establish safety. Weight both accordingly.

Check an IP against blocklists

IP Blacklist Lookup (ipblacklistlookup) takes an ip on a GET and costs 10 credits. Try it on the example from its definition, a well-known Tor exit:

Try it liveIP Blacklist Lookup10 credits
GEThttps://api.apiverve.com/v1/ipblacklistlookup
curl "https://api.apiverve.com/v1/ipblacklistlookup?ip=185.220.101.1" \
  -H "x-api-key: YOUR_API_KEY"
Sign in or create a free account to run this with your own key.

isIPBlacklisted is on every plan. inbound, outbound, threatLevel and isTor are premium.

Every plan gets ipAddress and the one boolean that matters most, isIPBlacklisted. Higher plans break it down:

FieldPlanMeaning
isIPBlacklistedallListed on any of the blocklists checked
inbound.foundpremiumListed as a source of attacks: spam, scanning, brute force
outbound.foundpremiumListed as a destination: command-and-control server, malware host, phishing
threatLevelpremiumOverall severity; none for a clean address. The Tor exit above returned critical
isTorpremiumWhether the address is a Tor exit
ipDetails, asn, asnNamepremiumGeolocation and network, as in lesson 1

The inbound and outbound split is worth understanding even if your plan only has the boolean, because it tells you which direction the risk runs. For a visitor hitting your login form, inbound is what matters: this address attacks things. For a server that a user's link points to, outbound is what matters: this address hosts things that hurt people. The Tor exit above is listed both ways, which is common for exits, since some of the traffic leaving them is abuse.

A clean address, such as Google's resolver 8.8.8.8, returns isIPBlacklisted: false with threatLevel: "none" and null for both inbound and outbound.

Cache blocklist results for a few hours. Lists update continually, and an address that was cleaned up should not stay penalised in your system for a week because of your cache.

Check yourself

Your login endpoint sees a request from an address with isIPBlacklisted: true. On review, the address belongs to a large mobile carrier. What is the sensible response?

Answer the check above to continue.

Run every example on your own key. Free plan, no card.

Scaling up?

Volume pricing, custom SLAs, and dedicated support for high-traffic teams.

Contact sales