vicigeeksimple guides
Browse
All guides

Carriers & SIP · SIP security · incident evidence

SIP attack traffic reaches Asterisk: verify the boundary before blocking more

A single blocked IP only ever answers the address a rotating source last used, and this build runs two independent SIP listeners at once. Confirm both stacks and the real firewalld state before deciding a rule has failed.

Reader setup

Before you diagnose

  1. Root or sudo on the Asterisk server, since confirming both SIP listeners and the live firewalld state both need it.
  2. Read access to whichever log your build actually writes SIP authentication failures to; confirm the exact path and verbosity before trusting an empty grep result.
  3. The name of the firewalld zone your public interface actually sits in; the second check below discovers it if you do not already know it.
Expected result
You can confirm which SIP stacks are actually listening, read the real firewalld state instead of assuming it, and tell a working-as-designed blacklist apart from a genuinely misconfigured rule before writing a new one.
Before making changes
Every check here only reads current state; do not add, remove, or reload a firewall rule from this guide without your security or network owner's sign-off, since a wrong rule on a live SIP server can cut off real calls immediately.

Name what is actually expected before calling it broken

SIP, the signalling protocol Asterisk uses to set up a call, normally runs over UDP, a connectionless transport with no built-in handshake — which is exactly why an internet-facing SIP port draws constant scanning traffic from across the internet, on any server, not only a VICIdial one. That exposure alone is not a sign of compromise; it is the ordinary condition of running SIP in the open.

The specific pattern worth naming is: "I blocked one address, and the same kind of traffic keeps arriving." On its own, that is exactly what a rotating or distributed source hitting a single-address block looks like, not proof the firewall itself failed.

A VICIdial forum thread reports this same pattern: traffic reaching Asterisk despite an active firewall block — a starting point for the checks below, not evidence by itself of which layer actually failed.

Before doing anything else, write down what you can already see without guessing: the approximate time the traffic was noticed, which port or ports it hit, and whether it was one address repeating or many different ones. Keep raw source addresses out of any shared ticket or chat message until your security owner has actually reviewed them; this guide's own checks below stay read-only for the same reason.

Trace path · read left to right
01Two SIP listeners02Real firewalld zone state03Allowlist ipset, not one IP

Two independent listeners, one blacklist habit

This build loads both of Asterisk's SIP channel drivers at once, chan_sip and PJSIP, and each keeps its own independent UDP listener on its own port. Check the firewall policy for both listeners; a listening socket alone does not establish whether it is reachable from the internet.

A single-IP blacklist rule only ever answers the last address a source used; a rotating or distributed source simply presents a new one on its next attempt. Traffic continuing after one block is the normal failure mode of that strategy, not evidence the firewall failed to apply the rule you added.

This build has both firewalld and ViciBox's own VB-firewall helper present. Exactly how the two divide responsibility for a given rule is worth confirming on your own host with the checks below rather than assumed; this guide does not assert a specific rule set either one has already installed on your build.

Rank the likely causes before writing another rule

Work through these before adding a fourth or fifth individual IP block.

  • Most likely: the strategy itself is blacklist-only against a rotating or distributed source, which will always look like it is failing no matter how many individual addresses you add to it.
  • Second: the rule you added is scoped to the wrong port or the wrong SIP stack — a rule against chan_sip's port does nothing for traffic reaching PJSIP's separate listener, or the reverse.
  • Third: the intended rule is missing from the active configuration or is assigned to a zone that does not handle the traffic. Compare runtime and permanent configuration before deciding what changed.
  • Fourth: a separate, overly broad allow rule is already open on the same port, which no amount of blacklisting the first rule will ever fix.

Read the evidence in order, not by instinct

Resist the urge to add a block before finishing all three checks below. The order matters: confirming the listeners first tells you which ports are even in scope, confirming the firewall state second tells you whether a rule already exists and is simply misplaced, and the log check last tells you whether this is scanning or something more urgent — doing them out of order tends to produce a rule aimed at the wrong port or the wrong stack.

Confirm both SIP stacks before touching the firewall

Never assert a fixed PJSIP port in your own notes or rules. On this build PJSIP's transport happens to sit on 5061 and chan_sip on 5060, but that is this build's current value, not a VICIdial constant — the only way to know your own is to ask Asterisk and the kernel directly, in that order.

Before you use it
Run both together; the first confirms what PJSIP itself believes it is bound to, and the second confirms what is actually listening at the kernel level — they should agree.
Confirm both SIP listeners actually in use
asterisk -rx 'pjsip show transports'ss -lnup | grep asterisk
Evidence · ViciBox 12 demo capture

