Volatility工具學習

背景

VMware虛擬機系統hang死,手動重啟無法觸發系統panic,從而不能觸發kdump產生vmcore文件進行原因分析;此種情況下需要手動生成虛擬機內存快照,進而利用Volatility工具分析系統hang死的具體原因。

配置

  • 使用VMware創建虛擬機內存快照,同時重啟虛擬機。
  • 下載對應python版本的Volatility 。(python3 Volatility3 )
  • 安裝依賴distorm3
pip install distorm3

正常情況下,完成以上步驟后,就可以使用Volatility工具分析內存快照了。

使用

1、分析系統架構

使用imageinfo參數查看設備信息,找到適配的配置文件。

python vol.py -f /root/vm_snapshot/Test.vmem imageinfo

當然,如果系統信息確定的情況下,也可以直接使用內置的配置文件。

$ python vol.py --info
Volatility Foundation Volatility Framework 2.6.1Profiles
--------
VistaSP0x64           - A Profile for Windows Vista SP0 x64
VistaSP0x86           - A Profile for Windows Vista SP0 x86
... ...

可以看到Volatility僅內置Windows系統的配置文件,因此在Linux系統上imageinfo時,會出現無法正常執行的情形。

$ python vol.py -f /root/vm_snapshot/Test.vmem imageinfo
Volatility Foundation Volatility Framework 2.6.1
INFO    : volatility.debug    : Determining profile based on KDBG search...

若出現這種情況,則說明Volatility的配置文件無法分析該系統的內存快照,需要手動構建你自己的 Linux 配置文件。

構建過程中,可能會出現一下編譯錯誤,如gcc版本錯誤,dwarf庫未找到等等,解決方案都可以在網上找到,這里就不一一贅述了。

$ cd tools/linux/
$ pwd
/root/volatility/tools/linux
$ ls
kcore  Makefile  Makefile.enterprise  module.c
$ make
make -C //lib/modules/4.9.0-19-linx-security-amd64/build CONFIG_DEBUG_INFO=y M="/root/volatility/tools/linux" modules
make[1]: Entering directory '/usr/src/linux-headers-4.9.0-19-linx-security-amd64'CC [M]  /root/volatility/tools/linux/module.oBuilding modules, stage 2.MODPOST 1 modulesCC      /root/volatility/tools/linux/module.mod.oLD [M]  /root/volatility/tools/linux/module.ko
make[1]: Leaving directory '/usr/src/linux-headers-4.9.0-19-linx-security-amd64'
dwarfdump -di module.ko > module.dwarf
make -C //lib/modules/4.9.0-19-linx-security-amd64/build M="/root/volatility/tools/linux" clean
make[1]: Entering directory '/usr/src/linux-headers-4.9.0-19-linx-security-amd64'CLEAN   /root/volatility/tools/linux/.tmp_versionsCLEAN   /root/volatility/tools/linux/Module.symvers
make[1]: Leaving directory '/usr/src/linux-headers-4.9.0-19-linx-security-amd64'

編譯完成之后,目錄下會出現一個module.dwarf文件,我們需要將該文件與系統符號表一起打包,創建Volatility插件。

$ ls -l module.dwarf
-rw-r--r-- 1 root root 3191958 416 11:23 module.dwarf
$ ls -l /boot/System.map-4.9.0-19-linx-security-amd64
-rw-r--r-- 1 root root 3220023 625  2024 /boot/System.map-4.9.0-19-linx-security-amd64
$ zip volatility/plugins/overlays/linux/Linx_6.0.80.zip tools/linux/module.dwarf /boot/System.map-4.9.0-19-linx-security-amd64
updating: tools/linux/module.dwarf (deflated 91%)
updating: boot/System.map-4.9.0-19-linx-security-amd64 (deflated 79%)

上述操作完成后,可以使用--info查詢插件是否正常安裝。

