Browse code

update docs (thx to aCaB&Luca!)

Tomasz Kojm authored on 2010/02/26 22:31:22
Showing 5 changed files
... ...
@@ -154,10 +154,20 @@ Country of origin of malware/detection statistics (for statistical purposes only
154 154
 .br
155 155
 Default: disabled
156 156
 .TP
157
+\fBDetectionStatsHostID STRING\fR
158
+This option enables support for our "Personal Statistics" service. When this option is enabled, the information on malware detected by your clamd installation is made available to you through our website. To get your HostID, log on http://www.stats.clamav.net and add a new host to your host list. Once you have the HostID, uncomment this option and paste the HostID here. As soon as your freshclam starts submitting information to our stats collecting service, you will be able to view the statistics of this clamd installation by logging into http://www.stats.clamav.net with the same credentials you used to generate the HostID. For more information refer to: http://www.clamav.net/support/faq/faq-cctts/. This feature requires SubmitDetectionStats to be enabled.
159
+.br
160
+Default: disabled
161
+.TP
157 162
 \fBSafeBrowsing BOOL\fR
158 163
 This option enables support for Google Safe Browsing. When activated for the first time, freshclam will download a new database file (safebrowsing.cvd) which will be automatically loaded by clamd and clamscan during the next reload, provided that the heuristic phishing detection is turned on. This database includes information about websites that may be phishing sites or possible sources of malware. When using this option, it's mandatory to run freshclam at least every 30 minutes. Freshclam uses the ClamAV's mirror infrastructure to distribute the database and its updates but all the contents are provided under Google's terms of use. See http://code.google.com/support/bin/answer.py?answer=70015 and http://safebrowsing.clamav.net for more information.
159 164
 .br
160 165
 Default: disabled
166
+.TP
167
+\fBBytecode BOOL\fR
168
+This option enables downloading of bytecode.cvd, which includes additional detection mechanisms and improvements to the ClamAV engine.
169
+.br
170
+Default: enabled
161 171
 .SH "FILES"
162 172
 .LP 
163 173
 @CFGDIR@/freshclam.conf
164 174
Binary files a/docs/signatures.pdf and b/docs/signatures.pdf differ
... ...
@@ -152,7 +152,7 @@ MalwareName=HexSignature
152 152
     information such as a target file type, virus offset or engine version,
153 153
     making the detection more reliable. The format is:
154 154
     \begin{verbatim}
155
-MalwareName:TargetType:Offset:HexSignature[:MinEngineFunctionalityLevel:[Max]]
155
+MalwareName:TargetType:Offset:HexSignature[:MinFL:[MaxFL]]
156 156
     \end{verbatim}
157 157
     where \verb+TargetType+ is one of the following numbers specifying
158 158
     the type of the target file:
... ...
@@ -203,7 +203,9 @@ MalwareName:TargetType:Offset:HexSignature[:MinEngineFunctionalityLevel:[Max]]
203 203
     \verb+Offset+.\\
204 204
 
205 205
     \noindent
206
-    All signatures in the extended format must be placed inside \verb+*.ndb+ files.
206
+    Optional \verb+MinFL+ and \verb+MaxFL+ parameters can restrict the signature
207
+    to specific engine releases. All signatures in the extended format must be
208
+    placed inside \verb+*.ndb+ files.
207 209
 
208 210
     \subsubsection{Logical signatures}\label{ndb}
209 211
     Logical signatures allow combining of multiple signatures in extended
... ...
@@ -289,20 +291,141 @@ cf43987e4f519d629b103375;SL+550:6300680065005c0046006900
289 289
     information and examples please see
290 290
     \url{https://wwws.clamav.net/bugzilla/show_bug.cgi?id=164}.
291 291
 
292
+    \subsection{Icon signatures for PE files}
293
+    ClamAV 0.96 includes an approximate/fuzzy icon matcher to help
294
+    detecting malicious executables disguising themselves as innocent
295
+    looking image files, office documents and the like.
296
+
297
+    Icon matching is only triggered via .ldb signatures using the special
298
+    attribute tokens \verb+IconGroup1+ or \verb+IconGroup2+. These identify
299
+    two (optional) groups of icons defined in a .idb database file. The
300
+    format of the .idb file is:
301
+    \begin{verbatim}
302
+ICONNAME:GROUP1:GROUP2:ICON_HASH
303
+    \end{verbatim}
304
+    where:
305
+    \begin{itemize}
306
+	\item \verb+ICON_NAME+ is a unique string identifier for a specific
307
+	icon,
308
+	\item \verb+GROUP1+ is a string identifier for the first group of
309
+	icons (\verb+IconGroup1+)
310
+	\item \verb+GROUP2+ is a string identifier for the second group of
311
+	icons (\verb+IconGroup2+),
312
+	\item \verb+ICON_HASH+ is a fuzzy hash of the icon image
313
+    \end{itemize}
314
+    The \verb+ICON_HASH+ field can be obtained from the debug output of
315
+    libclamav. For example:
316
+    \begin{verbatim}
317
+LibClamAV debug: ICO SIGNATURE:
318
+ICON_NAME:GROUP1:GROUP2:18e2e0304ce60a0cc3a09053a30000414100057e
319
+000afe0000e 80006e510078b0a08910d11ad04105e0811510f084e01040c080
320
+a1d0b0021000a39002a41
321
+    \end{verbatim}
322
+
323
+    \subsection{Signatures for Version Information metadata in PE files}
324
+    Starting with ClamAV 0.96 it is possible to easily match certain
325
+    information built into PE files (executables and dynamic link libraries).
326
+    Whenever you lookup the properties of a PE executable file in windows,
327
+    you are presented with a bunch of details about the file itself.
328
+
329
+    These info are stored in a special area of the file resources which goes
330
+    under the name of \verb+VS_VERSION_INFORMATION+ (or versioninfo for short).
331
+    It is divided into 2 parts. The first part (which is rather uninteresting)
332
+    is really a bunch of numbers and flags indicating the product and file
333
+    version. It was originally intended for use with installers which, after
334
+    parsing it, should be able to determine whether a certain executable or
335
+    library are to be upgraded/overwritten or are already up to date. Suffice
336
+    to say, this approach never really worked and is generally never used.
337
+
338
+    The second block is much more interesting: it is a simple list of key/value
339
+    strings, intended for user information and completely ignored by the OS.
340
+    For example, if you look at ping.exe you can see the company being \emph{"Microsoft
341
+    Corporation"}, the description \emph{"TCP/IP Ping command"}, the internal name
342
+    \emph{"ping.exe"} and so on... Depending on the OS version, some keys may be given
343
+    peculiar visibility in the file properties dialog, however they are internally
344
+    all the same.
345
+
346
+    To match a versioninfo key/value pair, the special file offset anchor \verb+VI+ was
347
+    introduced.  This is similar to the other anchors (like \verb+EP+ and \verb+SL+)
348
+    except that, instead of matching the hex pattern against a single offset, it checks
349
+    it against each and every key/value pair in the file. The \verb+VI+ token doesn't
350
+    need nor accept a \verb#+/-# offset like e.g. \verb#EP+1#. As for the hex signature
351
+    itself, it's just the utf16 dump of the key and value. Only the \verb+??+ and
352
+    \verb+(aa|bb)+ wildcards are allowed in the signature. Usually, you don't need to
353
+    bother figuring it out: each key/value pair together with the corresponding VI-based
354
+    signature is printed by \verb+clamscan+ when the \verb+--debug+ option is given.
355
+
356
+    For example \verb+clamscan --debug freecell.exe+ produces:
357
+    \begin{verbatim}
358
+[...]
359
+Recognized MS-EXE/DLL file
360
+in cli_peheader
361
+versioninfo_cb: type: 10, name: 1, lang: 410, rva: 9608
362
+cli_peheader: parsing version info @ rva 9608 (1/1)
363
+VersionInfo (d2de): 'CompanyName'='Microsoft Corporation' -
364
+VI:43006f006d00700061006e0079004e0061006d006500000000004d006900
365
+630072006f0073006f0066007400200043006f00720070006f0072006100740
366
+069006f006e000000
367
+VersionInfo (d32a): 'FileDescription'='Entertainment Pack
368
+FreeCell Game' - VI:460069006c006500440065007300630072006900700
369
+0740069006f006e000000000045006e007400650072007400610069006e006d
370
+0065006e00740020005000610063006b0020004600720065006500430065006
371
+c006c002000470061006d0065000000
372
+VersionInfo (d396): 'FileVersion'='5.1.2600.0 (xpclient.010817
373
+-1148)' - VI:460069006c006500560065007200730069006f006e00000000
374
+0035002e0031002e0032003600300030002e003000200028007800700063006
375
+c00690065006e0074002e003000310030003800310037002d00310031003400
376
+380029000000
377
+VersionInfo (d3fa): 'InternalName'='freecell' - VI:49006e007400
378
+650072006e0061006c004e0061006d006500000066007200650065006300650
379
+06c006c000000
380
+VersionInfo (d4ba): 'OriginalFilename'='freecell' - VI:4f007200
381
+6900670069006e0061006c00460069006c0065006e0061006d0065000000660
382
+0720065006500630065006c006c000000
383
+VersionInfo (d4f6): 'ProductName'='Sistema operativo Microsoft
384
+Windows' - VI:500072006f0064007500630074004e0061006d00650000000
385
+000530069007300740065006d00610020006f00700065007200610074006900
386
+76006f0020004d006900630072006f0073006f0066007400ae0020005700690
387
+06e0064006f0077007300ae000000
388
+VersionInfo (d562): 'ProductVersion'='5.1.2600.0' - VI:50007200
389
+6f006400750063007400560065007200730069006f006e00000035002e00310
390
+02e0032003600300030002e0030000000
391
+[...]
392
+    \end{verbatim}
393
+Although VI-based signatures are intended for use in logical signatures you can test them
394
+using ordinary \verb+.ndb+ files. For example:
395
+    \begin{verbatim}
396
+my_test_vi_sig:1:VI:paste_your_hex_sig_here
397
+    \end{verbatim}
398
+Final note. If you want to decode a VI-based signature into a human readable form you can use:
399
+    \begin{verbatim}
400
+echo hex_string | xxd -r -p | strings -el
401
+    \end{verbatim}
402
+For example:
403
+    \begin{verbatim}
404
+$ echo 460069006c0065004400650073006300720069007000740069006f006e
405
+000000000045006e007400650072007400610069006e006d0065006e007400200
406
+05000610063006b0020004600720065006500430065006c006c00200047006100
407
+6d0065000000 | xxd -r -p | strings -el
408
+FileDescription
409
+Entertainment Pack FreeCell Game
410
+    \end{verbatim}
411
+
292 412
     \subsection{Signatures based on container metadata}
293 413
     ClamAV 0.96 allows creating generic signatures matching files stored
294 414
     inside different container types which meet specific conditions.
295 415
     The signature format is
296 416
 \begin{verbatim}
297
-VirusName:ContainerType:ContainerSize:FileNameREGEX:FileSizeInContainer:
298
-FileSizeReal:IsEncrypted:FilePos:Res1:Res2[:MinFL[:MaxFL]]
417
+VirusName:ContainerType:ContainerSize:FileNameREGEX:
418
+FileSizeInContainer:FileSizeReal:IsEncrypted:FilePos:
419
+Res1:Res2[:MinFL[:MaxFL]]
299 420
 \end{verbatim}
300 421
     where the corresponding fields are:
301 422
     \begin{itemize}
302 423
 	\item \verb+VirusName:+ Virus name to be displayed when signature matches
303 424
 	\item \verb+ContainerType:+ one of \verb+CL_TYPE_ZIP+, \verb+CL_TYPE_RAR+,
304
-	\verb+CL_TYPE_ARJ+, \verb+CL_TYPE_CAB+, \verb+CL_TYPE_7Z+,
305
-	\verb+CL_TYPE_MAIL+, \verb+CL_TYPE_(POSIX|OLD)_TAR+,
425
+	\verb+CL_TYPE_ARJ+,\\
426
+	\verb+CL_TYPE_CAB+, \verb+CL_TYPE_7Z+, \verb+CL_TYPE_MAIL+, \verb+CL_TYPE_(POSIX|OLD)_TAR+,\\
306 427
 	\verb+CL_TYPE_CPIO_(OLD|ODC|NEWC|CRC)+ or \verb+*+ to match
307 428
 	any of the container types listed here
308 429
 	\item \verb+ContainerSize:+ size of the container file itself (eg. size of
... ...
@@ -327,7 +450,8 @@ FileSizeReal:IsEncrypted:FilePos:Res1:Res2[:MinFL[:MaxFL]]
327 327
     The (now obsolete) archive metadata signatures can be only applied
328 328
     to ZIP and RAR files and have the following format:
329 329
 \begin{verbatim}
330
-virname:encrypted:filename:normal size:csize:crc32:cmethod:fileno:max depth
330
+virname:encrypted:filename:normal size:csize:crc32:cmethod:
331
+fileno:max depth
331 332
 \end{verbatim}
332 333
     where the corresponding fields are:
333 334
     \begin{itemize}
... ...
@@ -160,6 +160,21 @@ DatabaseMirror database.clamav.net
160 160
 # Default: disabled
161 161
 #DetectionStatsCountry country-code
162 162
 
163
+# This option enables support for our "Personal Statistics" service. 
164
+# When this option is enabled, the information on malware detected by
165
+# your clamd installation is made available to you through our website.
166
+# To get your HostID, log on http://www.stats.clamav.net and add a new
167
+# host to your host list. Once you have the HostID, uncomment this option
168
+# and paste the HostID here. As soon as your freshclam starts submitting
169
+# information to our stats collecting service, you will be able to view
170
+# the statistics of this clamd installation by logging into
171
+# http://www.stats.clamav.net with the same credentials you used to
172
+# generate the HostID. For more information refer to:
173
+# http://www.clamav.net/support/faq/faq-cctts/
174
+# This feature requires SubmitDetectionStats to be enabled.
175
+# Default: disabled
176
+#DetectionStatsHostID unique-id
177
+
163 178
 # This option enables support for Google Safe Browsing. When activated for
164 179
 # the first time, freshclam will download a new database file (safebrowsing.cvd)
165 180
 # which will be automatically loaded by clamd and clamscan during the next
... ...
@@ -373,7 +373,7 @@ const struct clam_option __clam_options[] = {
373 373
 
374 374
     { "DetectionStatsCountry", NULL, 0, TYPE_STRING, NULL, -1, NULL, 0, OPT_FRESHCLAM, "Country of origin of malware/detection statistics (for statistical\npurposes only). The statistics collector at ClamAV.net will look up\nyour IP address to determine the geographical origin of the malware\nreported by your installation. If this installation is mainly used to\nscan data which comes from a different location, please enable this\noption and enter a two-letter code (see http://www.iana.org/domains/root/db/)\nof the country of origin.", "country-code" },
375 375
 
376
-    { "DetectionStatsHostID", NULL, 0, TYPE_STRING, NULL, -1, NULL, 0, OPT_FRESHCLAM, "FIXME: Add description", "unique-id" },
376
+    { "DetectionStatsHostID", NULL, 0, TYPE_STRING, NULL, -1, NULL, 0, OPT_FRESHCLAM, "This option enables support for our \"Personal Statistics\" service.\nWhen this option is enabled, the information on malware detected by\nyour clamd installation is made available to you through our website.\nTo get your HostID, log on http://www.stats.clamav.net and add a new\nhost to your host list. Once you have the HostID, uncomment this option\nand paste the HostID here. As soon as your freshclam starts submitting\ninformation to our stats collecting service, you will be able to view\nthe statistics of this clamd installation by logging into\nhttp://www.stats.clamav.net with the same credentials you used to\ngenerate the HostID. For more information refer to:\nhttp://www.clamav.net/support/faq/faq-cctts/\nThis feature requires SubmitDetectionStats to be enabled.", "unique-id" },
377 377
 
378 378
     { "SafeBrowsing", NULL, 0, TYPE_BOOL, MATCH_BOOL, 0, NULL, 0, OPT_FRESHCLAM, "This option enables support for Google Safe Browsing. When activated for\nthe first time, freshclam will download a new database file (safebrowsing.cvd)\nwhich will be automatically loaded by clamd and clamscan during the next\nreload, provided that the heuristic phishing detection is turned on. This\ndatabase includes information about websites that may be phishing sites or\npossible sources of malware. When using this option, it's mandatory to run\nfreshclam at least every 30 minutes.\nFreshclam uses the ClamAV's mirror infrastructure to distribute the\ndatabase and its updates but all the contents are provided under Google's\nterms of use. See http://code.google.com/support/bin/answer.py?answer=70015\nand http://safebrowsing.clamav.net for more information.", "yes" },
379 379