Captured demo response · 2026-09-23 21:35 UTC. Any filtering, hidden values or test-only data are identified in the capture label. Select Replay transcript to read the recorded output.

Command output line: asterisk -rx 'pjsip show transports'
Transport: <TransportId........> <Type> <cos> <tos> <BindAddress....................>
==========================================================================================
Transport: transport-udp udp 0 96 0.0.0.0:5061
Transport: transport-wss wss 0 0 0.0.0.0:5060
Objects found: 2
Command output line: ss -lnup | grep asterisk
UNCONN 0 0 0.0.0.0:4520 0.0.0.0:* users:(("asterisk",pid=3019,fd=20))
UNCONN 0 0 0.0.0.0:4569 0.0.0.0:* users:(("asterisk",pid=3019,fd=17))
UNCONN 0 0 0.0.0.0:5060 0.0.0.0:* users:(("asterisk",pid=3019,fd=16))
UNCONN 0 0 0.0.0.0:5061 0.0.0.0:* users:(("asterisk",pid=3019,fd=13))
UNCONN 0 0 0.0.0.0:2069 0.0.0.0:* users:(("asterisk",pid=3019,fd=11))
UNCONN 0 0 [[address]]:23043 [[address]]:* users:(("asterisk",pid=3019,fd=12))
Success looks like
Compare each PJSIP UDP transport with its matching kernel listener. The second command can also show chan_sip or other Asterisk UDP sockets; the first command does not identify their ports.
Stop if
Investigate any socket not explained by a configured transport or loaded service. A single PJSIP driver can have multiple transports; do not expect exactly one socket per stack.

Read the firewall's real state instead of assuming it

A source-bound zone and an interface-bound zone can both appear in the inventory. Determine the effective zone for the source being investigated; the zone attached to eth0 is not automatically the zone used by a matching source ipset. In this historical output public owns eth0, external has trusted source ipsets and drop has blocked source ipsets. The recorded ZONE=external command inspects that trusted-source zone only.

First list active zones. For each relevant source/interface zone, inspect runtime and permanent sources, services, ports and rich rules privately. Check membership of the suspect/trusted source in the applicable ipsets and account for policy/direct rules and upstream controls with the firewall owner. Missing rules from one zone alone do not establish a failed block.

  1. Read --get-active-zones and record the public interface zone plus source-based zones. Identify the source address and address family privately.
  2. Use firewall-cmd --get-ipsets and --info-ipset=ACTUAL_SET to inspect the relevant set; the inventory can be sensitive. Ask the firewall owner to resolve overlapping sources/priorities rather than guessing a zone.
  3. For every applicable zone run firewall-cmd --zone=ACTUAL_ZONE --list-all and firewall-cmd --permanent --zone=ACTUAL_ZONE --list-all. Expand named services and compare their protocols/ports with the actual listeners.
  4. If the owner cannot map the source to the effective path, stop rule changes. Preserve the timestamp and ask for a controlled permitted/denied-source test; a config listing alone does not prove reachability.
Before you use it
Historical read-only capture. The entered external zone was a source-ipset zone; eth0 was in public. On your own host select zones from the actual source/interface mapping, not this example name.
Confirm firewalld is active and read its real zone rules
firewall-cmd --statefirewall-cmd --get-active-zonesZONE='<ZONE>'firewall-cmd --zone="$ZONE" --list-all
Evidence · ViciBox 12 demo capture · demo values substituted

Captured demo response · 2026-09-23 21:35 UTC. Any filtering, hidden values or test-only data are identified in the capture label. Select Replay transcript to read the recorded output.

Command output line: firewall-cmd --state firewall-cmd --get-active-zones ZONE='external' firewall-cmd --zone="$ZONE" --list-all
running
docker
interfaces: docker0
drop
sources: ipset:blackips ipset:blacknets ipset:voipblip ipset:voipblnet ipset:geoblock
external
sources: ipset:dynamiclist ipset:whiteips ipset:whitenets
public (default)
interfaces: eth0
external (active)
target: default
ingress-priority: 0
egress-priority: 0
icmp-block-inversion: no
interfaces:
sources: ipset:dynamiclist ipset:whiteips ipset:whitenets
services: apache2 apache2-ssl asterisk dhcpv6-client rtp ssh
ports: [redacted]
protocols:
forward: no
masquerade: yes
forward-ports:
source-ports:
icmp-blocks:
rich rules:
Success looks like
The listing shows only the selected zone’s policy. Compare every relevant source/interface zone and its permanent counterpart before drawing a conclusion.
Stop if
An absent rule in one zone is insufficient to diagnose a firewall failure. Resolve effective source membership, zone priority, other rules and upstream controls first.

