I am trying to analyse Android malware on an emulator with Android 2.1. I want to analyze the files permissions and fingerprints after the execution of the suspicious app. I know, I can use the adb shell to get this information, but I think I can’t trust the information after the execution of e.g. a rootkit.
I think the only way to prevent rootkits from hiding is by mounting the images directly or?
I have the following files:
ramdisk.img snapshots.img userdata-qemu.img cache.img system.img userdata.img zImage
How can they be mounted/extracted on Ubuntu (read access is enough)?
With unyaffs I can extract the system.img and userdata.img file. simg2img returns "bad magic" for all files.
Thanks Alex
Edit: userdata-qemu.img works unyaffs2
You’ve already answered your own question but I’ll expand a bit.
The Android sdk comes with system images, for example:
Though, not all images are of the same type:
Since
sdcard.imgcontains no extra partitions, it can be mounted directly without an offset parameter (like-o loop,offset=32256):The other image files which are described as
VMS Alpha executableare in fact yaffs2 files. As far as I’m aware they can’t be mounted directly but can be extracted using the two utilities unyaffs or unyaffs2.or
Note, there’s another utility called
simg2imgwhich can be found in the android source tree under./android_src/system/extras/ext4_utils/which is used on compressed ext4 img files. However, if wrongly applied toyaffs2images it complains withBad magic.