avatarTeri Radichel

Free AI web copilot to create summaries, insights and extended knowledge, download it at here

8633

Abstract

currency</h2><p id="cd6f">I would be remiss on a security blog not to tell you that BGP has been abused in ways that led to major data breaches. It has also caused serious outages due to misconfigurations. And, BGP is difficult to configure and manage securely because it does not have a lot of security controls built into it. Therefore it is critical to monitor it closely.</p><p id="6adf">The attack is called BGP Hijacking and you can read more about how it works here:</p><div id="18da" class="link-block"> <a href="https://en.wikipedia.org/wiki/BGP_hijacking"> <div> <div> <h2>BGP hijacking - Wikipedia</h2> <div><h3>BGP hijacking (sometimes referred to as prefix hijacking, route hijacking or IP hijacking) is the illegitimate takeover…</h3></div> <div><p>en.wikipedia.org</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/0*CtDmYFj2UaywZIaj)"></div> </div> </div> </a> </div><p id="c803">Here are a few examples of BGP gone wrong.</p><p id="1895">Microsoft outage caused by misconfiguration of BGP:</p><p id="6501"><a href="https://www.thousandeyes.com/blog/microsoft-outage-analysis-january-25-2023">https://www.thousandeyes.com/blog/microsoft-outage-analysis-january-25-2023</a></p><p id="0254">Iran suspected of rerouting Google.com:</p><div id="6eb5" class="link-block"> <a href="https://www.csoonline.com/article/566549/possible-bgp-hijacking-takes-google-down.html"> <div> <div> <h2>Possible BGP hijacking takes Google down</h2> <div><h3>Google went down Monday as a border gate protocol (BGP) issue rerouted traffic to China, Russia, and Nigeria.</h3></div> <div><p>www.csoonline.com</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/0*P60h_B9ocamiNkik)"></div> </div> </div> </a> </div><p id="a177">More on Iranian attacks on BGP:</p><div id="8fe6" class="link-block"> <a href="https://academic.oup.com/cybersecurity/article/7/1/tyab018/6353268"> <div> <div> <h2>The geopolitics behind the routes data travel: a case study of Iran</h2> <div><h3>Abstract. In November 2019, in the wake of political demonstrations against the regime, Iran managed to selectively cut…</h3></div> <div><p>academic.oup.com</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/0*UtVVaQc0O_Al3OoU)"></div> </div> </div> </a> </div><p id="fa8e">Chinese attacks on BGP:</p><div id="cd3f" class="link-block"> <a href="https://arstechnica.com/tech-policy/2020/04/citing-bgp-hijacks-and-hack-attacks-feds-want-china-telecom-out-of-the-us/"> <div> <div> <h2>Citing BGP hijacks and hack attacks, feds want China Telecom out of the US</h2> <div><h3>With a history of cyber attacks, Chinese-owned telecom is a threat, officials say.</h3></div> <div><p>arstechnica.com</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/0*7QXWNhX19fSOC5i3)"></div> </div> </div> </a> </div><p id="2f7e">Here are some BGP redirections that resulted in stolen bitcoin:</p><div id="c6bc" class="link-block"> <a href="https://www.wired.com/2014/08/isp-bitcoin-theft/"> <div> <div> <h2>Hacker Redirects Traffic From 19 Internet Providers to Steal Bitcoins</h2> <div><h3>Among all the scams and thievery in the bitcoin economy, one recent hack sets a new bar for brazenness: Stealing an…</h3></div> <div><p>www.wired.com</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/0*uiRff3-7sQ_yduBb)"></div> </div> </div> </a> </div><div id="2513" class="link-block"> <a href="https://arstechnica.com/information-technology/2022/09/how-3-hours-of-inaction-from-amazon-cost-cryptocurrency-holders-235000/"> <div> <div> <h2>How 3 hours of inaction from Amazon cost cryptocurrency holders 235,000</h2> <div><h3>For 2nd time in 4 years, Amazon loses control of its IP space in BGP hijacking.</h3></div> <div><p>arstechnica.com</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/0*nMfzng8LvWkXMxuV)"></div> </div> </div> </a> </div><div id="f987" class="link-block"> <a href="https://www.theregister.com/2014/08/07/bgp_bitcoin_mining_heist/"> <div> <div> <h2>Network hijacker steals 83,000 in Bitcoin ... and enough Dogecoin for a cup of coffee</h2> <div><h3>Wow. Such hack. Very router. So BGP. Wow.</h3></div> <div><p>www.theregister.com</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/0*zVNP9Oft77EiPAZV)"></div> </div> </div> </a> </div><div id="b031" class="link-block"> <a href="https://www.bankinfosecurity.com/crypto-exchange-klayswap-loses-19m-after-bgp-hijack-a-18518"> <div> <div> <h2>Crypto Exchange KLAYswap Loses 1.9M After BGP Hijack</h2> <div><h3>Unknown hackers have stolen about 1.9 million from South Korean cryptocurrency platform KLAYswap using a Border…</h3></div> <div><p>www.bankinfosecurity.com</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/0*Z8Zahqtb665cJfiq)"></div> </div> </div> </a> </div><p id="126a">By the way, if you lose Bitcoin due to a BGP attack, good luck getting it back. First of all, the attacks are often outside of the jurisdiction of the victim. I wrote about jurisdictions and cyber law in this post:</p><div id="d68f" class="link-block"> <a href="https://readmedium.com/why-cisos-need-indemnification-f57e5ab30252"> <div> <div> <h2>Why CISOs Need Indemnification</h2> <div><h3>What is it and why it matters in light of new SEC rules</h3></div> <div><p>medium.com</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/1*F9eklNd5WGViiwowpTK4eA.png)"></div> </div> </div> </a> </div><p id="a470">Unlike bank accounts in the US insured under certain circumstances by the FDIC, cryptocurrency has no such protections.</p><div id="0f90" class="link-block"> <a href="https://www.fdic.gov/"> <div> <div> <h2>FDIC: Federal Deposit Insurance Corporation</h2> <div><h3>The FDIC is an independent agency created by the U.S. Congress to maintain stability and public confidence in the…</h3></div> <div><p>www.fdic.gov</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/0*eAv2-QY60BeUaQdy)"></div> </div> </div> </a> </div><p id="26db">Bitcoin is not very regulated by the US government like banks and other financial institutions. If the exchanges are outside the jurisdiction of the country where you live, good luck getting your money back. Besides that fact that investing in cryptocurrency is investing and propping up the value of the currency used by criminals attacking hospitals with ransomware, people avoiding sanctions, and money laundering. Although there are some use cases where crypto can help they are generally not related to issues faced by the average US citizens, so my my motto until