$ python vol.py -f /root/vm_snapshot/Test.vmem --info|grep Linx
Volatility Foundation Volatility Framework 2.6.1
LinuxLinx_6_0_80x64   - A Profile for Linux Linx_6.0.80 x64
2、使用

使用-h參數查看配置文件支持的命令。

$ python vol.py -f /root/vm_snapshot/Test.vmem --profile=LinuxLinx_6_0_80x64 -h
Volatility Foundation Volatility Framework 2.6.1
Usage: Volatility - A memory forensics analysis platform.Options:-h, --help            list all available options and their default values.Default values may be set in the configuration file(/etc/volatilityrc)--conf-file=/root/.volatilityrcUser based configuration file-d, --debug           Debug volatility--plugins=PLUGINS     Additional plugin directories to use (colon separated)--info                Print information about all registered objects--cache-directory=/root/.cache/volatilityDirectory where cache files are stored--cache               Use caching--tz=TZ               Sets the (Olson) timezone for displaying timestampsusing pytz (if installed) or tzset-f FILENAME, --filename=FILENAMEFilename to use when opening an image--profile=LinuxLinx_6_0_80x64Name of the profile to load (use --info to see a listof supported profiles)-l file:///root/vm_snapshot/Test.vmem, --location=file:///root/vm_snapshot/Test.vmemA URN location from which to load an address space-w, --write           Enable write support--dtb=DTB             DTB Address--shift=SHIFT         Mac KASLR shift address--output=text         Output in this format (support is module specific, seethe Module Output Options below)--output-file=OUTPUT_FILEWrite output in this file-v, --verbose         Verbose information--physical_shift=PHYSICAL_SHIFTLinux kernel physical shift address--virtual_shift=VIRTUAL_SHIFTLinux kernel virtual shift address-g KDBG, --kdbg=KDBG  Specify a KDBG virtual address (Note: for 64-bitWindows 8 and above this is the address ofKdCopyDataBlock)--force               Force utilization of suspect profile--cookie=COOKIE       Specify the address of nt!ObHeaderCookie (valid forWindows 10 only)-k KPCR, --kpcr=KPCR  Specify a specific KPCR addressSupported Plugin Commands:imagecopy       Copies a physical address space out as a raw DD imagelimeinfo        Dump Lime file format informationlinux_apihooks  Checks for userland apihookslinux_arp       Print the ARP tablelinux_aslr_shift        Automatically detect the Linux ASLR shiftlinux_banner    Prints the Linux banner informationlinux_bash      Recover bash history from bash process memorylinux_bash_env  Recover a process' dynamic environment variableslinux_bash_hash Recover bash hash table from bash process memorylinux_check_afinfo      Verifies the operation function pointers of network protocolslinux_check_creds       Checks if any processes are sharing credential structureslinux_check_fop Check file operation structures for rootkit modificationslinux_check_idt Checks if the IDT has been alteredlinux_check_inline_kernel       Check for inline kernel hookslinux_check_modules     Compares module list to sysfs info, if availablelinux_check_syscall     Checks if the system call table has been alteredlinux_check_tty Checks tty devices for hookslinux_cpuinfo   Prints info about each active processorlinux_dentry_cache      Gather files from the dentry cachelinux_dmesg     Gather dmesg bufferlinux_dump_map  Writes selected memory mappings to disklinux_dynamic_env       Recover a process' dynamic environment variableslinux_elfs      Find ELF binaries in process mappingslinux_enumerate_files   Lists files referenced by the filesystem cachelinux_find_file Lists and recovers files from memorylinux_getcwd    Lists current working directory of each processlinux_hidden_modules    Carves memory to find hidden kernel moduleslinux_ifconfig  Gathers active interfaceslinux_info_regs It's like 'info registers' in GDB. It prints out all thelinux_iomem     Provides output similar to /proc/iomemlinux_kernel_opened_files       Lists files that are opened from within the kernellinux_keyboard_notifiers        Parses the keyboard notifier call chainlinux_ldrmodules        Compares the output of proc maps with the list of libraries from libdllinux_library_list      Lists libraries loaded into a processlinux_librarydump       Dumps shared libraries in process memory to disklinux_list_raw  List applications with promiscuous socketslinux_lsmod     Gather loaded kernel moduleslinux_lsof      Lists file descriptors and their pathlinux_malfind   Looks for suspicious process mappingslinux_memmap    Dumps the memory map for linux taskslinux_moddump   Extract loaded kernel moduleslinux_mount     Gather mounted fs/deviceslinux_mount_cache       Gather mounted fs/devices from kmem_cachelinux_netfilter Lists Netfilter hookslinux_netscan   Carves for network connection structureslinux_netstat   Lists open socketslinux_pidhashtable      Enumerates processes through the PID hash tablelinux_pkt_queues        Writes per-process packet queues out to disklinux_plthook   Scan ELF binaries' PLT for hooks to non-NEEDED imageslinux_proc_maps Gathers process memory mapslinux_proc_maps_rb      Gathers process maps for linux through the mappings red-black treelinux_procdump  Dumps a process's executable image to disklinux_process_hollow    Checks for signs of process hollowinglinux_psaux     Gathers processes along with full command line and start timelinux_psenv     Gathers processes along with their static environment variableslinux_pslist    Gather active tasks by walking the task_struct->task listlinux_pslist_cache      Gather tasks from the kmem_cachelinux_psscan    Scan physical memory for processeslinux_pstree    Shows the parent/child relationship between processeslinux_psxview   Find hidden processes with various process listingslinux_recover_filesystem        Recovers the entire cached file system from memorylinux_route_cache       Recovers the routing cache from memorylinux_sk_buff_cache     Recovers packets from the sk_buff kmem_cachelinux_slabinfo  Mimics /proc/slabinfo on a running machinelinux_strings   Match physical offsets to virtual addresses (may take a while, VERY verbose)linux_threads   Prints threads of processeslinux_tmpfs     Recovers tmpfs filesystems from memorylinux_truecrypt_passphrase      Recovers cached Truecrypt passphraseslinux_vma_cache Gather VMAs from the vm_area_struct cachelinux_volshell  Shell in the memory imagelinux_yarascan  A shell in the Linux memory imagembrparser       Scans for and parses potential Master Boot Records (MBRs)patcher         Patches memory based on page scansraw2dmp         Converts a physical memory sample to a windbg crash dumpvmwareinfo      Dump VMware VMSS/VMSN information

