Passados alguns dias depois de anunciarmos que a extensão do Chrome Archive Poster consistia numa peça de malware com o objetivo de usar os recursos dos utilizadores para fazer mining da moeda criptográfica Monero, surge novamente uma notícia sobre uma botnet a minar recursos também ela para a Monero, mas agora sobre o protocolo Secure Shell (SSH).
Esta pesquisa foi levada a cabo por researchers da F5, e foi batizada de PyCryptoMiner, por ser concebida sobre a linguagem de programação Python. A particularidade desta botnet é que usa o Pastebin.com como fonte de dados quando o C&C server se encontra indisponível.
Ela é definida por algumas propriedades:
- É baseada em Pyhon o que a torna de difícil deteção.
- Usa o Pastebin.com como C&C server quando o servidor original se encontra indisponível.
- Esta botnet está a minar a criptomoeda Monero, um moeda digital anónima e muito utilizada por cibercriminosos. Até ao final de dezembro esta botnet minou cerca de $46.000 Moneros.
- A nova funcionalidade do scanner, que identificava servidores JBoss vulneráveis, foi introduzida em meados de dezembro explorando o CVE-2017-12149.
A F5 refere ainda que este tipo de incidentes tem sido cada vez mais comum nos últimos anos derivado ao crescente uso da IoT, um vetor de ataque maligno em 2017, e uma das problemáticas para 2018!
Targeting online Linux systems to construct botnets is a very common attack vector in the wild, especially in the last couple of years with the rise of IoT devices.
Este malware dissemina-se através de brute-force, i.e., tentando adivinhar o acesso a máquinas linux via SSH. Quando o match é conseguido, o bot implementa um simples script em Python ofuscado em base 64, e a partir desse momento a máquina infetada torna-se um nó da botnet.
O segundo grande passo do processo é a criação de um job no cron da máquina para que o nó ganhe “consistência”.
Failover C&C
Este malware foi desenhado de forma bastante detalhada. Repare-se que, a maioria dos malwares codificam o endereço do C&C server no próprio nó (bot), e quando o C&C é identificado e removido os bots não conseguem comunicar (efetuar tarefas e receber ordens). Para resolver esse problema de disponibilidade o hacker usa o Pastebin para publicar um endereço do C&C alternativo.
Varrimento da vítima e tarefas a executar enviadas pelo C&C Server
O bot, quando se dissemina e instalá-la no novo nó, valida primeiramente se à máquina já foi infetada no passado, e recolhe informações sobre ela, incluindo:
- Host / DNS name
- O nome do sistema operativo e a sua infraestrutura
- O número de CPUs (ou virtual CPUs)
- CPU usage
Depois do varrimento, o bot envia a informação ao C&C server, e este responde-lhe com as seguintes tarefas:
- “cmd” — um comando arbitráriio a ser executado num processo isolado.
- “client_version” — se a versão do bot for inferior à sua versão atual, o bot é parado, e o processo via cron encarrega-se de atualizá-lo.
- “task_hash” — é o identificador da tarefa e é dessa maneira que o bot comunica com o C&C.
- “conn_cycler” — é intervalo de tempo para encontrar o C&C, provavelmente para equilibrar as cargas da infraestrutura C&C à medida que a botnet cresce (valor por padrão é de 15 segundos).
O PyCryptoMiner usa dois endereços da pool do Monero (94 e 64), com um valor de cerca de $60.000. No entanto, não é possível identificar os lucros totais da botnet.
De realçar ainda que, a análise da página do Pastebin utilizada como alternativa ao C&C revelou que a botnet pode estar ativa desde agosto de 2017, e que o conteúdo foi visto 177.987 vezes no momento da investigação. Não é possível ainda determinar o tamanho geral da botnet uma vez que cada bot pode periodicamente visitar a página quando o servidor C&C está desativado (ou com uma alta taxa de bandwidth).
Como combater este tipo de ataques?
Não há uma solução efetiva para resolver este tipo de investidas maliciosas, mas existe um conjunto de regras que podem ser seguidas e que podem mitigar o aparecimento deste tipo de pragas.
Algumas delas são aquelas boas práticas que os administradores de sistemas já conhecem:
- Uma boa divisão entre redes públicas e privadas (VPCs e VLANs).
- Uso de bastion hosts.
- Mecanismo de white-list.
- Uso de firewall nos portos das máquinas.
- Palavras-passe longas e fortes.
- Desabilitar o acesso via utilizador root no SSH.
- Definir o número máximo de tentativas de login falhadas.
- Uso de protocolos de criptografia.
- Uma boa distribuição de permissões por utilizador e serviços.
- etc.
Também a monitorização é um elemento aqui importante, e valerá apena lembrar tem um papel importante não só na monitorização como também na notificação de eventuais problemas com a infraestrutura sobre a qual opera.
Curiosidade Final
O botmaster usou o apelido “WHATHAPPEN”, que está associado a mais de 36.000 domínios e 235 endereços de e-mail. O hacker esteve envolvido em fraudes, apostas e serviços para adultos desde 2012.
Referências
[1] https://f5.com/labs/articles/threat-intelligence/malware/new-python-based-crypto-miner-botnet-flying-under-the-radar
English Version – Crypto-jacking again identified in Monero cryptocurrency
In the last days was announced that the extension of the Chrome Archive Poster consisted of a piece of malware with the purpose of using the resources of users to mine the Monero cryptographic currency. News about Monero were again revealed, a new malicious miner that works over Secure Shell (SSH) protocol.
This research was carried out by F5 researchers and was called PyCryptoMiner because it was designed on the Python programming language. The particularity of this botnet is that it uses Pastebin.com as source pool when the C&C server is unavailable.
It is then defined by the following properties:
- Python based, which makes it difficult to detect.
- Uses Pastebin.com as C&C server when the original server is unavailable.
- This botnet is mining the cryptocurrency Monero, an anonymous digital currency widely used by cybercriminals. Until the last days of December, this botnet had mined about $ 46,000 Moneros.
- The new scanner functionality, which identified vulnerable JBoss servers, was introduced in mid-December exploring CVE-2017-12149.
F5 also points out that this type of incident has been increasingly common in recent years due to the growing use of IoT, a malign attack vector in 2017, and one of the problems for 2018!
Targeting online Linux systems to construct botnets is a very common attack vector in the wild, especially in the last couple of years with the rise of IoT devices.
This malware spreads through brute-force, i.e., trying to guess access to Linux machines via SSH. When the match is successful, the bot implements a simple 64-base obfuscated Python script, and from there the infected machine becomes an active botnet node.
The second important step in the process is the creation of a cron job on the infected machine. In this way, the node gains “consistency”.
Failover C&C
This malware was designed in a very detailed way. Note that in most malware code the C&C server address only persists on the bot, and when C&C is identified and removed the bots cannot communicate with each other (perform tasks and receive orders). To solve this availability problem, the hacker uses Pastebin platform to publish an alternative C&C address.
Scanning of the victim and tasks to execute sent by C&C Server
The bot, when it spreads and installs on the new node, validates firstly whether the machine has already been infected in the past, and gathers information about it, including:
- Host / DNS name
- OS name and infrastructure
- CPUs (or virtual CPUs)
- CPU usage
After the scan, the bot sends the information to the C&C server, and it, responds with the following tasks:
- “Cmd” — an arbitrary command to be executed in an isolated process.
- “Client_version” – If bot version is lower than its current version, the bot is stopped, and the process via cron updates it.
- “Task_hash” – represents the task identifier and this is how the bot communicates with C&C.
- “Conn_cycler” – it’s time interval to find C&C, probably to balance C&C infrastructure loads — the growing of the botnet (default value is 15 seconds).
PyCryptoMiner uses two Monero pool addresses (94 and 64), with a value of about $ 60,000. However, it is not possible to identify the total profits of the botnet.
Notice that the analysis of the Pastebin page views, used as an alternative to C&C, revealed that the botnet may be active since August 2017 and that the content was viewed 177,987 times at the time of the investigation. It is not yet possible to determine the overall botnet size since each bot can periodically visit the page when the C&C server is down (or with a high bandwidth rate).
How to combat this wild attacks?
There is no effective solution to solve this type of malicious attacks, but there is a set of rules that can be followed and that can help to mitigate this pest.
Some of them are those good practices that system administrators already know:
- Well-division between public and private networks (VPCs and VLANs).
- Use bastion hosts.
- White-list and blacklist mechanism.
- Use of firewalls in order to filter the machine ports.
- Use of long and strong passwords.
- Disable root user access in SSH server.
- Set the maximum number of failed login attempts.
- Use of encryption protocols.
- A good distribution of permissions per user and services.
- etc.
Monitoring is also an important element here, and it is worth remembering that it has an important role, not only in the monitoring, but also in the reporting of potential problems with the infrastructure where it operates.
Final note
The botmaster used the nickname “WHATHAPPEN”, which is associated with more than 36,000 domains and 235 e-mail addresses. The hacker has been involved in frauds, bets and adult services since 2012.
References
[1] https://f5.com/labs/articles/threat-intelligence/malware/new-python-based-crypto-miner-botnet-flying-under-the-radar
5 Replies to “Crypto-jacking again identified in Monero cryptocurrency”