Connect with us

Multilingua

XLoader/FormBook: Encryption Analysis and Malware Decryption

Condividi questo contenuto

Tempo di lettura: 6 minuti. Xloader is a stealer, the successor of FormBook

Pubblicato

il

Condividi questo contenuto
Tempo di lettura: 6 minuti.

Today ANY.RUN’s malware analysts are happy to discuss the encryption algorithms of XLoader, also known as FormBook. And together we’ll decrypt the stealer’s strings and C2 servers.

Xloader is a stealer, the successor of FormBook. However, apart from the basic functionality, the unusual approaches to encryption and obfuscation of internal structures, code, and strings used in XLoader are also of interest. Let’s take a detailed look at the encryption of strings, functions, and C2 decoys.

IceXLoader ha infettato migliaia di vittime in tutto il mondo

Ecco il malware che eluce i blocchi impostati da Microsoft sulle VBA

DotRunpeX diffonde diverse famiglie di malware tramite annunci pubblicitari

Gookit all’attacco di organizzazioni sanitarie e finanziarie

Encryption in XLoader  

First, we should research 3 main cryptographic algorithms used in XLoader. These are the modified algorithms: RC4, SHA1, and Xloader’s own algorithm based on a virtual machine.

The modified RC4 algorithm

The modified RC4 algorithm is a usual RC4 with additional layers of sequential subtraction before and after the RC4 call. In the code one layer of subtractions looks like this:

       # transform 1
       for i in range(len(encbuf) – 1, 0, -1):
           encbuf[i-1] -= encbuf[i]

       # transform 2
       for i in range(0, len(encbuf) -1):
           encbuf[i] -= encbuf[i+1]

The ciphertext bytes are subtracted from each other in sequence from right to left. And then they go from left to right. In the XLoader code it looks like this:

Function performing RC4 encryption

The modified SHA1 algorithm

The SHA1 modification is a regular SHA1, but every 4 bytes are inverted:

   def reversed_dword_sha1(self, dat2hash):
       sha1Inst = SHA1.new()
       sha1Inst.update(dat2hash)
       hashed_data = sha1Inst.digest()
       result = b””
       for i in range(5):
          result += hashed_data[4*i:4*i+4][::-1]
       return result

Xloader’s own virtual machine algorithm

The last algorithm is a virtual machine that generates one to four bytes of plaintext, depending on the current byte of the ciphertext. Usually, this algorithm is used as an additional encryption layer, which will be discussed later. The entry of the VM decryption routine looks like this:

An example of transformations in a virtual machine’s decryption routine

Decrypting XLoader Strings

Next, let’s investigate how the string encryption works in XLoader. All byte arrays containing encrypted strings or key information are ​​located in special kinds of blobs.

An example of a blob with encrypted data

As you can see in the screenshot above, this blob is a function that returns a pointer to itself, below this function are the bytes you are looking for.

In order to decrypt strings, first a key is generated. The key is generated from 3 parts, to which the above-described functions are applied.

Key generation function to decrypt strings

Here K1_blob, K2_blob, and K3_blob are functions that return data from the blocks described above, and the string length is an argument for them.

The functions VM_Decrypt, RC4_with_sub_Layer and sha1_* are modified algorithms that we discussed earlier.

Schematically, the key generation algorithm can be represented by the following diagram.

Here E and K are the data and the key that is fed to the input of the RC4 function, respectively, and K1, K2, and K3 are the data obtained from the K1_blob, K2_blob, and K3_blob functions.

Scheme of key generation to decrypt strings

The strings themselves are also stored as a blob and are covered by two layers of encryption: 

  • VM_decrypt
  • RC4 that uses the key obtained above.

At the same time, RC4 is not used for the whole blob at once.

After removing the first layer, the encrypted strings themselves are stored in the format:

encrypted string length – encrypted string

Consequently, to decrypt the strings, we need to loop through this structure and consistently decrypt all the strings.

Function for decrypting strings

Below is an example of the encrypted data after stripping the first layer. Length/string pairs for the first 3 encrypted strings are highlighted in red.

The first 3 encrypted strings

The same strings after decryption:

The first 3 lines after decoding

Along with the encrypted strings, C2 decoys are also stored there. They are always located at the end of all decrypted strings, beginning and ending with the f-start and f-end strings.

Decrypting XLoader’s C2 Servers

Next, let’s see how the main C2 encryption works. The main C2 is located elsewhere in the code, so you can get it separately from the C2 decoys.

Code snippet demonstrating C2 decryption.

To decrypt it, as well as to decrypt the strings, 3 keys are used. The C2 decryption scheme is shown below:

  • EC2 is the encrypted C2
  • DC2 is the decrypted C2

The algorithm itself is a 3 times sequential application of the RC4 algorithm with 3 different keys.

C2 decoys’ decryption scheme

Also, in newer versions of XLoader C2 decoys, which usually lie along with all the other strings, turn out to be covered by an additional layer of encryption, and, at first glance, it is completely unclear where exactly the decryption of these strings occurs.

Since XLoader has several entry points, each responsible for different non-intersecting functionality, with many functions turning out to be encrypted.

The C2 decoys are decrypted inside the XLoader injected into Explorer.exe. And in this case, it is passed to netsh.exe, which also contains XLoader via APC injection.

The C2 life cycle in different XLoader modules

In order to understand how a C2 decoy is encrypted, first of all, you need to understand how the functions are encrypted.

It’s actually quite simple. RC4 is used as the encryption algorithm. This time, the key is hardcoded and written right in the code and then xored with the 4-byte gamma.

After that, you should find pointers to the start and end of the function. This is how you do it:  a unique 4-byte value is placed at the beginning and end of each encrypted function. The XLoader looks for these values and gets the desired pointers.

Code snippet demonstrating the decryption of the function

Then the function is decrypted, control is given to it, and it similarly searches for and decrypts the next function. This happens until the function with the main functionality is decrypted and executed. So, functions should be decrypted recursively.

The key to decrypting C2 decoys consists of 2 parts and is collected separately at two different exit points. One exit point gets the 20-byte protected key, and the second gets the 4-byte gamma to decrypt the key.

Example of extracted XLoader malware configuration

Applying the above algorithms we can extract the configuration from Xloader, including C2, C2 decoys,  and strings. For your convenience, we have integrated automatic extraction of the Xloader configuration into ANY.RUN interactive sandbox — just run the sample and get all the IOCs in seconds.

Extracted malware configuration in ANY.RUN

Examples of successfully executed samples:

Example 1

Example 2

Example 3

Sum it up

In this article we discussed the encryption in xLoader stealer. It is based on both add-ons to existing algorithms and self-written algorithms.

The main tricky part of the decryption process is the key generation and the fact that the XLoader functionality is split into modules that can be run in different processes. Because of this, in order to extract strings, we have to decrypt the executable code, among other things.

Fortunately, ANY.RUN is already set up to detect this malware automatically, making the relevant configuration details just a click away.

Appendix

Analyzed files

Sample with new C2 decoys encryption

TitleDescription
NameMT10320221808-004. pdf.exe
MD5b7127b3281dbd5f1ae76ea500db1ce6a
SHA16e7b8bdc554fe91eac7eef5b299158e6b2287c40
SHA256726fd095c55cdab5860f8252050ebd2f3c3d8eace480f8422e52b3d4773b0d1c

Sample without C2 decoys encryption

TitleDescription
NameTransfer slip.exe
MD51b5393505847dcd181ebbc23def363ca
SHA1830edb007222442aa5c0883b5a2368f8da32acd1
SHA25627b2b539c061e496c1baa6ff071e6ce1042ae4d77d398fd954ae1a62f9ad3885

Iscriviti alla newsletter settimanale di Matrice Digitale

* inserimento obbligatorio

Multilingua

Quanto costa a Samsung produrre il Galaxy S23 Ultra?

Condividi questo contenuto

Tempo di lettura: 2 minuti. Nonostante i profitti di Samsung siano in calo, l’azienda continua a fare affari d’oro con i suoi dispositivi di punta.

Pubblicato

il

Quanto costa a Samsung produrre il Galaxy S23 Ultra?
Condividi questo contenuto
Tempo di lettura: 2 minuti.

