Manual analysis of virus samples (in linux)-General Linux technology-Linux programming and kernel information. The following is a detailed description. We believe that viruses in Windows are nothing more than modifying the registry, adding executable files, infecting executable files, and modifying MBR. We do not care about the last item for the time being. Currently, viruses seldom infect the system by modifying the primary Boot Sector. Let's only look at the first three items. We can identify viruses by comparing a good system with an infected system.
Principle: Compare files with different md5 values.
Operation Background:
1. XP installation CD;
2. virus sample;
3. USB flash drive;
4. Ubuntu 7.10 LiveCD
5. Comparison between md5 and programs that convert the binary file format
Procedure:
1. Complete formatting and install Windows at the same time (you can also use ghost to go back, but be sure to pay attention to the possible virus infection of other disks)
2. Export the Registry in Windows. Put the exported file in the root directory of the C drive. Here I name it 1.reg
3. Go to the Ubuntu system. Note: select the Simplified Chinese mode before entering f2.
4. Attach disk C:
Mkdir/mnt/hdd1 (Production System C disk mount point)
Mount-t ntfs-o iocharset = cp936/dev/hdd1/mnt/hdd1 (mount the system drive C to/mnt/hdd1, note that the file format and device number depend on the actual situation)
5. Mount the USB flash drive:
Mkdir/mnt/usb (create a usb disk mount point)
Mount-t vfat/dev/sda1/mnt/usb (mount the usb flash drive to/mnt/usb, also pay attention to the file format and device number)
6. Add the exported registry information to the USB flash drive:
Assume that the test directory already exists on the USB flash drive and three programs, parse. sh, parseWinReg, and ShowList, are included in the test directory.
Cp/mnt/hdd1/1.reg/mnt/usb/test (copy the export registry to the/mnt/usb/test directory)
Cd/mnt/usb/test (enter the usb disk test directory)
./ParseWinReg 1.reg origreg (convert the exported registry to generate origreg)
7. Calculate the md5 value of all files on drive C:
Rm/mnt/hdd1/pagefile. sys (this file is too large to affect the computing speed, delete)
/Mnt/usb/test/parse. sh/mnt/hdd1/>/mnt/usb/origfile (calculate the md5 value of the disk file and export the result to origfile under the usb disk test directory)
8. re-enter Windows and run the virus file again.
Note: first put the virus file into the disk, unplug the USB flash drive, unplug the network cable, and then activate it!
13. Analyze filediff and regdiff, and draw a conclusion.
Tips for analysis: In general, the first occurrence + is the release of the virus, which is changed (infected). If the md5 value is paired (one + and One -), that line is generally not. If there is no mark above, it means no. We will delete useless files, leaving only one + or one-. It is best to see the file path, that is, the virus generated file or the infected file.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.