r/LinuxMalware • • Sep 10 '18

About my presentation of: "Unpacking the non-unpackable" (an ELF new packer) in R2CON2018

21 Upvotes

NEW: The video of this talk has just been released in [pancake's youtube] (https://www.youtube.com/watch?v=BLfJAAJFVyQ). For the better quality/HD video you can see it in here.

It was a great pleasure to attend R2CON2018, a congress of reverse engineering UNIX-like binary analysis tool radare2 that I use a lot ; The CON is super awesome, I met super cool old+new friends too who are using radare2, also I met many young bright students who helps in radare2dev, and basically it was a very happy moment in the r2land ; I attended all of the slots of schedule except R2CTF and R2War, and I felt that time was not on my side. I was supposed to be in R2CON2016 which was my flight was cancelled due to typhoon, and in this year they cancelled my flight again for another typhoon.. but I am more determined to attend, so I re-routed my flight across Europe to make it to Barcelona.

I made a reverse engineering presentation about a new Linux packer, I called my slide as Unpacking the non-unpackable or in short: N.U.P. , that contains of three parts, which are:

  1. Appetizer: Practical ELF header basic knowledge for recognizing and fixing manipulation of VanillaUPX

  2. Some Soup: Adding knowledge on other ELF packers & introducing some recent-yet-interesting ones

  3. Main course: How I cracked the unknown new ELF packer that is difficult to statically dissect ; this part is explaining the characteristic of the packer, how it is difficult to dissect, the method to crack and purpose of some binaries that use the packer.

Many asked why I picked a silly name as the title. A packed binary, which are produced by a "packing process" (compressed in certain algorithm either with security lock or not), can be restored to its original state by what we all in RE call it in a term of "Unpacking". In the other words: we can "unpack" the binary that is "unpackable". In the case that if a binary, after under efforts of "unpacking", can not be "unpacked", the applicable term for this situation is: "Non-unpackable binaries", or if you like. "Un-unpackable binaries", yet I prefer the first one since the "Un-un" sounds so funny. The ELF binary presented in the "main course" of this presentation can not be "un-packed" in common/usual ways(statically nor emulated), yet it can be "unpacked" under a certain condition only, why I named the presentation as "Unpacking the Non-unpackable".

The presentation file is available to download from r2con repository , or you can see it online from your OSX/PC or from your mobile/tablet too, also the behind the scene note can be read in here

This new packer has been spotted quite a lot in the internet, and it is important to raise awareness for this one due to the usage of the packer are all only spotted in malicious ELF binaries. I don't find any analysis available for this packer, and it is the first analysis ever published about it, and I dedicated the announce of this packer to R2CON, the radare2 community.

The design of the NUP custom packer looks was inspired by UPX in several logics, but works in different ways, this may confuse reversers that may see it as ELF plain file or may think it as just another Vanilla UPX (I was think a lot that way too). This is why I was thinking it would be better to bring the flow of presentation from basic concept of ELF headers to UPX then introducing several other packers before we jump into the NUP. Anyhow, the material contains of nice research, I hope you would find it useful. PS: Use N.U.P. hash in video (corrected) ..not the slide's one, and you must fix its header beforehand, see the how-to in first part of the talk.

Screenshot: https://i.imgur.com/DxGqPsc.png | https://i.imgur.com/pKVXuAS.png

EDIT: additional link, grammar, format, video link, HD video link, additional info on N.U.P.

from @unixfreaxjp / malwaremustdie.org / r2jp


r/LinuxMalware • • Dec 16 '20

About shellcode basics and analysis them in radare2 (online tutorial w/Video, Slides & Q/A)

Thumbnail
twitter.com
10 Upvotes

r/LinuxMalware • • Mar 11 '20

(memo) RHOMBUS an ELF bot installer/dropper

9 Upvotes

A newly seen ELF IoT bot's Dropper/Installer, I firstly handling these hashes for intel 64bit & ARM 32bit, along with other architectures,

It's spotted under file naming of RHOMBUS.{arch} :

b982276458a85cd3dd7c8aa6cb4bbb2d4885b385053f92395a99abbfb0e43784
83e4fb6e5b042c15c035f399d286690f0382c01b43b84898564315951bb1c375

Several explanation:

Basically this is an ELF malware installer (and dropper), it drops another ELF as payload & set cron as "autostart" for it. The installed payload is a bot client (embedded in the dropper). It seeks the /tmp directory path, extracted embedded binary data and creates file "/tmp/fileXXXXXX" (X= combination permutated strings), i.e: "fileCo70r0", then it saves the executable code into dropped ELF bot binary.

The dropped ELF binary is the payload, a DDOS bot client, that is having basic stuff like remote execution, receiving bot commands, encrypted traffic functions, etc), see below for detail.

