您的位置:首页 > 其它

ubuntu16.04安装libvmi

2018-02-26 14:32 1286 查看
1.下载libvmi-mastrt.zip

地址:https://github.com/libvmi/libvmi

2.下载依赖包

m4 :

下载 wget http://ftp.gnu.org/gnu/m4/m4-1.4.18.tar.gz

编译安装:./configure

   make &&sudo make install

automake:

源码安装:sudo apt-get install automake

3.安装libvmi

三部曲的第一步:

./configure

然后缺啥装啥就可以。。。。

因为我之前装过glib,zlib,libffi 等库,所以没有重复安装,如果有报错说需要安装,看下编译信息找一下check到哪个库出了错,apt-get install xxx安装或者直接apt-cache search xxx 再apt-get install xxx就可以。

4.注意./configure后的结果

LibVMI is configured as follows. Please verify that this configuration

matches your expectations.

Host system type: x86_64-pc-linux-gnu

Build system type: x86_64-pc-linux-gnu

Installation prefix: /usr/local

FeatureOption
Xen Support–enable-xen=yes
KVM Support–enable-kvm=yes
File Support–enable-file=yes
Shm-snapshot–enable-shm-snapshot=no
Rekall profiles–enable-rekall-profiles=yes
OSOption
Windows–enable-windows=yes
Linux–enable-linux=yes
FreeBSD–enable-freebsd=yes
ToolsOptionReason
Examples–enable-examples=yes
VMIFS–enable-vmifs=noFUSE library missing (libfuse-dev)
加粗的是出错的地方,直接apt-get 就可以。。

该内容显示的是相关的安装路径,以及支持的系统虚拟化方式,和支持的操作系统等。检查无误之后,再make 编译就可以。

5.配置libvmi.conf文件:

首先获取系统偏移,这个

(1)svn checkout http://pdbparse.googlecode.com/svn/trunk/ pdbparse-read-only

win7相关的这个包从README文件中找到相关的下载地址就可以。

cd pdbparse-read-only/

sudo python setup.py install

(2)sudo apt-get install python-pefile

(3)sudo apt-get install mscompress

(4)sudo apt-get install cabextract

(5)sudo apt-get install python-pip

(6)sudo pip install construct

(7)然后进/libvirt-mastart/tools/windows-offset-finder文件夹:

g++ -o getGUID getGUID.cpp

./examples/dump-memory windows7 win7.dd

  将win7.dd拷贝至./windows-offset-finder/

./getGUID win7.dd |python ./downloadPDB.py |python ./dumpPDB.py -o debugSymbols.txt

  经常报错:

ntkrnlmp.pd_: Success
Traceback (most recent call last):
File "./dumpPDB.py", line 194, in <module>
main()
File "./dumpPDB.py", line 186, in main
dump_types(infile, opts.outfile)
File "./dumpPDB.py", line 159, in dump_types
pdb = pdbparse.parse(pdbFile) #call the parse function in __init__ of the pdbparse library
File "/usr/local/lib/python2.7/dist-packages/pdbparse/__init__.py", line 490, in parse
raise ValueError("Unsupported file type")
ValueError: Unsupported file type


可能因为系统是win7..

正常的话,不会出错,获取偏移,复制到libvmi.conf文件中,运行例子程序即可。

#后续。。。

操作ubuntu系统好像更容易,于是连夜装上ubuntu-12.04系统,从获取系统偏移开始操作:

根据README文件:

(1)先将 libvmi-mastar 的 linux-offset-finder 文件拷贝到你 qemu-kvm 创建的虚拟机中

http://blog.csdn.net/scaleqiao/article/details/45197093 这个链接提供一种比较简单的虚拟机和宿主机文件共享的办法

(2)进入虚拟机系统:

cd /linux-offset-finder

make

insmod findoffsets.ko 挂载模块

此时应该会有系统偏移的输出,如果没有的话:

输入dmesg:

就能看到偏移信息,将他们复制到宿主机的 libvmi.conf 文件中:

ubuntu12{
ostype = "Linux";
sysmap = "[insert path here]";
linux_name = 0x460;
linux_tasks = 0x238;
linux_mm = 0x270;
linux_pid = 0x2ac;
linux_pgd = 0x50;
}


×!!注意改虚拟机名字

×!!最后一哆嗦,别忘了吧 System.map 从虚拟机 /boot 路径下拷贝一份,放到宿主机的 /boot下

然后更新libvmi.conf文件:

ubuntu12{
ostype = "Linux";
sysmap = "/boot/System.map-3.2.0-23-generic";
linux_name = 0x460;
linux_tasks = 0x238;
linux_mm = 0x270;
linux_pid = 0x2ac;
linux_pgd = 0x50;
}


然后执行样例:

 cd examples

输入:process-list ubuntu12

得到输出:

Process listing for VM ubuntu12 (id=2)
Next list entry is at: ffff88007bfc8238
[    0] swapper/0
[    1] init
[    2] kthreadd
[    3] ksoftirqd/0
[    6] migration/0
[    7] watchdog/0
[    8] cpuset
[    9] khelper
[   10] kdevtmpfs
[   11] netns
[   12] sync_supers
[   13] bdi-default
[   14] kintegrityd
[   15] kblockd
[   16] ata_sff
[   17] khubd
[   18] md
[   19] kworker/u:1
[   22] khungtaskd
[   23] kswapd0
[   24] ksmd
[   25] khugepaged
[   26] fsnotify_mark
[   27] ecryptfs-kthrea
[   28] crypto
[   36] kthrotld
[   37] scsi_eh_0
[   38] scsi_eh_1
[   39] kworker/u:2
[   59] devfreq_wq
[  216] jbd2/vda1-8
[  217] ext4-dio-unwrit
[  333] upstart-udev-br
[  345] udevd
[  602] vballoon
[  603] kpsmoused
[  605] dbus-daemon
[  607] rsyslogd
[  667] modem-manager
[  713] udevd
[  714] udevd
[  729] avahi-daemon
[  730] avahi-daemon
[  736] cupsd
[  745] bluetoothd
[  746] NetworkManager
[  750] upstart-socket-
[  751] hd-audio0
[  771] polkitd
[  779] krfcommd
[  807] dhclient
[  820] dnsmasq
[  944] getty
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: