Guides
Last updated
August 21, 2026

OTP Bots: How They Work and How to Block Them

Nicolas Rios
Nicolas Rios

Table of Contents:

Get your free
IP Geolocation
 API key now
stars rating
4.8 from 1,863 votes
See why the best developers build on Abstract
START FOR FREE
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
No credit card required

Looking for FreeOTP, the open-source authenticator app? That is a different thing: this page is about the criminal call-and-phish bots that trick people into reading their one-time passcodes to an attacker. If you run a service that sends OTPs, this guide is written for your fraud and engineering team: how the bots work, which controls actually stop them, and where phone-number gating fits.

Try Phone Validation for free and check any number’s line type and country before you send the OTP. 100 free requests a month, no credit card required.

What is an OTP bot?

An OTP bot is an automated tool that phones or texts a victim, impersonates a trusted service, and persuades them to reveal the one-time passcode that was just sent to their device. The bot relays the code to the attacker in real time, turning a stolen password into a completed login despite SMS two-factor authentication.

How an OTP bot attack works, stage by stage

The attack is a pipeline, and every stage is automated except the victim’s mistake:

  1. Credential sourcing. The attacker starts with a username and password from a breach dump or phishing kit.
  2. Login attempt. A bot enters the stolen credentials on the real site, which triggers a genuine OTP to the victim.
  3. The call. Within seconds, the bot calls the victim with a spoofed caller ID, posing as the service’s fraud team.
  4. The script. A convincing voice prompt asks the victim to enter or read the code they just received, framing it as identity confirmation.
  5. The relay. The victim’s code reaches the attacker’s console in real time.
  6. Session established. The attacker completes the login, changes recovery settings, and moves money or data before the victim hangs up.

Which controls stop OTP bots? An honest comparison

No single control closes this attack, and vendors rarely say so. The table answers two separate questions honestly: does the control stop the social-engineering relay above, and does it stop the adjacent SMS pumping fraud, the send-path half of the problem.

ControlStops OTP bots?Stops SMS pumping?User frictionCost to implementWhere it sits
SMS OTP aloneNo, it is the targetNo, it is the vehicleLowAlready paidAuth flow
TOTP authenticator appPartly: codes can still be phished, but there is no SMS to interceptYes, removes the sendMediumLowAuth flow
Passkeys / WebAuthnYes: nothing to read aloud, origin-boundYes, removes the sendLow after setupMediumAuth flow
Push approval with number matchingLargely: the victim must actively mismatchYes, removes the sendLowMediumAuth flow
Phone-number-type gatingNo for the relay itself; yes for account farming with disposable numbersYes, at the sourceNone for real usersLow: one request per signupSignup and send path
Velocity limitsSlows credential-stuffing that precedes the callPartly, caps the burn rateNoneLowSend path
Carrier and country allowlistingNoYes, removes high-payout destinationsNone in home marketsLowSend path

Where phone-number gating fits, stated plainly

Gating cannot stop a victim who reads a code aloud to a convincing caller. That failure is human, and the durable fix is passkeys or push approval with number matching. What gating does stop is the supply line: the disposable and VoIP numbers that let attackers farm accounts at scale, receive codes without a real phone, and resell verified accounts. Cutting that supply raises the attacker’s cost per account from cents to the price of a real SIM.

The check is one request at signup time and again at OTP-request time. Abstract’s Phone Validation resolves line type, carrier, and country before you send anything:

{
  "phone": "+14152007986",
  "valid": true,
  "format": { "international": "+14152007986", "local": "(415) 200-7986" },
  "country": { "code": "US", "name": "United States", "prefix": "+1" },
  "location": "California",
  "type": "voip",
  "carrier": "Twilio"
}

Gate on two fields: refuse or challenge when type resolves to voip, and apply your country allowlist. The same gate in Node.js and Python:

// Pre-send gate: refuse to send an OTP to risky numbers
const API_KEY = process.env.ABSTRACT_PHONE_KEY;
const ALLOWED_COUNTRIES = ["US", "CA", "GB"];

async function canSendOtp(phone) {
  const url = "https://phonevalidation.abstractapi.com/v1/?api_key="
    + API_KEY + "&phone=" + encodeURIComponent(phone);
  const res = await fetch(url);
  const data = await res.json();

  if (!data.valid) {
    return { allow: false, reason: "invalid_number" };
  }
  if (data.type === "voip") {
    return { allow: false, reason: "voip_line_type" };
  }
  if (!ALLOWED_COUNTRIES.includes(data.country.code)) {
    return { allow: false, reason: "country_not_allowed" };
  }
  return { allow: true, reason: "ok" };
}
# Pre-send gate: refuse to send an OTP to risky numbers
import os
import requests