The interesting part for the dropper is, after dropping the payload, it installs persistence startup to "/etc/cron.hourly/0" and lastly executed the dropped binary and then cleaned-up itself. The dumped the embedded ELF is with the hash : 269029c1554b13c3eccfaacf0196ff72 (you can check this hash after you drop / extract embedded part).

How to detect by behavior in a glance:

The dropped binary is a bot client that will print "IVEBEENEXECUTED" on execution, and made below networking:

1. listening to (bind to 127.0.0.1) TCP/12645 < likely a command receiver port
2. callback to C2 (bind to LOCALIP:HIGHPORTS) at 209.126.69.167:2020 (IP = AS6428 River City Internet Group, Primary Networks, USA)

PS: The source of this infection is also from USA network: 104.244.72.54 on AS53667 at PonyNET, honeypots detected it:

104[.]244[.]72[.]54/RHOMBUS.sh4
104[.]244[.]72[.]54/RHOMBUS.x86
104[.]244[.]72[.]54/RHOMBUS.arm5
104[.]244[.]72[.]54/RHOMBUS.x86_64
104[.]244[.]72[.]54/RHOMBUS.mpsl

Interesting strings in the embedded (or) the dropped binary, aka the payload is:

0xZ6c8 48 47 %s %s HTTP/1.1\r\nHost: %s\r\nConnection: close\r\n\r\n
0x_1bd 5 4 \b\n\n\n
0x_1d0 9 8 hlLjztqZ
0x_220 21 20 npxXoudifFeEgGaACScs
0x_235 8 7 +0-#'I
0x_2a8 15 14 Unknown error
0x_2c0 8 7 Success
0x_e1d 8 7 /bin/sh

some_ encrypted strings are intact, you can "grep" these:

0x_6f8 7 6 {inod\f
0x_6ff 5 4 snnu
0x_704 10 9 0110biho\f
0x_70e 9 8 edg`tmu\f
(etc)

So, What is this threat anyway?

We were suspecting this ELF dropper is a part of a new ELF/linux DDoSer w/new installer possibilities were varied, maybe CLOUDSNOOPER or, and, well, in the end it is just a dropper to drop "another" DDoSer bots. (one of a kind of: Gafgyt, Kaiten, Mirai and such) just another new coded one.. Made by skids in DDoS ecosystem.

How the payload works in general:

The payload has these functions:

  1. C2 command receiver

  2. Execution of DoS attack variations

  3. Sending data to C2 of compromised device

  4. Has a remote command execution that can be used to execute downloaded file or crafted pushed command

  5. Encryption to process config and receive-transmission comm.

In detail it works as follows:

After static reversing & decrypting payloads distributed via the dropper, and also decrypting/analyzing more recent samples distributed w/o dropper it shows that the connection to C2 will trigger the real activity of this bot (decryption of transmission data, processing receiving commands, and offensive execution for five DOS variation attacks of commands, including one of them are sub packeting forged "urg", ack", rst", "fin", "psh" attacks, other is with the "0" or "1" sub attack types, and there's also L7 flood spoofing for HTTP/1.1 too).

The transmission data is using encryption (XOR'ed basis), that's also used for processing embedded & hard coded config in the bot client, and also the pushed one through the listening port.

Activities invoked are not only processing bot command but involving the command execution triggered by "sh -c" in the system compromised by this bot.

C2 will be sent (with write method) by encrypted data through connected socket from the bot client, contains data of bot info and networking (IP) with this string:

"jm:%s:%d OR "jm:_:%d

The infrastructure used by the adversaries to spread the payload and as C2 is listed so far as follows, you should block these:

209.126.69.167  | I167.datasoft.ws. |6428 | 209.126.64.0/20 | CDM | US 
45.135.134.132  |  |51659 | 45.135.134.0/23 | ASBAXET | RU 
167.172.128.4   |  |14061 | 167.172.128.0/20 | DIGITALOCEAN-ASN | US 
205.185.122.243 | google-public-dns-a.google.com.(fake) |53667 | 205.185.112.0/20 | PONYNET | US 

Still, I haven't got enough time to check on this thoroughly, currently busy w/other works too, I am sure I am still missing one or two, so please add or comment, I will update the info regularly.

Let's call this new threat as "RHOMBUS". The OpenIOC is here.

1st found credit: 0xrb (thank you).


r/LinuxMalware • • Apr 06 '19

Analysis of (new) malware list post-MMD blog

9 Upvotes

The {full-list}

Hello. I made few scattered analysis of new (Linux mostly) malware after MMD-0062-2017 - Credential harvesting by SSH Direct TCP Forward attack via IoT botnet post.

Let me sort them out before I completely forget where they are. Noted: some of them are not Linux ones and I may missed some posts, so you can check them out also in: VirusTotal's comments, kernelmode / grep author "unixfreaxjp" or in Linux Malware subreddit. You may also want to check the older list for older analysis. Thank's for your support!

Latest Linux Malware cases:

Linux Malware Analysis Museum:

Analysis Memo: (shared)

So Many Mirai..Mirai on the wall)

Today's Kaiten & PerlDDoS

Linux/STD bot

Linux/Kaiten (modded ver) in Google clouds

Linux/Qbot or GafGyt ...in Kansas city?

ChinaZ gang is back to shellshock drops Elknot abuses USA networks

Intel POPSS Vulnerability PoC Reversed

Win32/TelegramSpyBot

Win32/WaRAT

Win32/Bayrob

OSX/MugTheSec

OSX/MachO-PUP (a quickie)

Webshell/r57shell

*) Enjoy! #MalwareMustDie!


r/LinuxMalware • • Jan 20 '18

"Vulcan" aka Linux/"Rebirth" or "Katrina" (variant of qbot/torlus basis). another Ddos malware weaponized w/: router exploitation, plenty of IoT scanners & mirai stuff, aimed routers, modems or servers.

Thumbnail
imgur.com
9 Upvotes

r/LinuxMalware • • Nov 05 '16

Full List of MMD Linux Malware Analysis Resource

9 Upvotes
 NEWS:
 Update - Thu Nov 24 02:25:34 JST 2016
 The newest list with more links was updated in "new" MalwareMustDie blog.
 It will not making much sense if I have to update both lists, so I purged this one.
 See the access details in the bottom of this post.
 Update - Fri Jan 18 21:32:22 JST 2018
 We don't renew the blog at the moment for some development.
 Update - Sat Jan 20 21:35:34 JST 2018
 Updating only to this subredit for most recent Linux threat vectors, until the further notice.

Recently a new waves of Linux (ELF) malware is hitting us hard again, this time is including the IoT vulnerabilities platform which causing serious DDoS disasters. Malware threat in Linux platform are so seasonable, as long as there are exploitable services that can be injected with executable codes to its shell ; i.e.: in shellshock, PMA, Apache Struts. multiple CMS flaws, and now IoT exploits and hardcoded credentials, etc. ; the infection of Linux malware and its botnets behind it are recently raising to lurking our boxes.

Their botnets are racing to pwn and infecting as many compromised systems as they can hack via vulnerable services or exploits. Some hackers would wait patiently for a new flaw to be announced ..or close to it, some are just using existed ones to aim the un-updated/poor-managed boxes, only very few of them are on writing 0day exploits on their own.

Reference, it is all what we need to handle incidents causing by these malware payloads. And in comparison to the other threat information, Linux malware information is too scattered and many of them are actually quite old.

For that, I dumped this list of all Linux malware analysis that me and mates in MalwareMustDie (MMD) has analyzed, in order to seek a references during Linux malware incidents, fellow sysadmins can do a quick browsing to the related threat. The analysis reports for the listed cases are in MMD blog (mostly), some were posted in KernelMode forum, or, in other media sites. The list is updated into newer data pre-y2018, added with more details and hidden analysis links, you can access it in the below URL:

http://blog2.malwaremustdie.org/2016/11/linux-malware.html

For the newest incidents and reports, I will add it here (this sub-reddit).

Malware Must Die! - unixfreaxjp


r/LinuxMalware • • Mar 14 '20

The "echo" loader vs "telnet" loader in ELF malware Mirai FBOT (ARM EABI reversing)

Thumbnail
blog.malwaremustdie.org
8 Upvotes

r/LinuxMalware • • Jan 19 '19

"CAYOSIN DDoS Botnet - A Qbot base upgraded with Mirai codes” -- an ELF reverse engineering overview in MIPS 32-bit

Thumbnail
imgur.com
8 Upvotes

r/LinuxMalware • • Dec 16 '18

Mirai ARC cpu binary is still on circulation (eb716ce18bf594670ab661507cdb1431)

Post image
8 Upvotes

r/LinuxMalware • • Apr 10 '21

Linux/NGioWeb

Thumbnail
twitter.com
7 Upvotes

r/LinuxMalware • • Mar 04 '21

MMD-067-2021 - Talks sequel on Linux process injection and Shellcode analysis series at R2CON-2020, ROOTCON-2020 after #HACKLU-2019

Thumbnail
blog.malwaremustdie.org
7 Upvotes

r/LinuxMalware • • Dec 24 '19

Linux ISO live boot w/radare2's r2Ghidra & R2DEC decompilers (multiple arch support) for Linux RE/DFIR

7 Upvotes

For Linux RE (Binary Analysis)/DFIR circle: The only Linux ISO live boot for RE/DFIR folks pre-installed with radare2's r2Ghidra & R2DEC decompilers, Tsurugi Linux SECCON ed. (see ENGLISH text translation link)

For recent info & updates, see Tsurugi Linux site.

About radare2 (Binary analysis tool web site, contribute here

The ISO has been tested, released and used at SECCON 2019 Tokyo, Japan, December 21, 2019.


r/LinuxMalware • • Jun 03 '20

Linux/Hoho a.k.a "DarkNexus" (memo)

Thumbnail
twitter.com
6 Upvotes

r/LinuxMalware • • May 23 '20

[Announcement] My own kernelmode[.]info Linux/Malware reports is merged in here

6 Upvotes

As some of you maybe know that I involved in contribution for Linux/Malware at the kernelmode.info forum, before I left it.

I would like to announce that the 16 threads of Linux/Malware analysis, either those were ones I first initiated it, or at those threads were having my analysis and writing efforts, are all backup up and merged in this repository successfully. The backup is only taking the first page of each thread due to the size limitation in the storage, however it is important to proof the first malware that has been firstly found or firstly named during MMD effort and those has been decided on my analysis desk.

What I wrote in the kernelmode forum are important because at the time I thought I was being between friendlies, therefore under the strong trust level many of the Linux/Malware threat analysis insights were shared over there.

The data has been successfully saved as offline web-pages, and for this repository purpose only the first page is shared, by the link to a GitHub storage account as the Open Source(feel free to analyze them).

Noted ("THIS IS IMPORTANT!): as long as you don't click the URL/links in those saved pages and just read them and "go back" here after reading, you will only browse the first page under the GitHub's service/host environment < again, please note this. If you want to read further and click some links on that first page, you will be redirected to the "Archive of KernelMode" server located at the below ISP and network details. I have nothing to do with the service and I don't know who is managing it, you can access it with your own risk. (Risk like, i.e. your access can be recorded by unknown parties, etc, I don't know..):

IP: 81.95.1.72
FQDN hostname: mif.h5l.org. 
ASN: AS201011
ISP:  OxygemDigital Inc, Victoria
Country: Seychelles

To recognize those migrated threads you can grep the characters "^KM" in the right-side menu list of Linux malware, and if you did it well, these are the list that has been added:

(65) : - Linux/Pscan and SSHscan ^KM

(71) : - Linux/KillFile ^KM

(75) : - Linux/BangSyn ^KM

(85) : - Linux/DTool ^KM

(95) : - Linux/Bashdoor(Gafgyt/Torlus/Qbot 1st found ^KM

(101): - Linux/Encoder ^KM

(107): - Linux/Torte ^KM

(123): - Linux/XorDDOS first found/rpt ^KM

(143): - Linux/ChinaZ "the beginning" 1st found ^KM

(145): - Linux/GoARMBot ^KM

(149): - Linux/AESDDoS ^KM

(153): - Linux/.Iptables or Iptablex ^KM

(159): - Linux/Mayhem ^KM

(161): - Linux/BossaBot ^KM

(167): - Linux/Elknot ^KM

(179): - Linux/Kaiten (Tsunami) ^KM

Lastly, I would like to thank kernelmode moderator @Xylit0l, who kindly allowed the backing up process to run smoothly, and to acknowledge the merge of the backups into this repository.

So please help yourself to read those analysis. There are a lot of them has not been covered by other places due to my limitation time to write to MMD blogs or other reporting forms.

I really hope that /r/LinuxMalware subreddit can be used for the future and stable media for the posting of Linux malware research, as a rich repository, for the future, and learning from the past, all of the data posted in here are backed up before posted.

In the future, after the mechanism of subreddit is mastered, I will share the posting access to others. There are many more analysis data that need to build first, I will need at least another year to cleaning up the backlog reports I made in the past.

Thank you and best regards

mmd0xFF


r/LinuxMalware • • Apr 25 '20

A new actor sparked propagation of Mirai FBot old version on different botnet network range

Thumbnail
blog.malwaremustdie.org
6 Upvotes

r/LinuxMalware • • Sep 30 '19

Packed ELF Binary on Embedded Linux Won't Stop UNIX Reversers (a MIPS cat packed)

Thumbnail
imgur.com
6 Upvotes

r/LinuxMalware • • Apr 20 '19

Fun in dissecting "LSD Packer" ELF GoLang Miner installer/loader made by "Hippies" China SystemTen (aka Rocke) Gang

Thumbnail
imgur.com
6 Upvotes

r/LinuxMalware • • May 22 '18

For the people who still think that Mirai linux malware variant is only aiming IoT non-Intel/AMD

Post image
6 Upvotes

r/LinuxMalware • • Dec 31 '17

Trojan Linux.ARM/Httpsd (backdoor, downloader, remote command execution)

Thumbnail
imgur.com
6 Upvotes

r/LinuxMalware • • Jan 27 '17

The best LMAO: Today's Qbot/GayFgt's with "Ultra HighTech IoT scanner function scheme" from Skiddies (skiddos) Inc.

Thumbnail
imgur.com
6 Upvotes

r/LinuxMalware • • Feb 15 '23

Explanation about this subreddit (README)

5 Upvotes

This post is to elaborate the contents of this subreddit, for the new design that has not had sidebar menu. The subreddit posts of Linux / ELF malware is for RE purpose, it may help you on learning to analyze a Linux malware. This subreddit is single-modded and the site's contents are MalwareMustDie.org's @unixfreaxjp Linux threat research material. You may link to any of the contents or this subreddit with mention to the original researcher (unixfreaxjp).

You switch the view mode: RSS | Mobile | NewReddit | OldReddit

You may want to discuss about my analysis but I am not good in chatting, if you have question please upload your text from here.

So about the contents:

These are the latest Linux Malware cases I have reversed and posted:

And these are my older Linux malware analysis, I called it "analysis museum":

..and lastly, you may also want to visit other similar sub-reddits too like:

Cheers! - unixfreaxjp -


r/LinuxMalware • • May 29 '20

Linux/Gafgyt SNoOpy

Thumbnail
twitter.com
5 Upvotes

r/LinuxMalware • • May 05 '20

Linux/Kaiji

5 Upvotes

Following a threat intelligence aiming Frontier networks containers, I analyzed this unknown new Linux (DDoS tool) malware made by Go lang w/ China origin (see @unixfreaxjp comment at VirusTotal ), and named it as Linux/Kaiji, announced first awareness w/screenshots in twitter. More of my insights comment is in this interview.


r/LinuxMalware • • Feb 23 '20

MMD-0065-2021 - Linux/Mirai-Fbot - A re-emerged IoT threat (+/- 600 infected IP, embedded ELF, hexstring push method, etc)

Thumbnail
blog.malwaremustdie.org
5 Upvotes

r/LinuxMalware • • Feb 11 '20

New "SystemTen" botnet miner threat, now w/other "supper savvy" LOL-packed ELF and.. "atomic" bash-base64 parsers :)

5 Upvotes

The threat is still there, thx RJ+Ceph for the fun poke of ELF bins. My unpacking, analysis for that bins is in here (The IOC raw info is all in there too). Be aware of low detection ratio.

Basically they still try on poorly (exec with deletion afterwards, no injection) effort to be fileless, more "insane efforts" in ELF packer, and execution series of "bash" parsed encoded base64 commands executed by "sh".. as its bot installer, bot updater, miner installer and updater, with the flavor of onions, using latest XMrig w/hardcoded pools .. shortly, it's a come-back.

Hint: Someone in PRC/China is persistently "sponsoring a serious big effort" in mass crypto-mining here.

MalwareMustDie!