Критическая уязвимость позволяет перехватывать весь сетевой трафик пользователей Windows

Исследователи из ИБ-подразделения компании Tencent под названием Xuanwu Lab обнаружили серьезную ошибку в реализации протокола NetBIOS, использующейся в Windows. Критическая уязвимость получила название BadTunnel — она позволяет злоумышленникам полностью контролировать сетевой трафик жертвы.
В чем проблема
BadTunnel позволяет злоумышленникам контролировать не только HTTP и HTTPS-запросы, но и всю сетевую активность операционной системы. Например, вмешиваться в загрузку системных обновлений и процесс получения списков сертификатов. Уязвимы все версии ОС Windows.
По словам обнаружившего уязвимость исследователя Яна Ю (Yang Yu), перенаправление трафика жертвы может осуществляться с помощью поддельного WPAD-файла (Web Proxy Auto Discovery) или ISATAP-сервера.
Разбор возможной атаки
Эксперты Positive Technologies описали возможную атаку с применением уязвимости BadTunnel. Для ее осуществления необходимо убедить жертву открыть хотя бы один UNC или URI путь — это может быть адрес вредоносного сайта, адрес папки или документа. В этом случае будет использоваться NetBIOS over TCP/IP, а не стандартные сокеты.
Путь должен содержать в себе ip-адрес сервера атакующего, например:
При обработке этого адреса первоначально будут отправлены запросы на порты 139 (NetBIOS Session) или 445 (Microsoft-DS Active Directory, Windows shares). Если эти порты будут закрыты, то жертва отправит NetBIOS Name Service (NBNS) NBSTAT сообщение на 137 порт, тем самым открывая UDP-тоннель и позволяя злоумышленнику слать запросы прямиком жертве, минуя NAT и Firewall.
Если компьютер жертвы имеет стандартную конфигурацию WPAD, то время от времени он посылает широковещательные запросы в поисках узла с именем WPAD. А так как злоумышленник имеет установленный тоннель до компьютера жертвы, ему достаточно генерировать множество поддельных ответов на запрос имени WPAD, в котором был бы указан адрес сервера, на котором злоумышленник держит настройки прокси сервера.
Через некоторое время после того, как уязвимый компьютер примет фиктивный ответ на WPAD запрос — он начнёт искать настройки прокси по адресу WPAD. После их нахождения происходит подключение и злоумышленник получает полный контроль над трафиком жертвы.
Почему это возможно
Эксперты Positive Technologies так объясняют возможность проведения описанной атаки:
- Поле Transaction ID в NBNS-запросах не рандомизируется, а инкрементируется, поэтому атакующий может его подобрать.
- NBSTAT и NB-запросы инкрементируются вместе (один счётчик).
- NBSTAT-сообщения по умолчанию могут уходить во внешнюю сеть.
- Broadcast-запросы могут получать ответы из внешней сети.
- NBNS использует исключительно 137 порт и UDP (и на клиенте, и на сервере), который не поддерживает сессий и состояний.
Как защититься
Использование таких средств, как межсетевые экраны или NAT не может предотвратить атаки с применением уязвимости BadTunnel. По словам Яна Ю, причина этого кроется в том, что протокол UDP не устанавливает соединения, а используется для создания туннеля.
Microsoft опубликовала бюллетени безопасности MS16-063 и MS16-077, устраняющие ошибку в последних версиях Windows.
Суть этих обновлений заключается в том, что теперь периодическое определение имени WPAD выключено по умолчанию, а NBSTAT запросы из домашней сети также по умолчанию заблокированы. Эти изменения регулируются ключами реестра и делают невозможным установление UDP тоннеля для проведения атаки с использованием BadTunnel.
Однако уязвимость сохранилась в устаревших и ныне не поддерживаемых версиях ОС. В их числе Windows XP и Windows Server 2003. Пользователям этих систем для того, чтобы обезопасить себя, необходимо заблокировать порт UDP 137.
По словам Яна Ю, это не первая уязвимость, приводящая к возможности атак перехвата WPAD. Подобные случаи фиксировались в 1999, 2007, и 2012 году, когда произошел всплески активности червя Flame.
Существующие Proof-of-Concept скрипты не учитывают информацию об Transaction ID в NBSTAT запросе и основываются на огромном потоке поддельных ответов на запрос со всеми возможными значениями поля Transaction ID от 0 до 65535. Однако для успешного проведения атаки достаточно минимального количества поддельных пакетов.
Экспертами Positive Technologies был разработан ряд сигнатур для IDS Suricata, позволяющих обнаружить стадии подмены NetBIOS имён и установления UDP тоннеля, блокирующие попытки подмены адреса WPAD и ISATAP и сигнализирующие о возможной попытке атаки. Они доступны в официальном Twitter и github-аккаунте.
Порт 5228 для чего используется
First time here? Check out the FAQ!
![]()
Wireshark shows TCP port 5228 as HP Virtual Room (hpvroom). This is the well-known port for 5228. By running netstat -b at the same time Wireshark logs the capture as hpvroom netstat shows that chrome.exe trying to connect to the destination port 5228. Is there another dissector that would long this as chrome? Is there other data on this in the Wireshark forum? I have some information that this could be XMPP or GCM connection attempts also. I have management freaking out over port 5228 attempts without knowing what application initiated the conversation. They don’t believe it is an HP Virtual Room conversation or an Android conversation since our workstations are Windows 7 Pro systems exclusively. Any information or pointing me to a resource would be appreciated.
2 Answers
The answer was one simple search away: https://www.speedguide.net/port.php?port=5228, and here. It states:
PS: If management is ‘freaking out’ over a port access it should educate itself on modern day networking, IMHO.
Comments
VP-level an above make decisions on magazine articles and Sales Engineers (spin doctors). 🙂 Presentation is everything (even if it isn’t accurate).;-)
https://developers.google.com/web/ilt.
Chrome currently uses Firebase Cloud Messaging (FCM) as its push service. FCM recently adopted the Web Push protocol. FCM is the successor to Google Cloud Messaging (GCM) and supports the same functionality and more.
https://firebase.google.com/docs/clou.
If your organization has a firewall to restrict traffic to or from the Internet, you need to configure it to allow mobile devices to connect with FCM in order for devices on your network to receive messages. FCM typically uses port 5228, but it sometimes uses 5229 and 5230.
The traffic is probably encrypted so not what you will get if setting decode to TLS for port 5228
You can map the port number to «google» by setting up a personal «services» files: https://www.wireshark.org/docs/man-pa.
Put your custom «services» file in the folder pointed to by Help->About->Folders: Personal Configuration My services file for testing:
Port 5228 Details
Notes:
Port numbers in computer networking represent communication endpoints. Ports are unsigned 16-bit integers (0-65535) that identify a specific process, or network service. IANA is responsible for internet protocol resources, including the registration of commonly used port numbers for well-known internet services.
Well Known Ports: 0 through 1023.
Registered Ports: 1024 through 49151.
Dynamic/Private : 49152 through 65535.
TCP ports use the Transmission Control Protocol, the most commonly used protocol on the Internet and any TCP/IP network. TCP enables two hosts to establish a connection and exchange streams of data. TCP guarantees delivery of data and that packets will be delivered in the same order in which they were sent. Guaranteed communication/delivery is the key difference between TCP and UDP.
UDP ports use the Datagram Protocol. Like TCP, UDP is used in combination with IP (the Internet Protocol) and facilitates the transmission of datagrams from one computer to applications on another computer, but unlike TCP, UDP is connectionless and does not guarantee reliable communication; it’s up to the application that received the message to process any errors and verify correct delivery. UDP is often used with time-sensitive applications, such as audio/video streaming and realtime gaming, where dropping some packets is preferable to waiting for delayed data.
When troubleshooting unknown open ports, it is useful to find exactly what services/processes are listening to them. This can be accomplished in both Windows command prompt and Linux variants using the «netstat -aon» command. We also recommend runnig multiple anti-virus/anti-malware scans to rule out the possibility of active malicious software. For more detailed and personalized help please use our forums.
I found today 14 January 2015 that Chrome Version 39.0.2171.99 m use port TCP 5228 to sync user setting.
There is a new feature in Chrome. In the top right corner, at the left of the _, the Square and the X, there is way to connect your chrome browser to a gmail account. If a user is connected with that functionality, I can see in my firewall a connection with TCP 5228.
This functionality sync favorite, history, password. with all the browser the user use.
If you see a small picture that illustrates an head and shoulder, no user is connected or synching is data. There will be no use of TCP 5228
If you see the name of someone next to the _ in the right top corner, a user is connected and you will see usage of TCP 5228 when Chrome is first use.
Hope this explication will help someone and save you the time it took me to find this!!