Volatility3 使用

Volatility3在用法上與Volatility差異不大,只是支持的參數列表發生了較大變化,可以使用-h查看支持的插件列表。其中較大的差別在于Volatility3拋棄了構建起來較為復雜的 profile,轉而使用符號表。而由于Linux 版本很多很雜,并沒有提供非常全面的符號表,想要使用的話必須使用 dwarf2json生成自己的符號文件。

$ ./dwarf2json linux
No files specified
Usage: dwarf2json linux [OPTIONS]--elf PATH           ELF file PATH to extract symbol and type information--elf-symbols PATH   ELF file PATH to extract only symbol information--elf-types PATH     ELF file PATH to extract only type information--system-map PATH    System.Map file PATH to extract symbol information

--system-map參數指定/boot目錄下的系統符號表文件,--elf文件必須指定帶調試符號vmlinuz文件。將dwarf2json的輸出結果保存到Volatility3根目錄,就可以正常使用了。

$ ./dwarf2json linux --elf /usr/lib/debug/boot/vmlinux-4.4.0-137-generic > output.json
# Volatility3分析進程
$ python3 vol.py -f /vm_snapshot/Test.vmem -s . linux.pslist.PsList

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/902602.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/902602.shtml
英文地址,請注明出處:http://en.pswp.cn/news/902602.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

學習筆記(C++篇)--- Day 4

目錄 1.賦值運算符重載 1.1 運算符重載 1.2 賦值運算符重載 1.3 日期類實現 1.賦值運算符重載 1.1 運算符重載 ①當運算符被用于類類型的對象時,C語言允許我們通過通過運算符重載的形式指定新的含義。C規定類類型對象使用運算符時,必須轉換成調用對…