API_KEY = os.environ["ABSTRACT_PHONE_KEY"]
ALLOWED_COUNTRIES = {"US", "CA", "GB"}

def can_send_otp(phone):
    res = requests.get(
        "https://phonevalidation.abstractapi.com/v1/",
        params={"api_key": API_KEY, "phone": phone},
        timeout=5,
    )
    data = res.json()
    if not data.get("valid"):
        return {"allow": False, "reason": "invalid_number"}
    if data.get("type") == "voip":
        return {"allow": False, "reason": "voip_line_type"}
    if data.get("country", {}).get("code") not in ALLOWED_COUNTRIES:
        return {"allow": False, "reason": "country_not_allowed"}
    return {"allow": True, "reason": "ok"}

To see the signal by hand, check a number’s line type free, no key required, or read how VoIP number verification works for what the line-type flag means underneath.

Enter an IP address to start
Need inspiration? Try
73.162.0.1
LOCATE
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Checking
5
Results for
ip address
Country:
TEST
Region:
TEST
City:
TEST
Coordinates:
TEST
Zip code:
TEST
Connection:
TEST
Get free credits, more data, and faster results

How much does an OTP bot cost an attacker?

Security researchers who track underground markets report OTP bots sold as subscriptions on messaging platforms, typically priced from tens to a few hundred dollars per month depending on features like caller-ID spoofing and multi-language scripts. The exact menus change monthly, which is the point: the barrier to entry is a subscription, not a skill.

What can a criminal do with a stolen OTP?

Whatever the session allows: empty a payment balance, change the recovery email and lock the victim out, approve a fraudulent transfer, or enroll their own device for future logins. The OTP is not the prize, the authenticated session is. That is why speed matters to the attacker and why the bots automate the relay.

Can you generate your own OTPs safely?

Yes, and it is unrelated to the attack: authenticator apps generate time-based codes locally on your device using a shared secret. If you searched for generating OTPs, you likely want a TOTP library or an authenticator app, not this page. The fraud problem is not code generation, it is code disclosure.

What to build first

In order of impact per unit of effort: offer passkeys or push approval with number matching for high-value actions, gate signups and OTP sends on line type and country, add velocity limits per IP and account, and keep SMS OTP only as a fallback. Track two numbers weekly, the share of signups resolving to VoIP and the OTP send-to-completion ratio, and you will see both the farming and the pumping side of the abuse move. For the full signal set behind the gate, see what phone intelligence covers.

Frequently Asked Questions

What is an OTP bot?

An OTP bot is an automated phishing tool that calls or texts a victim while impersonating a trusted company, persuades them to reveal the one-time passcode just sent to them, and relays it to an attacker in real time to complete a fraudulent login.

Are OTP bots illegal?

Yes. Using one involves unauthorized account access, impersonation, and usually wire fraud. The bots are sold openly on underground channels anyway, which is why defenders should assume any SMS-only 2FA flow will eventually face them.

Do OTP bots defeat two-factor authentication?

They defeat SMS and voice OTP specifically, because a human can be talked into disclosing those codes. Phishing-resistant factors like passkeys and push approval with number matching remove the shareable secret, so the relay has nothing to steal.

How do companies detect OTP bot activity?

Common tells are OTP requests that arrive seconds after a failed or unusual login, spikes in verification requests to VoIP or disposable numbers, and completion patterns where codes are entered from a different IP or device than the one that requested them.

Does blocking VoIP numbers stop OTP bots?

It stops the account-farming side: attackers receiving codes on disposable numbers at scale. It does not stop a live victim from reading a code aloud. Pair number gating with phishing-resistant authentication for the human side of the attack.

Is FreeOTP an OTP bot?

No. FreeOTP is a legitimate open-source authenticator app that generates time-based codes on your device. OTP bots are criminal tools that steal codes from victims. They share three letters and nothing else.

Nicolas Rios
Nicolas Rios

CEO at Abstract API

Get your free
IP Geolocation
key now
See why the best developers build on Abstract
get started for free

Related Articles

Get your free
IP Geolocation
key now
stars rating
4.8 from 1,863 votes
See why the best developers build on Abstract
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
No credit card required