TL;DR
ASN (Autonomous System Number) firewalls block traffic based on the network origin. While effective, they aren’t foolproof. Techniques like using VPNs, proxies, CDNs, and misconfigured ASNs can bypass these blocks. This guide explains how attackers do it and what you can do to improve your security.
Understanding ASN Firewalls
ASN firewalls work by checking the origin of network traffic against a list of ASNs. If the source ASN is on a blocked list, the connection is dropped. They’re often used to block entire countries or networks known for malicious activity.
How Attackers Bypass ASN Firewalls
- Using VPNs (Virtual Private Networks):
- VPNs mask the attacker’s real IP address and route traffic through a different ASN. This makes it appear as if the connection originates from the VPN server’s ASN, potentially bypassing the block.
- Example: Connecting to a VPN server in a country not blocked by the firewall.
- Similar to VPNs, proxies act as intermediaries, hiding the attacker’s IP address and ASN.
- Example: Using a residential proxy network to appear as legitimate users from different ASNs.
- CDNs distribute content across multiple servers in various locations, each with its own ASN. Attackers can leverage this by sending traffic through a CDN server with an allowed ASN.
- Example: An attacker hosts malicious content on a CDN and directs traffic to a server within a permitted ASN.
- Incorrectly configured routing policies can lead to traffic from blocked networks being routed through allowed ASNs. This is often due to errors in BGP (Border Gateway Protocol) configurations.
- Example: A network administrator accidentally allows traffic from a known malicious ASN to transit their network.
- This is a more sophisticated attack where an attacker attempts to announce false routing information, making it appear as if traffic originates from a different ASN. This requires significant technical expertise and access to network infrastructure.
- Note: ASN hijacking is illegal in most jurisdictions.
- Using protocols like SSH tunneling or Obfsproxy can disguise the origin of traffic, making it harder to identify and block based on ASN alone.
- Example: Establishing an SSH tunnel through a server with a trusted ASN.
ssh -D 8080 user@trusted_server(This creates a SOCKS proxy on port 8080)
Protecting Against ASN Firewall Bypasses
- Combine ASN Blocking with Other Security Measures:
- Don’t rely solely on ASN firewalls. Implement additional layers of security, such as IP address blocking, reputation-based filtering, and behavioral analysis.
- Keep your ASN blocklists current with the latest threat intelligence data.
- Actively monitor BGP routing tables for anomalies and misconfigurations that could allow traffic from blocked networks to bypass the firewall. Tools like RIPEstat can help.
- Combine ASN blocking with GeoIP filtering to block traffic from entire countries or regions known for malicious activity.
- Limit the amount of traffic allowed from specific ASNs or IP addresses to mitigate the impact of attacks.
- These provide up-to-date information on malicious ASNs and IPs, helping you proactively block threats.