Author: Alan Tobagua

  • Celer Bridge incident analysis or why the BGP hijacks still having success

    Celer Bridge incident analysis or why the BGP hijacks still having success

     On 17 August 2022, a BGP spoofer was able to steal approximately USD 235,000 in cryptocurrency by employing a BGP hijack against the Celer Bridge, a service that allows users to convert between cryptocurrencies.

    In this blog post, I discuss this and previous infrastructure attacks against cryptocurrency services. While these episodes revolve around the theft of cryptocurrency, the underlying attacks hold lessons for securing the BGP routing of any organization that conducts business on the Internet.

    The BGP hijack of Celer Bridge

    In a detailed blog post earlier this month, the threat intelligence team from Coinbase explained how the attack went down (Note: Coinbase was not the target of the attack). In short, the attacker used a BGP hijack to gain control of a portion of Amazon’s IP address space.

    Doing so allowed it to impersonate a part of the Celer Bridge infrastructure, which was hosted by Amazon, and issue malicious smart contracts. These ‘phishing contracts’ stole the victim’s assets by redirecting them to the attacker’s wallet.

    To ensure the BGP hijack would be successful, the attacker needed to make certain its malicious BGP announcements wouldn’t get filtered by an upstream network by taking two steps. First, it managed to insert bogus route objects (shown below) for QuickhostUK in AltDB, a free alternative to the IRR databases managed by RADB and the five RIRs. At this time, it is unclear whether QuickhostUK was also a victim of this attack.

    irrd.log-20220817.gz:31106270-ADD 96126

    irrd.log-20220817.gz:31106280-

    irrd.log-20220817.gz:31106281-as-set:     AS-SET209243

    irrd.log-20220817.gz:31106306-descr:      quickhost set

    irrd.log-20220817.gz:31106332-members:    AS209243, AS16509

    irrd.log-20220817.gz:31106362:mnt-by:     MAINT-QUICKHOSTUK

    irrd.log-20220817.gz:31106392-changed:    crussell()quickhostuk net 20220816

    irrd.log-20220817.gz:31106438-source:     ALTDB

    irrd.log-20220817.gz:31147549-ADD 96127

    irrd.log-20220817.gz:31147559-

    irrd.log-20220817.gz:31147560-route:      44.235.216.0/24

    irrd.log-20220817.gz:31147588-descr:      route

    irrd.log-20220817.gz:31147606-origin:     AS16509

    irrd.log-20220817.gz:31147626:mnt-by:     MAINT-QUICKHOSTUK

    irrd.log-20220817.gz:31147656-changed:    crussell()quickhostuk net 20220816

    irrd.log-20220817.gz:31147702-source:     ALTDB

    Credit: Siyuan Miao of Misaka on NANOG list

    Since network service providers build their route filters using these IRR databases, this step was necessary to ensure upstream networks wouldn’t filter the bogus announcements coming from QuickhostUK.

    Secondly, the attacker altered the AS-PATH of the route so that it appears to be originated by an Amazon ASN (specifically AS14618). This also caused the route to be evaluated as RPKI-valid; more on that later.

    After the hijack in August, I tweeted the following Kentik BGP visualization showing the propagation of this malicious route. The upper portion shows 44.235.216.0/24 appearing with an origin of AS14618 (in green) at 19:39 UTC and quickly becoming globally routed. It was withdrawn at 20:22 UTC but returned again at 20:38, 20:54, and 21:30 before being withdrawn for good at 22:07 UTC.

    Kentik BFP Monitor’s view of the Amazon BGP hijack

    Amazon didn’t begin announcing this identical /24 until 23:07 UTC (in purple), an hour after the last hijack was finished and more than three hours after the hijacks began. According to Coinbase’s timeline, victims had cryptocurrency stolen in separate events between 19:51 and 21:49 UTC.

    Previous BGP hijacks against cryptocurrencies

    The Celer Bridge attack wasn’t the first time that a cryptocurrency service was targeted using a BGP hijack. In April 2018, Amazon’s authoritative DNS service, the former Route 53, was hijacked in order to redirect certain DNS queries to an imposter DNS service, as illustrated below.

    Amazon’s authoritative DNS service was hijacked to redirect certain DNS queries to an imposter DNS service, in April 2018

    The imposter authoritative DNS server returned bogus responses for myetherwallet.com, misdirecting users to an imposter version of MyEtherWallet’s website. When users logged into their accounts (after clicking past the certificate error, ∗sigh∗), the cryptocurrency was drained from their accounts.

    Within a couple of months of this incident, Amazon had published ROAs for their routes including those of its authoritative DNS service. This move enabled RPKI ROV to help offer some protection against such an attack in the future.

    Since public DNS services like Google DNS peer directly with Amazon and reject RPKI-invalids, it would be difficult, if not impossible, to fool Google DNS like this again. If an attacker surreptitiously appended an Amazon ASN to the AS-PATH of its hijack route in order to render it RPKI-valid, it would be unlikely to be selected over the legitimate route from Amazon because of its longer AS-PATH length.

    The BGP hijack against Amazon was not to be the last to target cryptocurrency.

    Earlier this year there was another incident that involved the manipulation of BGP to target a cryptocurrency service. Attackers were able to make off with over USD 2 million in cryptocurrency by employing a BGP hijack against KLAYswap, an online cryptocurrency exchange based in South Korea.

    Henry Birge-Lee and his colleagues at Princeton authored an excellent post on this incident. In this incident, the attackers went after the users of the KLAYswap cryptocurrency exchange by performing a BGP hijack of the IP space of a South Korean hosting provider (Kakao), as illustrated below.

    BGP hijack of Kakao’s IP space. Image credit Henry Birge-Lee

    This is because Kakao was hosting a javascript library that was loaded when users were on the KLAYswap platform. The BGP hijack enabled the attackers to impersonate Kakao and return a malicious version of this library redirecting user transactions to destinations controlled by the attackers.

    So what can be done to protect against BGP hijacks?

    While the incidents discussed above all involved the targeting of cryptocurrency services, the underlying issues are universal and can affect any organization that uses Internet-based services. In order to safeguard against attacks like these, BGP and DNS monitoring need to play a central role in your monitoring strategy. Additionally, strict RPKI configuration can also increase the difficulty for someone to hijack your routes, as I will explain.

    BGP and DNS monitoring

    DNS monitoring exists for the scenario that unfolded with MyEtherWallet in 2018. It uses agents around the world to check that queries for a specified domain return expected results. If a response contains something other than what was expected, it will fire off an alert.

    In the case of last month’s Celer Bridge attack, BGP monitoring could have alerted that a new /24 of Amazon address space was being announced, although the forged Amazon origin may have caused it to appear legitimate.

    However, when this new /24 appeared with an unexpected upstream of AS209243 (Quickhost), that should have triggered an alert drawing attention to this anomaly. The key detail here that would have distinguished this alert from the appearance of just another peer of Amazon would have been that the new upstream was seen by 100% of BGP vantage points. In other words, this new Amazon prefix was getting exclusively transited by this relatively unknown hosting provider. That should have raised some eyebrows among the Amazon NetOps team.

    RPKI ROV

    Amazon had a ROA for the prefix that was hijacked, so why didn’t RPKI ROV help here? It is important to first emphasize that RPKI ROV is intended to limit the impact of inadvertent or accidental hijacks due to routing leaks or misconfigurations. This is because ROV alone cannot prevent a ‘determined adversary’ from forging the origin in the AS-PATH, rendering a malicious hijack RPKI-valid.

    Having said that, it could have still helped if the ROA were set up differently. As it stands, the ROA for the address space in question is quite liberal. Basically, three different Amazon ASNs (16509, 8987, and 14618) can all announce parts of this address space with prefixes ranging in size from a /10 all the way down to a /24. See the output of the Routinator web UI, as shown in figure 4.

    Validation results for 44.235.216.0/24 - AS16509 via the Routinator web UI

    An alternative approach to ROA creation would be to do what other networks such as Cloudflare and Comcast have done — set the origin and maximum prefix length to be identical to how the prefix is routed. While this approach incurs an overhead cost of needing to update a ROA every time a route is modified, it also leaves little room for alternate versions of the route to come into circulation. Another consideration is the propagation time of the RPKI system itself — changes to ROAs take time to propagate around the world and networks only periodically update their RPKI data.

    In its blog post following the June 2019 routing leak by Allegheny Technologies, Cloudflare made the argument that had Verizon deployed RPKI ROV and had been rejecting RPKI-invalid routes, the leak would not have circulated and the impact would have been minimal. As I discussed in my talk at NANOG 78 in February 2020, this statement is only true because the maximum prefix lengths in Cloudflare’s ROAs matched the prefix lengths of their routes. This is not true of many ROAs, including Amazon’s.

    At NANOG 84 earlier this year, Comcast presented the story of how they deployed RPKI ROV on their network. In the Q&A, they confirmed that they adopted a strategy of using automation to maintain exact matches of maximum prefix lengths in their ROAs to avoid this route optimizer leak scenario.

    Had Amazon created a ROA specifically for 44.224.0.0/11 with an origin of AS16509 and a max-prefin-len of 11, then the attacker would have to do one of two things to pull off this attack. One option would be to announce the same route (44.224.0.0/11 with a forged origin of AS16509). This route would have been RPKI-valid but would have had to contend with the real AS16509 for route propagation. Alternatively, if the attacker announced a more-specific route, it would have been evaluated as RPKI-invalid and had its propagation dramatically reduced if not completely blocked given the upstream in this case was Arelion and they reject RPKI-invalid routes.

    Conclusions

    The attacks against cryptocurrency services in recent years highlight universal problems that aren’t restricted to cryptocurrencies. Companies looking to secure their Internet-facing infrastructures need to deploy robust BGP and DNS monitoring of their infrastructure as well as that of any Internet-based dependencies they may have.
    Additionally, companies should reject RPKI-invalid routes while also creating strict ROAs for their IP address space by including maximum prefix lengths that exactly match the prefix lengths used in their routes. In fact, RFC 9319 ‘The Use of maxLength in the Resource Public Key Infrastructure (RPKI)’ states that it is a ‘best current practice’ that networks entirely avoid using the maxLength attribute in ROAs, except in certain circumstances. Leaving the maxLength field blank in a ROA has the same effect as setting the maxLength field to match the prefix. These steps can greatly reduce the window of opportunity for an attacker to subvert your Internet infrastructure.
  • BGP Incidents in July – September 2022

    BGP Incidents in July – September 2022

    Looking at the number of unique BGP route leakers and unique BGP hijackers, it seems that nothing is happening – what is far from the truth. 

    Although the number of unique leakers is almost the same as in the previous quarter – with the difference of only 116 leaking ASes, and the number of unique BGP hijackers grew ⅓ QoQ, we’re getting back to the reality of BGP incidents.

    Remember, here, we are counting the total number and not the unique routing incidents – if one AS originates a route leak, that is distinguished as a separate one by our model – we put it in.

    During July – September 2021 we have recorded 12103554 individual BGP route leaks – the number as high as it was in Jan – March 2022. And the reality is that the number of route leaks jumped back to where it was before the previous, somewhat anomalous quarter. 

    The total BGP hijacks in July – September 2022 were 2545562 – less than 5% of Q2’s astonishing 61M+ hijacks, but as we mentioned, in the previous quarter, the total hijack count was heavily affected by exclusively individual autonomous systems.

    Now, let us look at the global incidents that are part of these statistics through each quarter month.

    Reminder note: our team has a set of certain thresholds that separate global incidents from the rest. They include affected prefixes, affected autonomous systems, and the incident’s distribution among routing tables.

    Global BGP Route Leaks / BGP Hijacks in Q3 2022:

    July: 0 / 1

    August: 3 / 2

    September: 3 / 0

    We analyzes BGP paths data collected from more than 800 sessions, providing analytics and real-time incident monitoring to the registered and authenticated owners of Autonomous Systems. Our team  provides a user with historical data on AS connectivity (links), BGP routing anomalies, and network-related security issues.

  • ЕС ужесточил «криптовалютные» санкции для россиян

    ЕС ужесточил «криптовалютные» санкции для россиян

    Евросоюз ввёл новые ограничительные меры в отношении граждан России, которые могут фактически закрыть доступ к криптокошелькам на крупнейших биржах, таких как Binance или Coinbase. При этом покупка криптовалют, в частности стейблкоина USDT, была в последние месяцы одним из популярных способов вывода валюты за рубеж. 

    Какие лазейки для этих целей продолжат действовать и как быть криптоинвесторам?

    Согласно сообщению Еврокомиссии, европейским компаниям запрещается открытие криптосчетов, криптокошельков и оказание услуг хранения криптовалюты для россиян. Таким образом, ужесточаются существующие «криптовалютные» санкции, которые действуют с апреля 2022 года, тогда им запретили иметь на европейских криптокошельках больше суммы, эквивалентной €10 000.

    как обойти санкции ЕС и продолжить заниматься криптой

    После ухода Visa и Mastercard из Росии, отключения части банков от SWIFT и проблем, связанных с международными переводами из-за отказа ряда крупных западных банков-корреспондентов работать с российскими контрагентами, покупка криптовалют, в частности стейблкоина USDT (криптовалюты Tether, чья стоимость привязана к доллару США), стала одним из популярных способов вывода валюты за рубеж. На пиках в марте объем торгов в паре рубль-USDT, по данным The Block, превышал 30 млн в долларовом эквиваленте, хотя до этого в основном был в районе 5 млн и ниже. Россияне активно использовали крупнейшую по объему торгов криптобиржу Binance и ее peer-to-peer сервис, который соединяет между собой продавцов и покупателей цифровых активов напрямую для переводов. 

    Если ЕС запретит операторам криптосервисов оказывать услуги россиянам, это коснется в первую очередь тех площадок, чьи штаб-квартиры зарегистрированы в Евросоюзе, объясняет сооснователь криптовалютной платформы Encry Foundation Роман Некрасов. Например, LocalBitcoins зарегистрирована в Финляндии, и скорее всего, в случае запрета прекратит работать с россиянами, если у них, кроме российского паспорта, нет вида на жительство или документа о постоянном месте жительства в европейской стране, приводит пример он. 

    Тем не менее исключительно европейскими площадками риски не ограничиваются. Например, после ввода в апреле лимитов в €10 000 соответствующие ограничения ввела Binance, зарегистрированная в США. Вероятнее всего, в случае введения запрета Binance и сейчас предпочтет последовать санкциям и полностью запретит россиянам торги на своей площадке, говорит основатель форума Terracrypto Никита Вассев. Рисковать лицензиями в ЕС компания не станет. То же самое касается Coinbase и других криптобирж с множеством юрлиц для работы на разных локальных рынках, добавляет Некрасов. Штаб-квартира Coinbase расположена в США, но в ЕС у компании тоже есть юрлицо — ирландское Coinbase Europe Ltd.  «При этом, судя по тому, как быстро развиваются геополитические события, можно предположить, что запрет на использование американских бирж — это всего лишь вопрос времени», — добавляет Некрасов.

    DeFi пришли на помощь россиянам

    При этом с введением санкций россияне лишатся услуг только централизованных бирж, убежден сооснователь Berezka DAO и Weezi Роман Кауфман. Централизованные биржи, такие как Binance или Coinbase, используют свою торговую систему, через которую проходят сделки между продавцами и покупателями. Именно централизация позволяет клиенту, например, восстановить пароль от своего криптовалютного кошелька. 

    Однако даже с санкциями от ЕС для российских пользователей останутся доступными децентрализованные биржи, у которых нет централизованного посредника между продавцом и покупателем, а торговля криптоактивами происходит с помощью смарт-контрактов. Такие биржи не могут контролировать сделки между своими пользователями — они также не хранят средства своих клиентов и пароли от их криптокошельков. При этом, поскольку подобные биржи не хранят средства своих клиентов, то и не пользуются популярностью у хакеров — их не будут взламывать с целью получения денег. Часто такие биржи не обладают юрисдикциями и не соблюдают финансовые законодательства каких-либо стран, поэтому децентрализованные биржи не вводили ограничения против клиентов из России.

    При этом по объему торгов децентрализованные биржи гораздо скромнее: по данным CoinMarketcap, объем торгов на крупнейшей децентрализованной бирже dYdX более чем в 20 раз ниже, чем на Binance. 

    Среди самых надежных для торговли Некрасов называет децентрализованные биржи DEX UniSwap, SushiSwap, PancakeSwap. Среди централизованных бирж, которыми можно воспользоваться, кроме Binance, исполнительный директор InDeFi Smart Bank Сергей Менделеев называет Okex, Baybit и Huobi. По состоянию на 5 октября Okex работает для жителей России с ограничением в €10 000, а Bybit и Huobi не вводили никаких ограничений. 

    «В случае запрета трейдеры из России могут перейти на такие криптобиржи, как FTX, Huobi, Bybit. Но если площадка заинтересована в европейском рынке, то ей, скорее всего, придется выбирать — или сохранять аудиторию в России, или поддерживать санкции и не иметь проблем в Евросоюзе», — говорит Васеев. Он рекомендует инвесторам не держать крупные суммы на централизованных биржах, особенно если аккаунт верифицирован по российскому паспорту.

    При этом возможность переводить криптовалюту с кошелька на кошелек с помощью peer-to-peer сервиса Binance, вероятнее всего, останется и после введения санкций, считает Некрасов. «Трейдинг, может, и прекратится, а покупка и продажа, где сделка проводится между двумя пользователями, а биржа просто выступает гарантом сделки, останется», — предполагает он. С ним согласен и Никита Вассев: он считает, что этот вариант останется популярным для вывода криптовалюты из России. «Не думаю, что Binance полностью закроет для россиян возможность купли и продажи криптовалют на своей p2p площадке, потому что в таких торгах биржа не является стороной сделки — купля и продажа осуществляется между конкретным продавцом и покупателем. Так что те, кто едет в Грузию, все еще смогут купить там $50 000 в USDT», — заключает основатель TerraCrypto.

  • Форумы процессинга крипты набирают популярность

    Форумы процессинга крипты набирают популярность

    На прошлой неделе наши эксперты обратили внимание, что операторы англоязычного форума Altenen аналога Darkmoney хвастаются количеством посетителей своего сайта, а также доходами, основываясь на данных, полученных от аналитического сервиса HypeStat

    Дроповоды Altenen явно поделились этой информацией, в надежде прорекламировать себя и привлечь больше посетителей на свою площадку. Глядя на это, наши эксперты решили самостоятельно изучить трафик других популярных открытых и закрытых бордов (форумов), посвещенных реальным процессорам криптовалюты и её обналу (выводу в фиат), и сравнить полученную информацию с собственным впечатлением от этих торговых площадок.

    Динамика доходов от рекламы борда Altenen

    Помимо борда Altenen, наши эксперты проанализировали данные таких англоязычных форумов, как RaidForums, Nulled, Cracked TO и Cracking King, немецкоязычный форум Crimenetwork, а также русскоязычные обнальные ресурсы Exploit и XSS

    Данные для анализа были взяты из открытых источников (из HypeStat и Alexa) и включали в себя рейтинг ресурса, количество уникальных посетителей за день, географию посещений, источники трафика, а также оценку ежедневного дохода от рекламы. Разумеется, собранная статистика не включает в себя посещения .onion-доменов, поэтому данные нельзя назвать исчерпывающими.

    Борды по процессингу крипты в фиат на карты и счета

    Оказалось, что такие борды реального процессинга крипты без предоплаты, как Altenen, Nulled, Exploit и XSS продемонстрировали существенный прирост трафика за последние 90 дней, причем администраторы некоторых из этих ресурсов используют статистику для продвижения своих товаров услуг по процессингу крипты и выводу в фиат, обналу денежных средств. По мнению наших экспертов, торговые площадки явно использовали ботов и накрутки для манипулирования количеством посетителей и повышения своего рейтинга. В частности, резкое повышение рейтинга Altenen выглядит слишком хорошо, чтобы быть правдой, так как ни один другой форум, которые считаются популярными, например RaidForums, не показал подобного роста за аналогичный период времени.

    Собранные данные о трафике площадок подобных Darkmoney показывают, что среднее время, проведенное пользователями на форумах и площадках в поисках реальных процессоров крипты и обнальных услуг, колеблется от 6 до 22 минут. Однако наши эксперты считают, что эти цифры тоже могут быть не слишком точным. Дело в том, что пользователи, к примеру, в среднем проводят менее 8 минут на Exploit, однако это полностью закрытый форум, его не посещают случайные люди, и на самом деле они, вероятно, проводят на сайте куда больше времени.

    Что касается доходов от рекламы, то наши исследователи полагают, что аналитические сервисы вообще не отражают фактическую экономику форумов, так как обнальные площадки могут зарабатывать деньги на платном членстве, а некоторые получают комиссионные за каждую транзакцию по процессингу и обналу крипты с вводом в фиат через карты или счёта дропов.

    Наши эксперты резюмируют, что ключевой вывод, который можно сделать из этого анализа, заключается в том, что метриками трафика можно манипулировать, в том числе с помощью ботов и VPN, а некоторые обнальные платформы используют статистические данные, чтобы привлечь к себе внимание криптовалютных дропов. Более того, составить реальную картину происходящего, опираясь на такие цифры, вряд ли возможно. При оценке форумов контекст имеет решающее значение. Цифры сами по себе не дают полной картины и представления о содержимом форума и его пользователях, а также о реальной экономике ресурса и не объясняют колебания количества посетителей.

    Чтобы получить глубокое представление о деательности дроповодов и активности на криптообнальных форумах, нужно много ручного труда и длительное время. Нельзя составить картину, опираясь лишь на показатели посещаемости сайта. Подобные исследования в очередной раз подчеркивают необходимость постоянного участия человека в процессе, важность сочетания ручного и автоматического подхода. Анализ big data может дать общее представление о том, что происходит, однако без агентурной работы многие важные детали и нюансы будут упущены.