Дерево страниц

Сравнение версий

Ключ

  • Эта строка добавлена.
  • Эта строка удалена.
  • Изменено форматирование.
Комментарий: Published by Scroll Versions from space TMAG and version 7.15
Sv translation
languageru

Файл /opt/iw/tm5/etc/config-perm/bookworm/extractors.xml содержит настройки справочника и базу cигнатур, c помощью которых определяется тип файлов при распаковке архивов и вложений.

Scroll Table Layout
widths30%, 70%

Параметр

Описание и примеры настройки

FilenameCharsets

Если кодировка имени файла отличается от стандартной (ANSI, UTF), то файл будет обрабатываться как соответствующий кодировкам, указанным в данном параметре. Несколько значений перечисляются через запятую; Система будет последовательно пытаться обработать файл в перечисленных кодировках, пока не найдет похожую.

Значения по умолчанию – UTF-8, cp1251, cp866

MinFileSizeInBytes

Минимальный размер файла (в байтах), подлежащего распаковке. Это ограничение позволяет увеличить производительность Системы , за счет отказа от распаковки небольших файлов. 

Значение по умолчанию – 10

Примечание: 

  • Настройка настройка также распространяется на тип событий Буфер обмена, т. е. Система не анализирует текст из буфера обмена, если его объем менее указанного значения.;
  • Настройка настройка не распространяется на тип событий Ввод с клавиатуры.
  • для XML-экстрактора значение по умолчанию – 76 
MaxTextPlainSizeInKb

Верхняя граница размера файла, сигнатура которого не определена. При превышении порогового значения файл автоматически считается бинарным и не отправляется на анализ в iw_cas.

Значение по умолчанию – 25600

SpeedInKBs

Предположительная скорость работы экстрактора в расчете на 1 ГГц частоты процессора (в Кб/с). Может принимать целочисленные значения от 1 и выше.

Значение по умолчанию – 100

TimeoutInSec

Время ожидания до завершения обработки файла (в секундах).

Значение по умолчанию – 0

UseLog

Логирование экстрактора.

Значение по умолчанию – false

Если общие значения параметров, указанные в секции <extractor_defaults>, не подходят для каких-либо типов файлов, включите эти параметры в секции для нужных типов файлов с другими значениями.

Информация
titleПример:

Время работы экстрактора можно вычислить по формуле:

Время работы экстрактора = Размер файла в КБ / 1024 / ( SpeedInKBs * Тактовая_частота процессора в МГц / 1000)

Остальные секции содержат сигнатуры, при помощи которых детектируются типы файлов, находящиеся во вложениях и архивах. Секции имеют следующий набор параметров:

Scroll Table Layout
widths30%, 70%

Параметр

Описание и примеры настройки

Extension

Расширение файла архива. Необязательный параметр, необходим нужен для корректной работы некоторых архиваторов, которые требуют наличия правильного расширения входных файлов.

Пример: Ext = arj

Name

Имя формата. Используется для точного определения имени формата при распаковке файла.

Для определения/уточнения формата может включать также список имен: "defaultname, name1(code1), name2(code2)" 

В этом случае формат определяется на основании кода (codeN), присвоенного файлу при распаковке. Например, если распаковка завершается с кодом code1, то считается, что файл имеет формат name1. Список имен может также включать имя по умолчанию (defaultname), которое будет присваиваться в случаях, когда код не присвоен:

  • Пример 1 (одно имя формата): text/xml 
  • Пример 2 (список имен формата): "application/arj, UNKNOWN(9), text/encrypted(4)"

По умолчанию формат файла определяется как application/arj. Если формат архива не удается определить, ему присваивается имя UNKNOWN. Для зашифрованного архива используется имя формата text/encrypted.

Signature

Сигнатура формата, которая представляет собой "образцовую" последовательность значений (байтов) с начальным смещением и масками. Эта последовательность необходима нужна для однозначного определения формата файлов по их содержимому.

Сигнатура может включать до 16 триад вида [OFFSET]:BYTE_VALUE/[MASK]

Допускается также и строковая сигнатура, например , "BZh" для BZIP2. Эта сигнатура означает указанную последовательность байтов от смещения 0. Поиск строковых сигнатур выполняется без учета регистра символов.

Параметр OFFSET является необязательным. Для первого байта этот параметр по умолчанию равен 0, для всех последующих – увеличивается на единицу. Смещение можно задать с символом "?" – поиск образца в первых N байтах файла. Например, для поиска образца в первых 500 байтах файла, нужно задать смещение "500?".

Параметр MASK также является необязательным и равен 0xFF по умолчанию.

Пример (сигнатура заголовка WAV-формата): Sign = "'RIFF', 0x8: 'WAVEfmt'" 

Начиная от смещения 0, расположена последовательность 'R', 'I', 'F', 'F', далее от смещения 8 должно следовать 'W', 'A', 'V', 'E', 'f', 'm', 't'