Samsung ha appena registrato i suoi profitti più bassi degli ultimi 14 anni a causa di una domanda in calo per i prodotti di memoria. La divisione Memory di Samsung, che rientra nell’unità dei semiconduttori, è stata il principale motore di entrate per il colosso sudcoreano negli ultimi dieci anni. Tuttavia, nell’ultimo trimestre, questa divisione ha registrato una perdita di 3,4 miliardi di dollari a causa di un eccesso di inventario non venduto e una domanda in calo, erodendo notevolmente i margini di profitto di Samsung.

I Risultati del Galaxy S23 Ultra Sostengono Samsung

Mentre Samsung prevede una ripresa per il suo business di memorie nella seconda metà dell’anno, nel frattempo si affida alla sua divisione telefoni per generare i profitti tanto necessari. Le notizie da questo fronte sono positive, come suggerisce un’analisi recente dei costi di produzione del Galaxy S23 Ultra effettuata da Counterpoint Research: Samsung sta realizzando un discreto profitto con i suoi dispositivi di punta.

Il Costo di Produzione del Galaxy S23 Ultra

Secondo Counterpoint, il costo di produzione del Galaxy S23 Ultra per Samsung è di 469 dollari, mentre il telefono viene venduto al dettaglio per 1.199 dollari. In pratica, il costo dei materiali rappresenta poco meno del 40% del valore al dettaglio del Galaxy S23 Ultra, quindi, nonostante Samsung offra forti incentivi ai clienti per cambiare dispositivo, riesce a ottenere un bel profitto con questo modello.

La Spesa di Produzione si Concentra su Qualcomm e sulle Unità di Business Samsung

Un aspetto interessante dell’analisi di Counterpoint è che Qualcomm rappresenta il 34% (o 159 dollari) del costo totale di produzione del S23 Ultra. Questo include il costo del Snapdragon 8 Gen 2 per Galaxy, il sensore di impronte digitali ultrasonico, Wi-Fi, Bluetooth, GPS, e le antenne cellulari Sub-6 5G, i codec audio AptX, e vari IC di gestione dell’energia.

Il secondo beneficiario più grande è rappresentato da altre unità di business Samsung. Queste producono infatti display, moduli di memoria e di archiviazione, e hardware per fotocamere. Il Galaxy S23 Ultra utilizza un pannello AMOLED 120Hz da 6,8 pollici prodotto da Samsung Display, moduli di memoria da 256GB/512GB/1TB e un sensore per la fotocamera da 200MP prodotto da Samsung Semiconductor.

Prosegui la lettura

Multilingua

Attacco al Governo colombiano: SiegedSec rivendica la fuga di dati

Condividi questo contenuto

Tempo di lettura: < 1 minuto. Governo Colombiano nel Mirino di una Possibile Offensiva Hacktivist

Pubblicato

il

Condividi questo contenuto
Tempo di lettura: < 1 minuto.

Il governo colombiano sembra essere stato colpito da un gruppo di sospetti hacktivist chiamato SiegedSec. I siti web governativi del paese sono sotto attacco e l’analista di intelligence sulle minacce riporta una fuga di dati considerevole, incluso 6GB di email, documenti riservati e carte d’identità.

SiegedSec: identità e le motivazioni di un misterioso gruppo hacktivisti

SiegedSec sembra essere un gruppo hacktivist emerso durante l’invasione russa dell’Ucraina a febbraio. Tuttavia, se sia interamente partigiano nella sua natura rimane un mistero. Non sembra avere particolari preferenze per le industrie o le posizioni delle sue vittime e non sembra mosso da motivazioni economiche. Non si pensa, infatti, che abbia mai avanzato richieste di riscatto alle sue vittime.

Il terzo e “Ultimo” attacco a opera di SiegedSec

SiegedSec rivendica che questo sia il suo “terzo e ultimo attacco all’Operazione Colombia”. Queste parole sono state riportate da FalconFeedsio, che ha postato le notifiche su Twitter. Durante questo attacco, SiegedSec afferma di aver rilasciato i database dei siti web del governo e di aver effettuato attacchi ai controllori dell’approvvigionamento di energia e ai sistemi di rifornimento.

Conseguenze dell’attacco e le incognite future