Options

more regulation and safety exists: <b><i>Crypto is for criminals.</i></b></p><p id="6774">BGP attacks are only one of the ways people are losing money in crypto, not to mention the implosion of companies like FTX and others.</p><div id="5500" class="link-block"> <a href="https://www.consumernotice.org/legal/crypto-bankruptcies/"> <div> <div> <h2>Crypto Bankruptcies: Companies That Filed & Tips for Investors</h2> <div><h3>Learn about the crypto bankruptcies of 2022 and the companies involved. Read about what led them to file for bankruptcy…</h3></div> <div><p>www.consumernotice.org</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/0*Fevq5LFIVsYyG41D)"></div> </div> </div> </a> </div><p id="3b64">The ability to transfer funds to other networks as well as the double spend problem I read about the first time I scanned a book on cryptocurrency is what led me not to get into it. Although it has proven lucrative for some it is primarily based on the fact that it funds organized crime, not because it is used in many legitimate transactions. That’s why I continue to avoid it, on top of the inherent risks mentioned above.</p><p id="c072">But I digress.</p><h2 id="1438">What is a private ASN?</h2><p id="6de4">Think of a private ASN like a private IP address. You can use them for routing purposes in policies that reside in your own network. There’s a range of ASNs designated by ARIN as explained here:</p><blockquote id="7011"><p>A <b>2-byte ASN</b> is a 16-bit number. This format provides for 65,536 ASNs (0 to 65535). From these ASNs, the Internet Assigned Numbers Authority (IANA) reserved 1,023 of them <b>(64512 to 65534) for private use.</b></p></blockquote><blockquote id="2d25"><p>A <b>4-byte ASN</b> is a 32-bit number. This format provides for 232 or 4,294,967,296 ASNs (0 to 4294967295). IANA reserved a block of 94,967,295 <b>ASNs (4200000000 to 4294967294) for private use.</b></p></blockquote><p id="91f6">All ASNs are now 4 bytes, by the way.</p><p id="442b">Why does this matter? Because if you want to set up private network routing between devices that should not be accessible to the broader Internet you can use these private ASNs.</p><p id="0959">For example, when you want to set up a site to site VPN between AWS and your own network device you will use an ASN.</p><figure id="4b68"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/0*D515Mfp-fwtx2tXm.png"><figcaption></figcaption></figure><blockquote id="63a7"><p>When you create a virtual private gateway, you can specify the private Autonomous System Number (ASN) for the Amazon side of the gateway. If you don’t specify an ASN, the virtual private gateway is created with the default ASN (64512).</p></blockquote><p id="3964">You can see that 64512 is the first number in the private IP range from the ARIN documentation above.</p><div id="5254" class="link-block"> <a href="https://docs.aws.amazon.com/vpn/latest/s2svpn/how_it_works.html?src=radichel"> <div> <div> <h2>How AWS Site-to-Site VPN works</h2> <div><h3>Enable access to your network from your VPC by attaching a virtual private gateway, creating a custom route table, and…</h3></div> <div><p>docs.aws.amazon.com</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/)"></div> </div> </div> </a> </div><p id="2fac">If you have a public ASN you can use one for the VPN configuration of the customer gateway. If you don’t have a public ASN, you can use a private ASN in the specified ranges below.</p><figure id="39ea"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*PEoewo6UG-E5ptqZYXk_Dg.png"><figcaption></figcaption></figure><div id="689b" class="link-block"> <a href="https://docs.aws.amazon.com/vpn/latest/s2svpn/cgw-options.html?src=radichel"> <div> <div> <h2>Customer gateway options for your Site-to-Site VPN connection</h2> <div><h3>Learn about the options you can configure for your customer gateway.</h3></div> <div><p>docs.aws.amazon.com</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/)"></div> </div> </div> </a> </div><p id="65f6">Best security practice is to ensure these private ASNs are not advertised to the Internet.</p><h2 id="9164">BGP Security Best Practices</h2><p id="c6ff">Here are some additional resources with security best practices for BGP:</p><div id="164d" class="link-block"> <a href="https://sec.cloudapps.cisco.com/security/center/resources/protecting_border_gateway_protocol"> <div> <div> <h2>Protecting Border Gateway Protocol for the Enterprise</h2> <div><h3>Summary of Border Gateway Protocol Summary of BGP Threats BGP Baseline Configurations Baseline IP BGP Routing Tables…</h3></div> <div><p>sec.cloudapps.cisco.com</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/0*lljpIx6yqnPK9ySg)"></div> </div> </div> </a> </div><p id="3077"><a href="https://www.nsa.gov/portals/75/documents/what-we-do/cybersecurity/professional-resources/ctr-guide-to-border-gateway-protocol-best-practices.pdf">https://www.nsa.gov/portals/75/documents/what-we-do/cybersecurity/professional-resources/ctr-guide-to-border-gateway-protocol-best-practices.pdf</a></p><p id="0f69"><a href="https://www.ncsc.gov.uk/files/border-gateway-protocol-technical-paper.pdf">https://www.ncsc.gov.uk/files/border-gateway-protocol-technical-paper.pdf</a></p><div id="e015" class="link-block"> <a href="https://www.nist.gov/news-events/news/2019/12/nist-publishes-sp-800-189-resilient-interdomain-traffic-exchange-bgp"> <div> <div> <h2>NIST Publishes SP 800-189, Resilient Interdomain Traffic Exchange: BGP Security and DDoS Mitigation</h2> <div><h3>In recent years, numerous routing control plane anomalies such as Border Gateway Protocol (BGP), prefix hijacking, and…</h3></div> <div><p>www.nist.gov</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/)"></div> </div> </div> </a> </div><p id="3c29">Now that you know what ASNs are you can use them in conjunction with AWS services that leverage them.</p><p id="f482">Follow for updates.</p><p id="4a3a">Teri Radichel | <i>© <a href="https://2ndsightlab.com/?source=post_page---------------------------">2nd Sight Lab</a> 2024</i></p><div id="8b5f"><pre><span class="hljs-section">About Teri Radichel:

⭐️ Author: Cybersecurity Books
⭐️ Presentations: Presentations by Teri Radichel
⭐️ Recognition: SANS Award, AWS Security Hero, IANS Faculty
⭐️ Certifications: SANS ~ GSE 240
⭐️ Education: BA Business, Master of Software Engineering, Master of Infosec
⭐️ Company: Penetration Tests, Assessments, Phone Consulting ~ 2nd Sight Lab</pre></div><div id="caae"><pre><span class="hljs-section">Need Help With Cybersecurity, Cloud, or Application Security?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</span>
🔒 Request a penetration test or security assessment
🔒 Schedule a consulting call
🔒 Cybersecurity Speaker for Presentation</pre></div><div id="afb0"><pre>Follow <span class="hljs-keyword">for</span> more stories like <span class="hljs-keyword">this</span>:

❤️ Sign Up my Medium Email List ❤️ Twitter: <span class="hljs-meta">@teriradichel</span> ❤️ LinkedIn: https:<span class="hljs-comment">//www.linkedin.com/in/teriradichel</span> ❤️ Mastodon: <span class="hljs-meta">@teriradichel</span><span class="hljs-meta">@infosec</span>.exchange ❤️ Facebook: 2nd Sight Lab ❤️ YouTube: @2ndsightlab</pre></div><figure id="5610"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/0*H9Ew1KCl-29nZiPR.jpeg"><figcaption></figcaption></figure></article></body>

