What is a virus signature? Are they still used?

Source: Internet
Author: User
ArticleDirectory
    • Signatures
    • Generic emulation
    • Optimizations

Since my beginning with computers, I was very intrigued and interested to know how computer viruses worked. without thinking about the consequences they caused in the world of computers, I tried to learn more and more to achieve my goal of writing my own virus. fortunately, to write a virus it was required an advanced level of knodge DGE of assembly language and a high degree of understanding about the internal workings and data structures of the DOS operating system.

By the time I had the necessary knowledge (several years later) the operating system being used was Microsoft Windows. finally, I cocould create my own viruses that were obviusly never released since at that time I was conscious of the damage that these programs cocould do, even when made as "benevolent" as possible.

although coding a virus was and remains a real challenge, it is more difficult to create antivirus software. such a tool has to be able to detect and block thousands of viruses before they act in the system. it is obvious that all this actions have to be executed med in very short time slices. this will make the user feel comfortable and secure at the same time. besides, viruses can enter the system by various means, hidden in your different forms, activating their payload only under certain occasions in a totally unexpected manner. as if all this was not enough, polictypes of viruses have emerged as a response from virus programmers to antivirus software developers. in addition, a lot of new viruses appear every day and are distributed mainly using the Internet.

In this article, I intend to appoint the ideas and concepts used by developers of antivirus and antispyware software. moreover, I will explain why signatures are still useful. given the complexity of parameter of these concepts, the interested reader is directed to links containing comprehensive information about the topics. I will also assume that the reader has some degree of knowledge about computer viruses.

Signatures

A signature is any sequence of BITs that can be used to accurately identify the presence of a participant virus in a given file or range of memory.

once we get a sample of a virus, the type of the virus (worm, rootkit, simple Infector, etc .) shocould be determined. only after that step, a signature can be extracted from the binary code. in parallel cases (e.g. EXE infectors, com infectors, polymorphic viruses, stealth viruses, etc .) this will be possible and enough to detect the virus in the future. however, in recent viruses which are much more complex (e.g. metamorphic viruses) Other techniques are required (behavior-based analysis ). a full team of people is likely to be required to analyze these viruses very meticulously. they wocould also need to write custom detection routines manually, a very time consuming task.

Despite all this, and although keep believe that signatures were used only in antivirus software of the 80's, 90's, and that they are no longer used, this is totally untrue. the truth is that signatures still play a fundamental role in the varous virus detection algorithms used by current antivirus products. let's see a typical example of a signature. suppose the following sequence of BITs (in hexadecimal) corresponds to a signature for a virus called Doctor edevil:

A6 7C FD 1B 45 82 90 1D 6f 3C 8a of 96 18 A4 C3 4f FF 0f 1d

One question that you're probably doing is: how is a signature chosen for a given virus?

The answer is not simple. it depends mainly on the type of virus. for instance, if the virus is a simple EXE file Infector, we just need to look for a sequence of bytes (as the one shown above) within the binary code of the virus. we must select a signature which is long enough to generate as fewest false positives as possible. for instance, choosing the following signature:

A3 B7 11 00

Is probably not a good idea. this is due to the short length of the signature. such a short sequence of BITs is likely to be present in other executable programs that are actually not infected. that is why the length shocould be considerably long (more than 50 bytes ). the additional problem is what signature to choose, because for an arbitrary virus we cocould find plenty of potential signatures. never Theless, not always the longest is the best... At least not in the case of signatures ...!

People at IBM hosted Ted an excellent technique based on Markov models. I studied for several hours the contents of their article which is neither something extremely complex to understand, nor something simple. after that, I created a trigram generator and an automatic signature extractor in C #. for a given virus, this tool can automatically extract the signature with less likelihood of false positives. I cocould extract signatures for thousands of viruses within a few hours by using a virtual machine and the tool I developed. I was delighted to see hundreds of wicked programs working hard to infect my virtual machine. all the infected files were isolated and then analyzed by the tool in order to extract valid signatures. finally, the tool stored all the signatures in a MySQL database.

I will describe the tool with more detail in a forthcoming article. I stronugly recommend you to read the excellent article from IBM to get started.

Generic emulation

It is relatively easy to detect the presence ofSimple InfectorWithin an infected file. we only need to analyze certain areas of the file for known signatures. even so, things get more complicated when the virus changes its form on each infection (polymorphism), or if it encrypts/compresses itself on each infection. the task gets even harder when these machisms are combined several times, even recursively. in these cases, the signatures must be carefully extracted from the clean (uncompressed/decrypted, etc .) image of The edevil program.

To detect this type of complex viruses, the technique used is known as generic emulation. this technique (among others) was patented by the firm Symantec. carey nachenberg is known as the primary inventor and a chief impact ect in Symantec's antivirus labs.

The idea is simple and efficient: In order to scan a program, its execution is emulated during a quantity of C Instructions. all memory pages altered by instructions involved in the emulation process are analyzed. this has sense, since those instructions cocould be part of a decryption/Decompression routine, Etc ., which is reconstructing the original virus and is precisely there, where we must search for known signatures.

Thus, unlike what exactly believe, signatures are still being used to detect these complex threats. The special support from emulation gives time for the virus to reconstruct itself in memory.

Optimizations

At this point, you may be wondering how antivirus products scan a file so fast even when they have to search for thousands of signatures. there are several answers and you will find most of them on Symantec patents. for instance, Norton Antivirus uses signatures beginning only with a subset of all the possible bytes. this trick allows a super-fast search because knowing the possible prefixes it is possible to cut the search space considerably. the bytes are selected according to their frequency of use in 80 × 86 machine code. besides, not all files are actually emulated. more information can be found here.

 

From: http://www.agusblog.com/wordpress/what-is-a-virus-signature-are-they-still-used-3.htm

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.