Nonostante l’attacco, i portali governativi sembrano funzionare normalmente. Tuttavia, le possibili conseguenze di lungo termine rimangono incerte. SiegedSec, nonostante abbia annunciato la fine dell’Operazione Colombia, sembra intenzionato a proseguire le sue attività di hacking. “Speriamo che sia voi che il governo colombiano abbiate apprezzato la nostra serie di attacchi. Sebbene ci allontaneremo da questa operazione, continueremo a supportare org0n [sic] quando saremo in grado. Ora torneremo al nostro regolare hacking malevolo”, recita il messaggio finale del gruppo, come riportato da FalconFeedsio. Chi o cosa sia “org0n” rimane, al momento, un mistero.

Prosegui la lettura

Multilingua

TikTok sperimenta Tako, nuovo Chatbot AI: rivoluzionerà la ricerca?

Condividi questo contenuto

Tempo di lettura: 2 minuti. TikTok è al lavoro su un chatbot AI denominato Tako, destinato a cambiare radicalmente la ricerca e la navigazione all’interno dell’app

Pubblicato

il

Condividi questo contenuto
Tempo di lettura: 2 minuti.

TikTok sta testando un chatbot AI chiamato Tako, in grado di consigliare video in base alle richieste degli utenti, secondo quanto rivelato da screenshot condivisi con The Verge.

Tako: il futuro della navigazione su TikTok?

Se TikTok decidesse di implementare ampiamente Tako, il chatbot potrebbe “cambiare radicalmente la ricerca e la navigazione” nell’app, secondo Daniel Buchuk di Watchful Technologies, un’azienda specializzata nel rilevamento di queste modifiche future nelle app per le aziende della Fortune 500.

Funzionalità e interazione con l’utente: come funziona Tako?

Nei screenshot del test condivisi con The Verge, Tako si colloca al di sopra dell’icona del profilo TikTok, a destra di un video. Toccando l’icona si apre una schermata di chat, dove il bot sembra in grado di rispondere a un’ampia gamma di query. Al momento non è chiaro quale modello AI TikTok stia utilizzando per alimentare Tako.

Sperimentazione e distribuzione: quando arriverà Tako?

Tako proporrà suggerimenti per aiutare l’utente a iniziare una conversazione con il bot. Secondo Buchuk, “Se sto guardando video sul cibo e chiedo una ricetta, otterrò video di TikTok correlati alla ricetta, o se chiedo informazioni su buone mostre d’arte a Parigi, mi mostrerà video insieme a una lista di suggerimenti nella risposta.” Un portavoce di TikTok, Zachary Kizer, ha definito il chatbot “un esperimento limitato” e ha dichiarato che al momento non è disponibile per gli utenti in Nord America o Europa. Secondo un tweet dell’azienda, il test è attualmente in corso solo nelle Filippine.

TikTok, Tako, chatbot AI, ricerca, navigazione, sperimentazione

Prosegui la lettura

Facebook

CYBERWARFARE

Notizie24 ore fa

Attacchi informatici mirati al Medio Oriente dal 2020: gli obiettivi non rilevati

Tempo di lettura: 2 minuti. Una serie di attacchi informatici mirati al Medio Oriente, in particolare all'Arabia Saudita, sono stati...

Notizie3 giorni fa

Kimsuky – Italia | Campagna in corso utilizzando il toolkit di ricognizione su misura

Tempo di lettura: 7 minuti. Traduzione della relazione di Sentinel One, sull'attacco dei nord coreani che potrebbe coinvolgere anche l'Italia.

Notizie5 giorni fa

Spyware Android, Predator e Alien: una minaccia silenziosa più grande del previsto

Tempo di lettura: 2 minuti. Nuove scoperte evidenziano che lo spyware Android Predator, insieme al suo payload Alien, ha capacità...

Inchieste6 giorni fa

APT33, hacker iraniani che mettono a rischio la sicurezza globale

Tempo di lettura: 5 minuti. Le attività del gruppo di hacker noto come APT33, connesso allo stato iraniano, stanno diventando...

cisa nsa cisa nsa
Notizie6 giorni fa

CISA e partner rilasciano avviso contrastare attacchi sponsorizzati dallo Stato cinese

Tempo di lettura: < 1 minuto. Gli attori della minaccia sponsorizzati dallo Stato cinese stanno utilizzando tecniche avanzate per evadere...