Docker 快速入門教程

1. Docker 基本概念 鏡像(Image): 只讀模板,包含創建容器的指令 容器(Container): 鏡像的運行實例 Dockerfile: 用于構建鏡像的文本文件 倉庫(Repository): 存放鏡像的地方(如Docker Hub) 2. 安裝Docker 根據你的操作系統選擇安裝方式:…

vue項目中使用tinymce富文本編輯器

vue使用tinymce 文章目錄 vue使用tinymcetinymce富文本編輯器在這里插入圖片描述 一、本文要實現二、使用步驟1.安裝tinymce2.tinymce組件新建3. 在store添加商品詳情的狀態管理4. tinymce組件的引入 tinymce富文本編輯器 提示:以下是本篇文章正文內容,下…

簡單適配torch_npu不支持的ATen算子

簡單適配torch_npu不支持的ATen算子 一、背景說明1.1 PyTorch擴展機制1.2 核心概念二、實現步驟詳解2.1 實現前向、反向傳播算子2.2 編譯生成動態庫2.3 測試驗證程序三、關鍵點解析3.1 設計注意事項3.2 性能優化方向四、驗證結果一、背景說明 1.1 PyTorch擴展機制 PrivateUse1…

同樣的html標記,不同語言的文本,顯示的字體和粗細會不一樣嗎

同樣的 HTML 標記,在不同語言的文本下,顯示出來的字體和粗細確實可能會不一樣,原因如下: 🌍 不同語言默認字體不同 瀏覽器字體回退機制 CSS 里寫的字體如果當前系統不支持,就會回退到下一個,比如…

基于 Spring Boot 瑞吉外賣系統開發(六)

基于 Spring Boot 瑞吉外賣系統開發(六) 菜品列表 在系統管理端首頁,單擊左側菜單欄中的“菜品管理”,會在右側打開菜品管理頁面。 請求URL/dish/page,請求方法GET,請求參數page,pageSize。 該菜品列表…

計算機視覺與深度學習 | TensorFlow基本概念與應用場景:MNIST 手寫數字識別(附代碼)

TensorFlow 基本概念 TensorFlow 是一個開源的機器學習框架,由 Google 開發,核心概念包括: 張量(Tensor):多維數組,是數據的基本單位。計算圖(Graph):早期版本中用于描述數據流和計算過程,2.x 默認啟用即時執行(Eager Execution),兼顧靈活性和性能。層(Layers)…

vue+django+LSTM微博輿情分析系統 | 深度學習 | 食品安全分析

文章結尾部分有CSDN官方提供的學長 聯系方式名片 文章結尾部分有CSDN官方提供的學長 聯系方式名片 關注B站,有好處! 編號: D031 LSTM 架構:vuedjangoLSTMMySQL 功能: 微博信息爬取、情感分析、基于負面消極內容輿情分析…

RHCE第三次作業 搭建dns的正向解析服務器

server為服務器 client為客戶端 設置主配置文件 在server下: [rootServer ~]#vim /etc/named.conf #進入到配置頁面,并修改 設置區域文件 [rootServer ~]# vim /etc/named.rfc1912.zones 設置域名解析文件 [rootServer named]# cd /var/named…

Windows 同步技術-一次性初始化

組件通常設計為在首次調用時執行初始化任務,而不是加載它們時。 一次性初始化函數可確保此初始化僅發生一次,即使多個線程可能嘗試初始化也是如此。 Windows Server 2003 和 Windows XP: 應用程序必須使用 互鎖函數 或其他同步機制提供自己的…

OpenCV 中的角點檢測方法詳解

文章目錄 引言1. Harris角點檢測原理1.1 什么是角點?1.2 Harris算法的核心思想1.3 角點、邊緣和平坦區域的區分 2. OpenCV實現Harris角點檢測3. 總結 引言 在計算機視覺和圖像處理中,特征點檢測(Feature Detection)是一個關鍵任務…