Public and Private Autonomous System Numbers (ASNs)

ACM.461 How ASNs and BGP are used and abused in attacks to route traffic on the Internet

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

⚙️ Check out my series on Automating Cybersecurity Metrics | Code

🔒 Related Stories: Network Security | Data Breaches

💻 Free Content on Jobs in Cybersecurity | ✉️ Sign up for the Email List

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

In the last post I explained what Internet Registries are and how they track ownership of IP address ranges. If you are not familiar with those topics you’ll want to read this first:

I mentioned at the end of that post that Internet registries also track ASNs or Autonomous System Numbers. An organization requests an ASN from an IP registry. Then they associate their IP ranges with that ASN. Then they can use that ASN to provide information to other networks to advertise those IP ranges and explain how to route traffic properly to the correct location on their network.

Network Routing

In order for a network packet to get from one network to another it needs to know what route to take. Your network devices have what are called route tables that define what ip addresses should take what routes to get to other networks.

If no route exists for a particular IP range, you will get a “No Route To Host” error. I explained what that is and how to fix it for this particular case where I needed to send traffic between two devices on my network.

These two devices were both on my network and under my control so I could change the route tables to get the traffic to flow correctly.

But what if I need to send some traffic to some other network where I don’t control the routing tables? How do those routing tables get updated when one network makes a change to the way traffic should be routed and they need to let another network know about the change?

This is where a protocol called BGP usually comes into play.

Border Gateway Protocol (BGP)

BGP is a way for routers on the Internet to advertise information to each other. BGP helps routers determine what routes are available and the most efficient routes to take to get a network packet from A to B.

Border Gateway Protocol (BGP) is the postal service of the Internet. When someone drops a letter into a mailbox, the Postal Service processes that piece of mail and chooses a fast, efficient route to deliver that letter to its recipient.

https://www.cloudflare.com/learning/security/glossary/what-is-bgp/

You put the routes you want to advertise in your routing table as explained here for a Cisco device:

The routes above involve IP addresses, but routing policies can also make use of ASNs. Instead of directing traffic to a specific IP range, the routing policy might have information about ASNs — or the devices that belong to a particular AS (Autonomous System) or, in other words, a network of IP ranges with a single owner. The link I posted above shows how organizations create accounts at ARIN and request an ASN to associate with their network, which may consist of multiple non-contiguous IP ranges.

How does BGP use ASNs?

BGP uses ASNs and routing policies to help determine the most efficient path to take on the Internet.

Internet service providers use ASNs to identify their networks and the routes connecting them to the internet. As a result, routers can use ASNs to determine the best path for data packets traveling between networks. ASNs tell routers which network the data is being sent to.

https://neosnetworks.com/products-services/business-internet-services/what-are-autonomous-system-numbers/

Routing policies help define the path a network packet may take as it traverses the Internet and instead of pointing the traffic to specific IP range, a policy may specify a network using an ASN.

Routing Policy: The set of rules a network administrator implements. Those rules control the paths data takes when it exits to other networks. It can influence but not control the paths incoming data takes.

Also from the above post:

When networks connect to each other, they identify themselves with their ASN and they communicate which IP networks they can reach and the routes they would use to get to distant networks

Abuse of BGP to redirect websites and steal cryptocurrency

I would be remiss on a security blog not to tell you that BGP has been abused in ways that led to major data breaches. It has also caused serious outages due to misconfigurations. And, BGP is difficult to configure and manage securely because it does not have a lot of security controls built into it. Therefore it is critical to monitor it closely.

The attack is called BGP Hijacking and you can read more about how it works here:

Here are a few examples of BGP gone wrong.

Microsoft outage caused by misconfiguration of BGP:

https://www.thousandeyes.com/blog/microsoft-outage-analysis-january-25-2023

Iran suspected of rerouting Google.com:

More on Iranian attacks on BGP:

Chinese attacks on BGP:

Here are some BGP redirections that resulted in stolen bitcoin:

By the way, if you lose Bitcoin due to a BGP attack, good luck getting it back. First of all, the attacks are often outside of the jurisdiction of the victim. I wrote about jurisdictions and cyber law in this post:

Unlike bank accounts in the US insured under certain circumstances by the FDIC, cryptocurrency has no such protections.

Bitcoin is not very regulated by the US government like banks and other financial institutions. If the exchanges are outside the jurisdiction of the country where you live, good luck getting your money back. Besides that fact that investing in cryptocurrency is investing and propping up the value of the currency used by criminals attacking hospitals with ransomware, people avoiding sanctions, and money laundering. Although there are some use cases where crypto can help they are generally not related to issues faced by the average US citizens, so my my motto until more regulation and safety exists: Crypto is for criminals.

BGP attacks are only one of the ways people are losing money in crypto, not to mention the implosion of companies like FTX and others.

The ability to transfer funds to other networks as well as the double spend problem I read about the first time I scanned a book on cryptocurrency is what led me not to get into it. Although it has proven lucrative for some it is primarily based on the fact that it funds organized crime, not because it is used in many legitimate transactions. That’s why I continue to avoid it, on top of the inherent risks mentioned above.

But I digress.

What is a private ASN?

Think of a private ASN like a private IP address. You can use them for routing purposes in policies that reside in your own network. There’s a range of ASNs designated by ARIN as explained here:

A 2-byte ASN is a 16-bit number. This format provides for 65,536 ASNs (0 to 65535). From these ASNs, the Internet Assigned Numbers Authority (IANA) reserved 1,023 of them (64512 to 65534) for private use.

A 4-byte ASN is a 32-bit number. This format provides for 232 or 4,294,967,296 ASNs (0 to 4294967295). IANA reserved a block of 94,967,295 ASNs (4200000000 to 4294967294) for private use.

All ASNs are now 4 bytes, by the way.

Why does this matter? Because if you want to set up private network routing between devices that should not be accessible to the broader Internet you can use these private ASNs.

For example, when you want to set up a site to site VPN between AWS and your own network device you will use an ASN.

When you create a virtual private gateway, you can specify the private Autonomous System Number (ASN) for the Amazon side of the gateway. If you don’t specify an ASN, the virtual private gateway is created with the default ASN (64512).

You can see that 64512 is the first number in the private IP range from the ARIN documentation above.

If you have a public ASN you can use one for the VPN configuration of the customer gateway. If you don’t have a public ASN, you can use a private ASN in the specified ranges below.

Best security practice is to ensure these private ASNs are not advertised to the Internet.

BGP Security Best Practices

Here are some additional resources with security best practices for BGP:

https://www.nsa.gov/portals/75/documents/what-we-do/cybersecurity/professional-resources/ctr-guide-to-border-gateway-protocol-best-practices.pdf

https://www.ncsc.gov.uk/files/border-gateway-protocol-technical-paper.pdf

Now that you know what ASNs are you can use them in conjunction with AWS services that leverage them.

Follow for updates.

Teri Radichel | © 2nd Sight Lab 2024

About Teri Radichel:
~~~~~~~~~~~~~~~~~~~~
⭐️ Author: Cybersecurity Books
⭐️ Presentations: Presentations by Teri Radichel
⭐️ Recognition: SANS Award, AWS Security Hero, IANS Faculty
⭐️ Certifications: SANS ~ GSE 240
⭐️ Education: BA Business, Master of Software Engineering, Master of Infosec
⭐️ Company: Penetration Tests, Assessments, Phone Consulting ~ 2nd Sight Lab
Need Help With Cybersecurity, Cloud, or Application Security?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
🔒 Request a penetration test or security assessment
🔒 Schedule a consulting call
🔒 Cybersecurity Speaker for Presentation
Follow for more stories like this:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
❤️ Sign Up my Medium Email List
❤️ Twitter: @teriradichel
❤️ LinkedIn: https://www.linkedin.com/in/teriradichel
❤️ Mastodon: @teriradichel@infosec.exchange
❤️ Facebook: 2nd Sight Lab
❤️ YouTube: @2ndsightlab
Asn
Bgp
Cybersecurity
Hijack
Routing
Recommended from ReadMedium