Check whether traffic is scanning or actually authenticating

A targeted log check tells you whether traffic is merely knocking or actually attempting authentication, which changes how urgently to treat it.

Before you use it
Confirm this is actually the log your build writes SIP events to, at a verbosity that captures them, before reading an empty result as good news.
Grep recent SIP authentication failures
grep -E 'chan_sip|res_pjsip' /var/log/asterisk/messages | grep -iE 'failed to authenticate|no matching endpoint|wrong password' | tail -n 50
Evidence · ViciBox 12 demo capture

Captured demo response · 2026-09-24 21:55 UTC. Any filtering, hidden values or test-only data are identified in the capture label. Select Replay transcript to read the recorded output.

Command output line: grep -E 'chan_sip|res_pjsip' /var/log/asterisk/messages | grep -iE 'failed to authenticate|no matching endpoint|wrong password' | tail -n 50
(no output)
Success looks like
The matching lines show the rejection messages captured by this filter. An empty result only means these patterns did not appear in the current file; it does not establish that no attacks or successful logins occurred.
Stop if
This filter selects rejection messages and cannot establish whether authentication succeeded. Ask the security administrator to review the appropriate authentication and registration logs for the same time window.

Review an allowlist with the firewall administrator

Ask the firewall administrator to review a default-deny policy for the SIP listeners and the complete list of trusted sources. An ipset groups addresses, but assigning that set to a firewalld zone can grant access to every service allowed in that zone. The example below illustrates a source-to-zone assignment; it is not a port-scoped SIP rule.

This trades a list that only ever grows, one blocked attacker at a time, for a list of who is actually allowed to reach your SIP ports — smaller, easier to audit, and unaffected by how many different addresses the next scan uses.

For broader server hardening beyond this one incident, see Secure your VICIdial server: SSH, firewall and access control; this guide stays scoped to triaging a single active SIP traffic incident.

Before you use it
This example assigns a source to a zone, which can expose every service allowed in that zone, not just SIP. Do not run it as a port-specific rule. Have the firewall administrator review the complete active and permanent zone policies, the ipset contents, other interfaces and the recovery path first.
Example source-to-zone assignment (review only)
ZONE='<ZONE>'ALLOWLIST_IPSET='<ALLOWLIST_IPSET>'# On ViciBox, add trusted addresses to the ViciWhite IP List (Admin -> IP Lists) and run: VB-firewall --white --dynamic --quiet# On plain firewalld, apply the source live and permanently; a --reload would empty VB-firewall's runtime ipsets:firewall-cmd --zone="$ZONE" --add-source="ipset:$ALLOWLIST_IPSET"firewall-cmd --permanent --zone="$ZONE" --add-source="ipset:$ALLOWLIST_IPSET"
Reader-run example · not executed for this guide

This example has no recorded result here. Follow its preparation, expected result and stop conditions before using it.

Success looks like
After an authorized change, compare the live and permanent zone listings. Confirm the source set and every service exposed by that zone match the reviewed policy; the example does not perform a reload.
Stop if
If the set is missing or either listing differs from the reviewed policy, stop and ask the firewall administrator to correct it. Do not widen access to clear an error.

Verify the block and a real call together

Re-capture both the listener and firewall checks after the change, and confirm a real test call still connects — a security fix that also blocks legitimate traffic is not a fix.

  • `ss` and `pjsip show transports` still show exactly the listeners expected, unchanged by the firewall edit.
  • The runtime and permanent zone listings match the reviewed policy, including all services available to the source set.
  • Unwanted authentication attempts in the log stop or drop sharply, while a real test call from an allowed address still connects.

When to stop and hand this to someone else

Escalate to your security or network owner immediately, rather than continuing to adjust rules alone, for sustained high-volume traffic, any successful authentication rather than routine scanning, or genuine uncertainty about which addresses are legitimate — guessing at an allowlist under any of those conditions risks locking out real traffic or leaving a working exploit in place.

Checks and sources

What was checked

  • PJSIP_SUPPORT.txt's own activation steps confirm that this build's PJSIP and chan_sip ports are a site-specific configuration choice, not a fixed VICIdial default, which is why this guide never asserts a port number without a check next to it.

Primary references

Sources

  1. SIP attack still reaching Asterisk despite firewall blockVICIdial forum · accessed September 23, 2026
  2. VICIdial PJSIP SupportVICIdial · accessed September 23, 2026
  3. Firewalld sources and interfacesfirewalld · accessed November 7, 2026

Follow without guesswork

Get the next article

RSS is live now. Email delivery below is an explicit local preview and sends nothing.Open the RSS feed
Email preview only. The address stays in this browser and is never transmitted.