全面介紹AVFilter 的添加和使用

author: hjjdebug date: 2025年 04月 22日 星期二 13:48:19 CST description: 全面介紹AVFilter 的添加和使用 文章目錄 1.兩個重要的編碼思想1. 寫代碼不再是我們調用別人,而是別人調用我們!2. 面向對象的編程方法. 2. AVFilter 開發流程2.1 編寫AVFilter 文件2.1.…

生物計算安全攻防戰:從DNA存儲破譯到碳基芯片防御體系重構

隨著碳基生物芯片突破馮諾依曼架構限制,DNA數據存儲密度達到1EB/克量級,合成生物學與信息技術的融合正引發新一輪安全革命。本文深入解析碳基芯片逆向工程路徑,揭示酶驅動DNA數據解碼的技術突破,預警合成生物回路潛在的數據泄露風…

Spring Boot 集成 Ollama API 使用總結

Spring Boot 中集成 Ollama API 的完整指南&#xff0c;涵蓋基礎配置、API 調用、性能優化及常見問題解決。 一、環境準備 1. 依賴配置 在 pom.xml 中添加必要的依賴&#xff1a; <!-- Spring Web (用于 REST 請求) --> <dependency><groupId>org.springf…

SimVG論文精讀

1. 數據集和任務部分 SimVG用的六個數據集&#xff1a;RefCOCO//g, ReferIt, Flickr30K, and GRefCOCO 數據集名稱圖像數量參照表達式數量參照對象實例數語言特性主要任務RefCOCO19,994142,20950,000?基于 MS COCO 圖像&#xff0c;采用 ReferItGame 收集的指代表達數據集。…

VS中回顯109:對‘pthread_create’未定義的引用

VS中解決 用VS2022寫多線性程時需要使用pthread_create()用于創建線程,即使項目里加了所需要的頭文件#include <pthread.h>但編譯卻報對pthread_create未定義的引用的錯誤,這是因為沒有包含所需要的庫 項目右擊屬性 在庫依賴項中添加 pthread Ubuntu中解決 在Ubuntu中…

kotlin與MVVM結合使用總結(一)

一、Kotlin 與 MVVM 結合的核心優勢 代碼簡潔性 數據類&#xff08;data class&#xff09;簡化 Model 層定義&#xff0c;自動生成equals/hashCode/toString擴展函數簡化 View 層邏輯&#xff08;如點擊事件擴展&#xff09;lateinit/by lazy優化 ViewModel 屬性初始化 異步處…

視頻分析設備平臺EasyCVR安防視頻小知識:安防監控常見故障精準排查方法

隨著安防監控技術的飛速發展&#xff0c;監控系統已經成為現代安防體系中不可或缺的核心組成部分&#xff0c;廣泛應用于安防監控、交通管理、工業自動化等多個領域。然而&#xff0c;監控系統的穩定運行高度依賴于設備的正確配置、線路的可靠連接以及電源的穩定供電。在實際應…

【DeepSeek 學習推理】Llumnix: Dynamic Scheduling for Large Language Model Serving實驗部分

6.1 實驗設置 測試平臺。我們使用阿里云上的16-GPU集群&#xff08;包含4個GPU虛擬機&#xff0c;類型為ecs.gn7i-c32g1.32xlarge&#xff09;。每臺虛擬機配備4個NVIDIA A10&#xff08;24 GB&#xff09;GPU&#xff08;通過PCI-e 4.0連接&#xff09;、128個vCPU、752 GB內…

如何利用深度學習進行交通流量預測與疏導

傳統的交通管理方法&#xff0c;諸如固定的信號燈配時方案、基于經驗的警力部署等&#xff0c;在面對現代城市如此復雜多變的交通狀況時&#xff0c;已然顯得捉襟見肘&#xff0c;難以滿足高效交通管理的需求。 在此背景下&#xff0c;準確的交通流量預測便成為了破解交通擁堵難…