Seatext library / BotRefund evidence

How to Detect Bots Before They Hit Your Login Page

Detect bots at the edge using TLS fingerprints, JavaScript challenges, and behavioral signals before a request reaches authentication. Score several signals together, block or challenge suspicious traffic, and verify with logs. One signal is...

Built for advertisers who need clear, refund-ready traffic evidence.

Detect bots before they hit your login page by evaluating traffic at the edge: check TLS and HTTP fingerprints, run a JavaScript challenge, and score browser, network, and behavior signals before a request is allowed to reach authentication. You do not need to wait for repeated failed passwords. The login page should be the last stop, not the first place you notice abuse.

The steps below give you an order to follow, the signals to collect, and a way to verify that the detection is working.

What 'before the login page' actually means

The login page is the part of your application that receives credentials. Bot detection before that means another layer, usually a CDN, reverse proxy, or bot-management script, inspects the request first. That layer can reject, challenge, or tag traffic without the login endpoint ever seeing the request.

Prerequisites: you can route login traffic through that layer, you can log decisions, and you can test with both bots and real users. You do not need to rewrite your authentication code to start.

How pre-login bot detection works

Detection works in layers:

  • Network layer. Checks whether the IP, TLS fingerprint, HTTP headers, DNS path, and geolocation make sense together.
  • Browser layer. Looks for traces of automation, patched browser internals, and debugger connections.
  • Behavior layer. Watches movement, timing, scrolling, and clicks when JavaScript runs.
  • Challenge layer. Asks the visitor to do something a simple script usually cannot do, like execute JavaScript or compute a proof of work.

The key is not any single check. One signal can be misleading. A real user on a VPN can look suspicious by IP alone, and a bot using a residential proxy can look ordinary. The decision makes far more sense when many signals agree.

Main detection options and trade-offs

Different layers catch different bots. Use the table to decide where to start.

OptionWhat it catchesTrade-off
Server-side log reviewBasic scraper bots with odd user-agents or IP patternsCatches basic scrapers but struggles with advanced botnets
IP rate limitingObvious brute force from one sourceBypassed with proxy pools; can block shared IPs
JavaScript challengeHeadless browsers and scripts that do not fully execute the pageAdds friction; some legitimate users fail
Pattern-based client-side detectionAutomation traces and unnatural behavior before loginNeeds enough signals and ongoing tuning

Start with server-side logs if you have no existing tool. Add a JavaScript challenge before login when you are ready to filter headless browsers.

Step-by-step: Deploy detection before the login page

Follow these steps in order.

  1. Put a decision point in front of authentication. Use a CDN, WAF, bot-management service, or reverse proxy so login requests pass through it first.
  2. Capture network signals without loading the full app. Log the TLS fingerprint, IP, user-agent, accept-language, timezone, and DNS route. BotRefund's public signal list calls these network, VPN, and geolocation evading vectors.
  3. Add a JavaScript challenge for requests that reach the browser. Serve a short script that sets a signed cookie. A headless script that does not run the page will fail.
  4. Collect browser automation and behavior signals. Look for CDP debugger leaks, native patching, JS engine mismatches, automation properties, and unnatural pointer paths.
  5. Score the signals together. Do not block on one property. Use a model or rules that require several indicators before deciding.
  6. Decide what to do with each classification. Allow known-good traffic, challenge suspicious traffic, block clearly automated traffic, and send high-risk traffic to step-up verification before login.
  7. Log the outcome and verify. Record which requests were challenged, blocked, or allowed. Compare login success, account lockouts, and support complaints before and after.

The most common mistake is blocking on one signal. That is how real users lose access and how clever bots slip through.

Why the login page is a bad place to first notice bots

If detection only happens at login, your server has already done work: it parsed the request, opened a session, checked the database, and sent back a response. Attackers get useful information from each response. A 'wrong password' reply tells them a username is valid. A lockout policy can be probed. A slow response can reveal account structure.

If you move detection earlier, the bot talks to the edge layer instead of the login endpoint. It gets a challenge or a block, and your authentication system never sees the payload. This reduces database load, keeps logs cleaner, and stops credential stuffing before it starts.

Signals that matter at the edge

