One console command to see how many IPs your Switchvox is blocking
A single read-only command you can paste into Chrome's console to count your Switchvox blocked IP list, and what the number tells you.
Wondering whether your Switchvox is under constant attack? One read-only command tells you how many addresses it’s currently blocking, without clicking through page after page of the Blocked IPs list.
How to run it
- Log in to the Switchvox admin portal in Google Chrome.
- Press F12 and click the Console tab (on Windows, Ctrl+Shift+J opens it directly).
- The first time you paste into the console, Chrome blocks it as a safety measure. Read the command, then type
allow pastingand press Enter. - Paste this and press Enter:
fetch('/json', { method: 'POST', credentials: 'same-origin', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ request: { method: 'switchvox.blockedIps.getList', parameters: {} } }) }).then((r) => r.json()).then((d) => console.log('Blocked IPs:', d?.response?.result?.blocked_ips?.total_items ?? d));
It asks Switchvox’s own API for the blocked list and prints the total. It doesn’t change anything.
What the number means
- A handful: normal. Phones with a typo’d password and the occasional scanner.
- Hundreds or thousands: something is reachable from the internet that probably shouldn’t be, like SIP or the admin portal open to all networks. That’s worth fixing before anything else.
If the number is large and you want to export the list and clear it safely, the full walkthrough covers exposure checks, a CSV backup, and a paced clearing script: Clearing a Switchvox blocked IP list from Chrome’s console.
Sources
- Switchvox clear all blocked IPs example (GitHub): the
blockedIps.getListAPI method - PySwitchvox (Digium): the official Python client for the Switchvox Extend API
- How Chrome DevTools helps to defend against self-XSS attacks (Chrome for Developers): the paste warning and the
allow pastingoverride
From Small Town Sysadmin
Get new guides by email
Plain-English tech tips, scam and security alerts, and fixes for small offices, whether you're the office manager or the IT pro. No spam, and you can unsubscribe anytime.