UNPKG

@networkpro/web

Version:

Locking Down Networks, Unlocking Confidence™ | Security, Networking, Privacy — Network Pro Strategies

57 lines (48 loc) 1.53 kB
/* ========================================================================== src/lib/security/probely.js Copyright © 2025-2026 Network Pro Strategies (Network Pro™) SPDX-License-Identifier: CC-BY-4.0 OR GPL-3.0-or-later This file is part of Network Pro. ========================================================================== */ /** * @file probely.js * @description Determines whether a request originates from the Probely * security scanner, based on its User-Agent string or known source IP address. * @module tests/security * @author Scott Lopez * @updated 2025-11-11 */ /** @typedef {{ ua?: string, ip?: string }} ScannerInput */ /** * Check if a request is likely from Probely. * @param {ScannerInput} input * @returns {boolean} - True if the request matches Probely’s fingerprint. */ export function isProbelyScanner({ ua, ip }) { const PROBELY_UA_FRAGMENTS = [ 'probelyspdr/', 'probelyfp/', 'probelymrkt/', 'probelysc/', 'python-httpx/', ]; const PROBELY_IPS = [ '18.235.241.170', '52.65.214.19', '13.237.213.25', '52.19.40.38', '44.205.45.120', '3.104.172.219', '13.211.189.220', '52.16.191.244', ]; if (!ua && !ip) return false; const normalizedUA = ua?.toLowerCase() ?? ''; const normalizedIP = ip?.trim() ?? ''; return ( PROBELY_UA_FRAGMENTS.some((fragment) => normalizedUA.includes(fragment.toLowerCase()), ) || PROBELY_IPS.includes(normalizedIP) ); } // cspell:ignore probelyfp probelymrkt probelysc httpx