The following groups come from the signal categories in BotRefund's public detection explainer. They work as a checklist for pre-login detection.

  • Network identity. WebRTC network leak, IP address inconsistency, OS/TCP TTL mismatch, HTTP user-agent mismatch, DNS routing mismatch.
  • Location and language consistency. Timezone evasion, UTC timezone bias, language mismatch, accept-language mismatch.
  • Browser profile. Engine mismatch, native patching, JS engine mismatch, HTTP protocol mismatch.
  • Automation traces. CDP debugger leak, rebrowser leaks, automation properties.
  • Behavior after load. Absence of clicks or scrolling, superhuman input speed, grid-aligned pointer paths, unnatural session durations.

Each check is weak on its own. Together they give you a pattern to act on.

Hypothetical scenario: a bot reaches your login page

This is a hypothetical example to show how the layers work together.

  1. A script using a headless browser and a residential proxy sends a login request with a stolen credential list.
  2. Standard server-side checks see a plausible IP and a valid user-agent, so they let it through.
  3. The edge layer records the TLS fingerprint. It does not match the claimed browser version. The login request is redirected to a JavaScript challenge instead of the login page.
  4. The headless browser fails the challenge. The signal model also sees a language/timezone mismatch and a debugger trace.
  5. The request is blocked before the login endpoint receives the password. The attacker does not get a valid or invalid response, so the stolen list is not confirmed.

With rate limiting alone, the bot could still try many passwords. With pre-login detection, the login endpoint is not part of the conversation at all.

Limitations and when this advice does not apply

  • Advanced residential proxy botnets can look nearly human. Pattern scoring is better than single signals, but no method is perfect.
  • JavaScript challenges do not work for API-only clients, mobile apps, or users who disable JavaScript. Those routes need separate strategies.
  • Aggressive blocking can hurt legitimate users on shared IPs, VPNs, or older browsers. Prefer challenge over block at first.
  • Pre-login detection does not replace rate limiting, lockout policies, or MFA. An attacker with valid credentials can still sign in.
  • If a bot already holds a valid session, this method will not help. You need session-level monitoring and logout policies for that case.

Key facts

The following facts come from BotRefund's public pages.

FactSource
BotRefund's prediction AI uses 106 browser, network, hardware, and behavior signals together.S1
BotRefund says its AI evaluates the full pattern, not one suspicious property, and is 99% accurate at detecting bots.S1
Signals become a decision only when they are seen together.S1
Server-side audits catch basic scraper bots but struggle with advanced botnets.S2
BotRefund's detection covers network, VPN, and geolocation evading vectors plus automation and anti-stealth traps.S1
BotRefund says bots on Google Ads and Meta can drain up to 20% of ad spend.S3

Common terms

  • Edge. The network layer that handles requests before your application server.
  • TLS fingerprint. A characteristic of how a client establishes an encrypted connection. Automated tools often leave a different fingerprint from the browser they claim to be.
  • JavaScript challenge. A small script that a real browser runs to prove it can execute client-side code.
  • Behavioral signals. Mouse movement, scroll, timing, and click patterns collected from a visitor session.
  • Residential proxy. A proxy that routes traffic through real home IP addresses, making bots look geographically normal.

Frequently asked questions

What is the fastest way to start detecting bots before login?

Add a bot-management service or CDN rule in front of the login route. Log TLS fingerprints and user-agent details, then add a JavaScript challenge for suspicious requests. You can start without changing authentication code.

Can I detect bots without a JavaScript challenge?

Yes. Network-layer checks such as TLS fingerprinting, HTTP header consistency, and IP reputation catch simple bots. They miss many headless browsers, which is why a challenge helps.

Do I still need rate limiting if I have bot detection?

Yes. Bot detection and rate limiting solve different problems. Rate limiting stops brute-force volume; bot detection tries to stop automated requests before they start.

How do I know the detection is working?

Compare blocked and challenged requests against real login success and account lockout metrics. Test with a headless browser and a normal browser, and confirm that the headless one is challenged.

What is the difference between edge detection and login-page detection?

Edge detection happens before your application sees the request. Login-page detection happens after the request reaches your app, usually during or after credential submission. Earlier is better because it protects the endpoint itself.

What should I do with a flagged user who is actually human?

Challenge instead of block. If they pass the challenge, let them through and add them to an allowlist. Then adjust the thresholds so the flag happens less often.

Further reading and comparison sources

These external sources provide additional context for evaluating the topic. Their inclusion is not an endorsement.

Learn more

Visit the website for more information.

Learn more