Comment

Комментарий с пояснениями.

Пример (указание используемой версии архиватора): Comment = "bzip2 v. 1.0.x"

Command

Строка команды для извлечения файлов.

Пример:

Extract = "/usr/bin/bzip2 -f -dc ${SRC} > ${OUTDIR}/${SRC}"

где ${OUTDIR} – каталог, в который будет распакован архив, а ${SRC} – имя файла, который необходимо нужно распаковать.

ExcludeFromContext

Если параметр включен (true), то распаковка объекта выполняется, но информация об архиваторе не добавляется в XML-контекст объекта. Это позволяет не отображать в контексте объекта фиктивные контейнеры типа MS-TNEF. По умолчанию параметр включен.

CaseInsensitive

Учет регистра символов при обработке файла.

Значение по умолчанию – false

CreateTags

Извлечение метаинформации из файла.

Значение по умолчанию – true

Archive

Регламентирует вид извлеченной информации:

  • true – файлы;
  • false – данные.
PIRegexp

Содержит описание сигнатуры PIRE для детектирования формата файла. Может быть указан несколько раз в пределах одного Extractor. Имеет атрибуты:

  • assurance – достоверность определения формата файла этой сигнатурой;
  • offset – смещение, на котором нужно начинать поиск этой сигнатуры;
  • max_length – длина проверяемого участка;
  • case_sensitive – включение значимости регистра букв в описании сигнатуры.
DetectableByRegexp

Может использоваться для отключения детектирования формата с помощью PIRE (для него будут использоваться сигнатуры из Signature).

OpenFifoRetryTimeoutТаймаут между попытками открыть FIFO-очередь.
OpenFifoRetryCountКоличество попыток открыть FIFO-очередь.
ResultCharsetУказывает кодировку извлеченного экстрактором текста.
NeedProcessТребуется ли отправлять на анализ файлы с указанным MIME-типом отправлять на анализ.
Информация
titleПримечание:

Некоторые перехваченные файлы формата XML могут содержать чувствительные данные, которые указаны внутри XML-тэгов разметки файла. По умолчанию Система не извлекает текст из них. Чтобы настроить извлечение текста из XML-тэгов:

  1. Откройте на редактирование файл /opt/iw/tm5/etc/config-perm/bookworm/extractors.xml

  2. Найдите элемент со следующим содержанием:

    Блок кода
    languagetext
    <Command>bin/text-extractor -t xml -i ${OUTDIR}</Command>
  3. Замените параметр -t xml на -t xmltxt
  4. Сохраните изменения и закройте файл.

  5. Обновите конфигурацию процесса iw_bookworm, выполнив команду:

    Блок кода
    languagetext
    iwtm reload bookworm
  6. Перезапустите процессы:

    Блок кода
    languagetext
    iwtm restart analysis
    iwtm restart messed
    iwtm restart icap

    В результате  в извлеченном тексте будут видны XML-тэги и прочая служебная информация, которая не сохраняется при стандартном способе извлечения текста из XML.

Sv translation
languageen

The /opt/iw/tm5/etc/config-perm/bookworm/extractors.xml file contains directory settings and signatures base which define file types when unpacking archives and enclosures.

Scroll Table Layout
widths30%, 70%

Parameter

Description and configuration examples

FilenameCharsets

If file name encoding differs from the standard one (ANSI, UTF) then the filename processes as corresponding to encodings listed in this setting. Several values are listed comma separated; the System sequentially tries to process the filename in listed encodings while it finds a matched one. GHz

The default values are UTF-8, cp1251, cp866

MinFileSizeInBytes

Minimum file size (in bytes) subjected to unpacking. This limit lets you increase the System performance due by avoiding to refusing of unpack small files unpacking. 

The default value is 10

Note:

  • The the setting also applies to Clipboard events, i.e. the System does not process clipboard text if its volume is less than the value specified.;
  • The the setting does not apply to Keylogger events.;
  • for the XML extractor, the default value is 76 
MaxTextPlainSizeInKb

Maximum size of a file whose signature is not defined. Exceeding When the threshold value is exceeded, the file is automatically considered to be binary and is not sent to iw_cas.

The default value is 25600

SpeedInKBs

Proposed extractor’s operation speed per 1 GHz of the processor (in Kb/s). Can take integer values from 1 and greater. <TimeoutInSec>

The default value is 100

TimeoutInSec

Awaiting Waiting time till file processing ends (in seconds).

The default value is 0

UseLog

Logging extractorExtractor logging.

The default value is false

If the general values of parameters , which are specified in the <extractor_defaults> section, section are not appropriated appropriate for some file types, then enable these parameters in sections of needed the section for required file types with other different values.

Информация
titleExample:

The You can calculate the extractor operating time can be calculated by the formula:

The extractor operating time = File size in KB / 1024 / (SpeedInKBs  * CPU clock speed in MHz / 1000)

Other sections define signatures used for detection of file types from archives and enclosures. Each section contains the same following set of parameters:

Scroll Table Layout
widths30%, 70%

Parameter

Description and configuration examples

Extension

Extension of archive files. Optional parameter which is needed for correct operation of some archiving utilities requiring correct extensions of incoming files

Example: Ext = arj

Name

Format name. Used for exact detection of format name when file unpacking files.

To define detection/detailing of format the setting specify the format, can include a list of names: "defaultname, name1(code1), name2(code2)"

In this case, the format can be defined basing based on the code (codeN) assigned to the file when unpacking. For example, if the unpacking is ended with code1, the file is considered as having name1 format. The list of names can include a default name (defaultname) which will be assigned when the code is not assigned:

  • Example 1 (one format name): text/xml
  • Example 2 (list of format names):"application/arj, UNKNOWN(9), text/encrypted(4)"

By default, the file format is defined as application/arj. Two others for specific cases are: unknown format (UNKNOWN), encrypted format (text/encrypted)If the archive format cannot be determined, it is assigned the name UNKNOWN. For encrypted archives, the format name text/encrypted is used.

Signature

Format signature which is 'standard' a "sample" sequence of values (bytes) with initial displacement offset and masks. This sequence is needed for unambiguous definition of files format by the content of those files.

The signature can include up to 16 triades triads of the following format:

[OFFSET]:BYTE_VALUE/[MASK]

There can be a string signature like "BZh" for BZIP2. This signature means specified bytes sequence from offset 0 displacement. The search of string signatures is not case-sensitive.

The OFFSET setting is optional. By default, it equals 0 for the first byte and increases by 1 for each later one. The displacement can be specified using 'symbol "?' symbol " – searching of the pattern in the first N bytes of a file. For example, to search for a pattern in the first 500 bytes of a file, you should specify the offset '500?' displacement.

The MASK setting is optional and equals to 0xFF by default.

Example  (signature of a heading header of a WAV format): Sign = "'RIFF', 0x8: 'WAVEfmt'"

Starting from offset 0 displacement, there is a sequence 'R', 'I', 'F', 'F', then from offset 8 displacement there should be 'W', 'A', 'V', 'E', 'f', 'm', 't'

Comment

The explanation commentary.

Example (indicating the version of archiving utility): Comment = "bzip2 v. 1.0.x"

Command

Command string for file extracting.

Example:

Extract = "/usr/bin/bzip2 -f -dc ${SRC} > ${OUTDIR}/${SRC}"

Where ${OUTDIR} is is a catalogue where to the archive will be extracted and ${SRC} is a name of a file to unpack.

ExcludeFromContext

If the parameter is enabled (true), then the file object is unpacked but information on archiving utility is not added to the object’s XML-context. This lets to exclude fictional containers like MS-TNEF from the object’s context. By default, the parameter is enabled.

CaseInsensitive

Indicates whether file processing is case-sensitive.

The default value is false

CreateTags

Indicates whether to extract metadata from a file.

The default value is true

Archive

Regulates the kind of retrieved information:

  • true – files;
  • false – data.

PIRegexp

Contains a description of PIRE signature for file format detection. Can be specified several times within the same Extractor. Includes the following attributes:

  • assurance – the accuracy of detecting file format with this signature;
  • offset – offset where to start searching for the signature;
  • max_length – the length of the section to be checked;
  • case_sensitive – enables case sensitivity in the signature description.

DetectableByRegexp

Allows you to disable format detection by means of PIRE (instead, signatures from Signature will be used).

OpenFifoRetryTimeout

Timeout during few attempts to open a FIFO queue.

OpenFifoRetryCount

Number of attempts to open the FIFO queue.

ResultCharset

Specifies the code of extracted text.

NeedProcess

If the files with MIME type specified should be sent for analysis.
Информация
titleNote:

Some intercepted files of XML format may contain sensitive data specified within XML tags of file markup. By default, the System does not extract text from tags. To configure text extraction from XML tags:

  1. Open the /opt/iw/tm5/etc/config-perm/bookworm/extractors.xml file  file for editing.
  2. Find the element with the following contents:

    Блок кода
    languagetext
    <Command>bin/text-extractor -t xml -i ${OUTDIR}</Command>
  3. Replace -t xml parameter with -t xmltxt.
  4. Save the changes and close the file.
  5. Reload the configuration of the iw_bookworm process by running the command:

    Блок кода
    languagetext
    iwtm reload bookworm
  6. Restart the processes:

    Блок кода
    languagetext
    iwtm restart analysis
    iwtm restart messed
    iwtm restart icap

    As a result, the extracted text will include XML text contains tags and other service information , which that is not saved by default text extraction method for preserved in the standard method of extracting text from XML.