Notification texts go here Contact Us Buy Now!

[Write-up] Practical Malware Analysis | Part 1 - Chapter 3 - Lab 3-4

Practical Malware Analysis

CHAPTER 3 - BASIC DYNAMIC ANALYSIS

Write up Lab 3-4


Lab03-04.exe

Analyze the malware found in the file Lab03-04.exe using basic dynamic analysis tools. (This program is analyzed further in the Chapter 9 labs.)
Phân tích mã độc được tìm thấy trong tệp Lab03-04.exe sử dụng các công cụ phân tích động cơ bản. (Chương trình này được phân tích sâu hơn trong các phòng thí nghiệm của Chương 9.)
Questions

1. What happens when you run this file?
2. What is causing the roadblock in dynamic analysis? 
3. Are there other ways to run this program?

Answers
Các công cụ sử dụng trong bài này:
PEView
Process Explorer
Process Monitor
Sử dụng các kỹ thuật phân tích tĩnh cơ bản để tìm hiểu một số thông tin về mẫu này.

Dùng PEView kiểm tra cấu trúc và chuỗi tệp PE. Tớ thấy rằng mã độc này nhập chức năng mạng, chức năng thao tác dịch vụ và chức năng thao tác đăng ký.

PEView Lab03-04.exe

Phân tích strings

Click full view:
Microsoft Windows [Version 10.0.19045.2965]
(c) Microsoft Corporation. All rights reserved.

D:\0 Practical Malware Analysis\LABS\BinaryCollection\Chapter_3L>strings Lab03-04.exe

Strings v2.54 - Search for ANSI and Unicode strings in binary images.
Copyright (C) 1999-2021 Mark Russinovich
Sysinternals - www.sysinternals.com

