~ubuntu-branches/ubuntu/saucy/clamav/saucy-backports

« back to all changes in this revision

Viewing changes to docs/signatures.tex

  • Committer: Package Import Robot
  • Author(s): Scott Kitterman
  • Date: 2014-07-15 01:08:10 UTC
  • mfrom: (0.35.47 sid)
  • Revision ID: package-import@ubuntu.com-20140715010810-ru66ek4fun2iseba
Tags: 0.98.4+dfsg-2~ubuntu13.10.1
No-change backport to saucy (LP: #1341962)

Show diffs side-by-side

added added

removed removed

Lines of Context:
203
203
 
204
204
    \subsection{Hash-based signatures}
205
205
    The easiest way to create signatures for ClamAV is to use filehash checksums,
206
 
    however this method can be only used against static malware. To create a
 
206
    however this method can be only used against static malware.
 
207
    \subsubsection{MD5 hash-based signatures}
 
208
    To create a
207
209
    MD5 signature for \verb+test.exe+ use the \verb+--md5+ option of sigtool:
208
210
    \begin{verbatim}
209
211
zolw@localhost:/tmp/test$ sigtool --md5 test.exe > test.hdb
238
240
    left in /tmp. Please keep in mind that a hash signature will stop
239
241
    matching as soon as a single byte changes in the target file.}
240
242
 
241
 
    \subsection{SHA1, SHA256}
 
243
    \subsubsection{SHA1 and SHA256 hash-based signatures}
242
244
    ClamAV 0.98 has also added support for SHA1 and SHA256 file checksums.
243
245
    The format is the same as for MD5 file checksum. 
244
246
    It can differentiate between them based on the length of the hash string
248
250
HashString:FileSize:MalwareName
249
251
    \end{verbatim}
250
252
 
251
 
    \subsection{PE section based}
 
253
    \subsubsection{PE section based hash signatures}
252
254
    You can create a hash signature for a specific section in a PE file.
253
255
    Such signatures shall be stored inside \verb+.mdb+ files in the
254
256
    following format:
265
267
    in the signature. For best backwards compatibility, these should be
266
268
    placed inside a \verb+*.msb+ file.
267
269
 
268
 
    \subsection{Unknown size}
 
270
    \subsubsection{Hash signatures with unknown size}
269
271
    ClamAV 0.98 has also added support for hash signatures where the size
270
272
    is not known but the hash is. It is much more performance-efficient to
271
273
    use signatures with specific sizes, so be cautious when using this
323
325
        Match aa or bb or cc..
324
326
        \item \verb+!(aa|bb|cc|..)+\\
325
327
        Match any byte except aa and bb and cc.. (ClamAV$\ge$0.96)
 
328
        \item \verb+(aaaa|bbbb|cccc|..)+\\
 
329
        Match alternative strings aaaa or bbbb or cccc. Alternative strings must have identical lengths.
 
330
        \item \verb+!(aaaa|bbbb|cccc|..)+\\
 
331
        Match any string except aaaa and bbbb and cccc. Alternative strings must have identical lengths.
 
332
        (ClamAV$\ge$0.98.2)
326
333
        \item \verb+HEXSIG[x-y]aa+ or \verb+aa[x-y]HEXSIG+\\
327
334
        Match aa anchored to a hex-signature, see
328
335
        \url{https://wwws.clamav.net/bugzilla/show_bug.cgi?id=776} for
443
450
        \item \verb+EntryPoint+: Entry point offset (range in bytes; 0.96)
444
451
        \item \verb+NumberOfSections+: Required number of sections in executable (range; 0.96)
445
452
        \item \verb+Container:CL_TYPE_*+: File type of the container which stores the scanned file
 
453
        \item \verb+IconGroup1+: Icon group name 1 from .idb signature Required engine functionality (range; 0.96)
 
454
        \item \verb+IconGroup2+: Icon group name 2 from .idb signature Required engine functionality (range; 0.96)
446
455
    \end{itemize}
447
456
    Modifiers for subexpressions:
448
457
    \begin{itemize}