Notizie7 giorni fa

APT Cinese colpisce importanti basi militari Statunitensi a Guam

Tempo di lettura: 2 minuti. Hacker cinesi, usando un malware "invisibile", hanno colpito l'infrastruttura critica delle basi militari statunitensi a...

Notizie1 settimana fa

GoldenJackal: nuovo APT che prende di mira governi di Medio Oriente e Sud Asia

Tempo di lettura: 2 minuti. Governi e entità diplomatiche del Medio Oriente e del Sud Asia sono l'obiettivo di un...

Notizie1 settimana fa

Attacchi informatici colpiscono enti statali dell’Ucraina in un’operazione di spionaggio

Tempo di lettura: 2 minuti. Il Computer Emergency Response Team dell'Ucraina (CERT-UA) ha lanciato l'allarme riguardo a una serie di...

lazarus lazarus
Notizie1 settimana fa

Lazarus attacca i Server Microsoft IIS per diffondere malware di spionaggio

Tempo di lettura: 2 minuti. Il noto APT Lazarus Group mira alle versioni vulnerabili dei server Microsoft Internet Information Services...

Multilingua1 settimana fa

Kimsuky torna all’attacco con un sofisticato malware di ricognizione

Tempo di lettura: 2 minuti. APT nordcoreano noto come Kimsuky colpisce ancora con il suo malware personalizzato, RandomQuery, parte di...

Truffe recenti

"Re dell'inganno telefonico" condannato a 13 anni per il servizio "iSpoof" "Re dell'inganno telefonico" condannato a 13 anni per il servizio "iSpoof"
Tech1 settimana fa

“Re dell’inganno telefonico” condannato a 13 anni per il servizio “iSpoof”

Tempo di lettura: 2 minuti. Il colosso delle truffe telefoniche, Tejay Fletcher, è stato condannato a 13 anni di carcere...

Inchieste3 settimane fa

Truffa Tandem – Kadena. Altri 30.000 euro incassati dai criminali senza pietà dei problemi delle vittime

Tempo di lettura: 3 minuti. Continuano le segnalazioni alla nostra redazione. Ecco i "volti" ed i numeri di telefono dei...

Inchieste1 mese fa

Le ombre dietro Vinted: truffe, blocco di account e mancanza di assistenza

Tempo di lettura: 2 minuti. Una realtà ben diversa dalla pubblicità in TV

Notizie2 mesi fa

Un anno di carcere per l’hacker di Silk Road responsabile del furto di $3,4 miliardi in Bitcoin

Tempo di lettura: < 1 minuto. James Zhong rubò 51.680 Bitcoin nel 2012, sfruttando una vulnerabilità del sistema

Truffe online2 mesi fa

Cos’è il blocco del credito e come può proteggere la tua identità e le tue finanze?

Tempo di lettura: < 1 minuto. Scopri come il blocco del credito può aiutare a prevenire furti d'identità e frodi...

Inchieste2 mesi fa

Fake Kadena, women scam continues on Tandem app. Watch out for these profiles

Tempo di lettura: 4 minuti. Three Italians scammed by a self-styled "Londoner" on a bogus trading platform that takes its...

Inchieste2 mesi fa

Falso Kadena, continua la truffa per donne su app Tandem. Attenti a questi profili

Tempo di lettura: 4 minuti. Tre italiane truffate da un sedicente "londinese" su una piattaforma di trading fasulla che trae...

Tech2 mesi fa

Proprietario di Euromediashop condannato a 4 anni per truffa su PS5 e prodotti tech

Tempo di lettura: < 1 minuto. Il titolare del sito che ha ingannato numerosi clienti in cerca di PS5 e...

Notizie2 mesi fa

Truffa “Phishing Scam 3.0” colpisce utenti PayPal: ecco come proteggere i propri conti

Tempo di lettura: < 1 minuto. Una nuova ondata di truffe online minaccia la sicurezza dei conti PayPal, mettendo a...

Truffe online2 mesi fa

Truffa “wangiri”: donna perde tutto il credito telefonico richiamando numero misterioso

Tempo di lettura: < 1 minuto. La truffa dello squillo senza risposta continua a mietere vittime tra gli ignari utenti...

Tendenza