!This program cannot be run in DOS mode.
6K4
6KRich
.text
`.rdata
@.data
Ph?
jjjj
jjj
jjj
5h0
Ph?
SVWh
_^[
&t#
SVW
_^[
9~$
u\h
SVWh
@jj
_^[
SVWh
tmj
jjjjjj
jjjjj
j h
_^[
SVWh?
9h`
_^[
u1h
u1h
ugh
PhL
_9=
^h
YYh(
;t$
_^[
SUVW
7G3
_^][
QSVW
t#;
K;M
t7)E
Yt(
_^[
WSV
^[_3
^[_
^[_
^[_
u;f
u.f
u!f
wu
Yt-j
PPj
PPj
_^[
QVW
98t
 SV
WVS
[^_
VWS
Yr!
tL;
tD+E
VSW
_^[
SVWu
_^[
SVW
Yt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
[^_
GKu
[^_
Yu$

;0u
_^[]
0SVW
_u@W
PWPSS
PWPSS
9] u
E ;
@@8
@@8
SSV
_9]
tySS
t-VW
_^[
QQSVW3
tUj=
t@9u
uT9}
_^[
89=
8+u
Y|C
Yt<
@@P
Yt.
Y+E
8<=t
^][_
9;u
;t3
9;u
YY^
command.com
COMSPEC
V9@
j9@
EEE
 (8PX
700WP
`h````
ppxxxx
(null)
(null)
__GLOBAL_HEAP_SELECTED
__MSVCRT_HEAP_SELECT
runtime error
TLOSS error
SING error
DOMAIN error
R6028
- unable to initialize heap
R6027
- not enough space for lowio initialization
R6026
- not enough space for stdio initialization
R6025
- pure virtual function call
R6024
- not enough space for _onexit/atexit table
R6019
- unable to open console device
R6018
- unexpected heap error
R6017
- unexpected multithread lock error
R6016
- not enough space for thread data
abnormal program termination
R6009
- not enough space for environment
R6008
- not enough space for arguments
R6002
- floating point not loaded
Microsoft Visual C++ Runtime Library
Runtime Error!
Program:
...

SunMonTueWedThuFriSat
JanFebMarAprMayJunJulAugSepOctNovDec
.com
.bat
.cmd
GetLastActivePopup
GetActiveWindow
MessageBoxA
user32.dll
PATH
CloseHandle
SetFileTime
GetFileTime
CreateFileA
GetSystemDirectoryA
GetLastError
ReadFile
WriteFile
Sleep
GetShortPathNameA
GetModuleFileNameA
CopyFileA
ExpandEnvironmentStringsA
DeleteFileA
KERNEL32.dll
RegQueryValueExA
RegOpenKeyExA
RegSetValueExA
RegCreateKeyExA
RegDeleteValueA
CreateServiceA
CloseServiceHandle
ChangeServiceConfigA
OpenServiceA
OpenSCManagerA
DeleteService
ADVAPI32.dll
ShellExecuteA
SHELL32.dll
WS2_32.dll
ExitProcess
TerminateProcess
GetCurrentProcess
GetTimeZoneInformation
GetSystemTime
GetLocalTime
DuplicateHandle
GetCommandLineA
GetVersion
SetStdHandle
GetFileType
SetHandleCount
GetStdHandle
GetStartupInfoA
CreatePipe
GetExitCodeProcess
WaitForSingleObject
HeapReAlloc
HeapAlloc
GetCPInfo
GetACP
GetOEMCP
UnhandledExceptionFilter
FreeEnvironmentStringsA
FreeEnvironmentStringsW
WideCharToMultiByte
GetEnvironmentStrings
GetEnvironmentStringsW
GetModuleHandleA
GetEnvironmentVariableA
GetVersionExA
HeapDestroy
HeapCreate
VirtualFree
HeapFree
RtlUnwind
MultiByteToWideChar
GetStringTypeA
GetStringTypeW
SetFilePointer
VirtualAlloc
LCMapStringA
LCMapStringW
GetProcAddress
LoadLibraryA
FlushFileBuffers
GetFileAttributesA
CreateProcessA
CompareStringA
CompareStringW
SetEnvironmentVariableA
lZ@
Configuration
SOFTWARE\Microsoft \XPS
\kernel32.dll
 HTTP/1.0
GET
'`'`'
`'`'`
NOTHING
CMD
DOWNLOAD
UPLOAD
SLEEP
cmd.exe
 >> NUL
/c del
ups
http://www.practicalmalwareanalysis.com
 Manager Service
.exe
%SYSTEMROOT%\system32\
k:%s h:%s p:%s per:%s
-cc
-re
-in
         (((((                  H
PST
PDT

D:\0 Practical Malware Analysis\LABS\BinaryCollection\Chapter_3L>

Một số chuỗi đáng lưu ý như sau:

Strings

Quan sát thấy một số chuỗi như http://practicalmalwareanalysis.com, SOFTWARE\ Microsoft \XPS, DOWNLOADUPLOAD kết hợp với chuỗi HTTP/1.0 cho thấy mã độc này là một backdoor.
Các chuỗi -cc, -re và -in có thể là tham số dòng lệnh (ví dụ: -in có thể là viết tắt của install).

Tiếp theo tiến hành phân tích tĩnh cơ bản để biết liệu các chuỗi này có một sự liên kết nào không.

Trước khi chạy mã độc, tiến hành chạy Procmon và xóa tất cả các sự kiện, khởi động Process Explorer và thiết lập một mạng ảo.

Kết quả Procmon:

Procmon Lab03-04.exe

Đặt bộ lọc trong Procmon như sau:

Filter Lab03-04.exe
Kết quả trả về:

Procmom details

Không có bất kỳ mục nhập WriteFile hoặc RegSetValue nào, nhưng khi tìm kiếm sâu hơn, tôi tìm thấy một mục nhập cho Process Create. Tôi liền nhấn đúp vào một hộp thoại Event Properties xuất hiện như ở dưới.

Event Properties

Và đến đây tôi biết được mã độc đã tự xóa chính nó khỏi hệ thống bằng cách sử dụng "C:\WINDOWS\system32\cmd.exe" /c del C:\DOCUME~1\ADMINI~1\Desktop\PRACTI~1\BINARY~1\CH9F95~1\Lab03-04.exe >> NUL.

Tôi thử chạy mã độc với cmd bằng cách sử dụng các tùy chọn dòng lệnh đã thấy trong danh sách chuỗi ( -in, -re–cc), nhưng tất cả đều không thành công và dẫn đến việc chương trình tự xóa. Tôi không thể làm được gì nhiều hơn với các kỹ thuật động cơ bản vào thời điểm này, cho đến khi tìm hiểu sâu hơn về phần mềm độc hại. (Chương trình này được phân tích sâu hơn trong các phòng thí nghiệm của Chương 9).

Trước khi chạy.

cmd run Lab03-04.exe

Sau khi chạy.

cmd run Lab03-04.exe

TỔNG KẾT

1. What happens when you run this file?
(Điều gì xảy ra khi bạn chạy tệp này?)

Khi chạy mã độc này bằng cách nhấp đúp vào nó, chương trình sẽ tự xóa ngay lập tức.

2. What is causing the roadblock in dynamic analysis? 
(Điều gì xảy ra khi bạn chạy tệp này?)

Cần cung cấp thêm một số dòng lệnh hoặc một thành phần còn thiếu cho chương trình.

3. Are there other ways to run this program?
(Điều gì xảy ra khi bạn chạy tệp này?)

Đã thử các tham số dòng lệnh được hiển thị trong danh sách chuỗi (như -in), nhưng tệp vẫn tự động xóa. Cần phân tích sâu hơn. (Chương trình này được phân tích sâu hơn trong các phòng thí nghiệm của Chương 9).

KẾT THÚC LAB03-04.EXE

HẾT CHAPTER 1 - BASIC STATIC TECHNIQUES

HẾT PART I- BASIC ANALYSIS

Đăng nhận xét

Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
Site is Blocked
Sorry! This site is not available in your country.