Обновить README.md
This commit is contained in:
parent
bd10fad70a
commit
9ee9e34cd5
93
README.md
93
README.md
@ -1,29 +1,28 @@
|
||||
# cronodump
|
||||
|
||||
The cronodump utility can parse most of the databases created by the [CronosPro](https://www.cronos.ru/) database software
|
||||
and dump it to several output formats.
|
||||
Утилита **cronodump** может анализировать большинство баз данных, созданных с помощью программного обеспечения [CronosPro](https://www.cronos.ru/), и экспортировать их в несколько выходных форматов.
|
||||
|
||||
The software is popular among Russian public offices, companies and police agencies.
|
||||
Это программное обеспечение пользуется популярностью среди российских государственных учреждений, компаний и правоохранительных органов.
|
||||
|
||||
|
||||
# Quick start
|
||||
# Быстрый старт
|
||||
|
||||
In its simplest form, without any dependencies, the croconvert command creates a [CSV](https://en.wikipedia.org/wiki/Comma-separated_values) representation of all the database's tables and a copy of all files contained in the database:
|
||||
В своей самой простой форме, без каких-либо зависимостей, команда **croconvert** создаёт [CSV](https://ru.wikipedia.org/wiki/CSV)-представление всех таблиц базы данных, а также копию всех файлов, содержащихся в базе данных:
|
||||
|
||||
```bash
|
||||
bin/croconvert --csv test_data/all_field_types
|
||||
```
|
||||
|
||||
By default it creates a `cronodump-YYYY-mm-DD-HH-MM-SS-ffffff/` directory containing CSV files for each table found. It will under this directory also create a `Files-FL/` directory containing all the files stored in the Database, regardless if they are (still) referenced in any data table. All files that are actually referenced (and thus are known by their filename) will be stored under the `Files-Referenced` directory. With the `--outputdir` option you can chose your own dump location.
|
||||
По умолчанию создаётся каталог `cronodump-YYYY-mm-DD-HH-MM-SS-ffffff/`, содержащий CSV-файлы для каждой найденной таблицы. В этом каталоге также будет создана директория `Files-FL/`, содержащая все файлы, хранящиеся в базе данных, независимо от того, ссылаются ли они (до сих пор) на какие-либо данные в таблицах. Все файлы, которые фактически ссылаются (и, таким образом, известны по своим именам), будут сохранены в директории `Files-Referenced`. С помощью опции `--outputdir` можно выбрать место для сохранения дампа.
|
||||
|
||||
When you get an error message, or just unreadable data, chances are your database is protected. You may need to look into the `--dbcrack` or `--strucrack` options, explained below.
|
||||
Если вы получаете сообщение об ошибке или просто нечитаемые данные, вероятно, ваша база данных защищена. Вам может потребоваться изучить опции `--dbcrack` или `--strucrack`, которые описаны ниже.
|
||||
|
||||
|
||||
# Templates
|
||||
# Шаблоны
|
||||
|
||||
The croconvert command can use the powerful [jinja templating framework](https://jinja.palletsprojects.com/en/3.0.x/) to render more file formats like PostgreSQL and HTML.
|
||||
The default action for `croconvert` is to convert the database using the `html` template.
|
||||
Use
|
||||
Команда `croconvert` может использовать мощный [фреймворк шаблонов Jinja](https://jinja.palletsprojects.com/en/3.0.x/) для создания дополнительных форматов файлов, таких как PostgreSQL и HTML.
|
||||
|
||||
Действие по умолчанию для `croconvert` — это преобразование базы данных с использованием шаблона `html`. Для использования других шаблонов вы можете настроить параметры соответствующим образом.
|
||||
|
||||
```bash
|
||||
python3 -m venv ./venc
|
||||
@ -32,83 +31,70 @@ pip install jinja2
|
||||
bin/croconvert test_data/all_field_types > test_data.html
|
||||
```
|
||||
|
||||
to dump an HTML file with all tables found in the database, files listed and ready for download as inlined [data URI](https://en.wikipedia.org/wiki/Data_URI_scheme) and all table images inlined as well. Note that the resulting HTML file can be huge for large databases, causing a lot of load on browsers when trying to open them.
|
||||
чтобы выгрузить HTML-файл, содержащий все таблицы, найденные в базе данных, список файлов с возможностью их скачивания через встроенные [data URI](https://en.wikipedia.org/wiki/Data_URI_scheme), а также встроенные изображения из таблиц. Обратите внимание, что полученный HTML-файл может быть огромным для больших баз данных, что может вызвать значительную нагрузку на браузеры при попытке открыть его.
|
||||
|
||||
Команда `-t postgres` выведет схемы таблиц и записи в формате валидных выражений `CREATE TABLE` и `INSERT INTO` в стандартный поток вывода. Этот дамп затем можно импортировать в базу данных PostgreSQL. Учтите, что символ обратного слэша не экранируется, поэтому параметр [`standard_conforming_strings`](https://www.postgresql.org/docs/current/runtime-config-compatible.html#GUC-STANDARD-CONFORMING-STRINGS) должен быть отключён.
|
||||
|
||||
The `-t postgres` command will dump the table schemes and records as valid `CREATE TABLE` and `INSERT INTO` statements to stdout. This dump can then be imported in a PostgreSQL database. Note that the backslash character is not escaped and thus the [`standard_conforming_strings`](https://www.postgresql.org/docs/current/runtime-config-compatible.html#GUC-STANDARD-CONFORMING-STRINGS) option should be off.
|
||||
# Инспекция
|
||||
|
||||
Pull requests for [more templates supporting other output types](/templates) are welcome.
|
||||
Существует инструмент `bin/crodump`, предназначенный для дальнейшего изучения баз данных. Это может быть полезно для извлечения метаданных, таких как пути к файлам изображений таблиц или формы ввода и вывода. Не все метаданные пока полностью разобраны, поэтому может потребоваться опыт работы с бинарными дампами.
|
||||
|
||||
|
||||
# Inspection
|
||||
|
||||
There's a `bin/crodump` tool to further investigate databases. This might be useful for extracting metadata like path names of table image files or input and output forms. Not all metadata has yet been completely reverse engineered, so some experience with understanding binary dumps might be required.
|
||||
|
||||
The crodump script has a plethora of options but in the most basic for the `strudump` sub command will provide a rich variety of metadata to look further:
|
||||
Скрипт `crodump` предлагает множество опций, но в самом базовом виде команда `strudump` предоставляет обширный набор метаданных для дальнейшего анализа:
|
||||
|
||||
```bash
|
||||
bin/crodump strudump -v -a test_data/all_field_types/
|
||||
```
|
||||
The `-a` option tells strudump to output ascii instead of a hexdump.
|
||||
Опция `-a` указывает команде strudump выводить данные в ASCII вместо шестнадцатеричного дампа.
|
||||
|
||||
For a low level dump of the database contents, use:
|
||||
Для низкоуровневого дампа содержимого базы данных используйте:
|
||||
```bash
|
||||
bin/crodump crodump -v test_data/all_field_types/
|
||||
```
|
||||
The `-v` option tells crodump to include all unused byte ranges, this may be useful when identifying deleted records.
|
||||
Опция `-v` указывает crodump включать все неиспользуемые диапазоны байтов. Это может быть полезно для идентификации удалённых записей.
|
||||
|
||||
For a bit higher level dump of the database contents, use:
|
||||
Для более высокоуровневого дампа содержимого базы данных используйте:
|
||||
```bash
|
||||
bin/crodump recdump test_data/all_field_types/
|
||||
```
|
||||
This will print a hexdump of all records for all tables.
|
||||
Эта команда выведет шестнадцатеричный дамп всех записей для всех таблиц.
|
||||
|
||||
|
||||
## decoding password protected databases
|
||||
## Расшифровка защищённых паролем баз данных
|
||||
|
||||
Cronos v4 and higher are able to password protect databases, the protection works
|
||||
by modifying the KOD sbox. `cronodump` has two methods of deriving the KOD sbox from
|
||||
a database:
|
||||
|
||||
Both these methods are statistics based operations, it may not always
|
||||
yield the correct KOD sbox.
|
||||
Начиная с версии Cronos v4, базы данных могут быть защищены паролем. Эта защита работает за счёт изменения KOD sbox. Утилита `cronodump` предоставляет два метода для извлечения KOD sbox из базы данных:
|
||||
|
||||
Оба метода основаны на статистическом анализе и не всегда могут дать корректный результат.
|
||||
|
||||
### 1. strudump
|
||||
|
||||
When the database has a sufficiently large CroStru.dat file,
|
||||
it is easy to derive the nodified KOD-sbox from the CroStru file, the `--strucrack` option
|
||||
will do this.
|
||||
Если файл CroStru.dat в базе данных достаточно большой, то можно легко извлечь изменённый KOD-sbox из файла CroStru. Для этого используется опция `--strucrack`:
|
||||
|
||||
crodump --strucrack recdump <dbpath>
|
||||
|
||||
### 2. dbdump
|
||||
|
||||
When the Bank and Index files are compressed, we can derive the KOD sbox by inspecting
|
||||
the fourth byte of each record, which should decode to a zero.
|
||||
Если файлы Bank и Index сжаты, то KOD sbox можно извлечь путём анализа четвёртого байта каждой записи, который должен декодироваться в ноль.
|
||||
|
||||
The `--dbcrack` option will do this.
|
||||
Для этого используется опция `--dbcrack`
|
||||
|
||||
crodump --dbcrack recdump <dbpath>
|
||||
|
||||
|
||||
# Installing
|
||||
# Установка
|
||||
|
||||
`cronodump` requires python 3.7 or later. It has been tested on Linux, MacOS and Windows.
|
||||
There is one optional requirement: the `Jinja2` templating engine, but it will install fine without.
|
||||
`cronodump` требует Python версии 3.7 или выше. Программа протестирована на Linux, MacOS и Windows. Есть одно необязательное требование: использование движка шаблонов `Jinja2`, однако установка возможна и без него.
|
||||
|
||||
There are several ways of installing `cronodump`:
|
||||
Существует несколько способов установки `cronodump`:
|
||||
|
||||
* You can run `cronodump` directly from the cloned git repository, by using the shell scripts in the `bin` subdirectory.
|
||||
* You can install `cronodump` in your python environment by ruinning: `python setup.py build install`.
|
||||
* You can install `cronodump` from the public [pypi repository](https://pypi.org/project/cronodump/) with `pip install cronodump`.
|
||||
* You can install `cronodump` with the `Jinja2` templating engine from the public [pypi repository](https://pypi.org/project/cronodump/) with `pip install cronodump[templates]`.
|
||||
* Вы можете запускать `cronodump` напрямую из клонированного git-репозитория, используя скрипты в подкаталоге `bin`.
|
||||
* Вы можете установить `cronodump` в своей среде Python, запустив команду: `python setup.py build install`.
|
||||
* Вы можете установить `cronodump` из публичного from the public [pypi repository](https://pypi.org/project/cronodump/) с помощью команды `pip install cronodump`.
|
||||
* Вы можете установить `cronodump` вместе с движком шаблонов `Jinja2` из публичного [pypi repository](https://pypi.org/project/cronodump/) с помощью команды `pip install cronodump[templates]`.
|
||||
|
||||
|
||||
# Terminology
|
||||
# Терминология
|
||||
|
||||
We decided to use the more common terminology for database, tables, records, etc.
|
||||
Here is a table showing how cronos calls these:
|
||||
Мы решили использовать более общепринятую терминологию для обозначения баз данных, таблиц, записей и других элементов. Ниже представлена таблица, демонстрирующая, как Cronos называет эти элементы:
|
||||
|
||||
| what | cronos english | cronos russian
|
||||
|:------ |:------ |:------
|
||||
@ -121,12 +107,9 @@ Here is a table showing how cronos calls these:
|
||||
|
||||
# License
|
||||
|
||||
cronodump is released under the [MIT license](LICENSE).
|
||||
cronodump выпущен по лицензии [MIT license](LICENSE).
|
||||
|
||||
|
||||
# References
|
||||
# Ссылки
|
||||
|
||||
cronodump builds upon [documentation of the file format found in older versions of Cronos](http://sergsv.narod.ru/cronos.htm) and
|
||||
the [subsequent implementation of a parser for the old file format](https://github.com/occrp/cronosparser) but dropped the heuristic
|
||||
approach to guess offsets and obfuscation parameters for a more rigid parser. Refer to [the docs](docs/cronos-research.md) for further
|
||||
details.
|
||||
`cronodump` основан на [документации формата файлов, найденной в старых версиях Cronos](http://sergsv.narod.ru/cronos.htm), а также на [последующей реализации парсера для старого формата файлов](https://github.com/occrp/cronosparser). Однако вместо эвристического подхода для предположения смещений и параметров обфускации, используется более строгий парсер. Подробности можно найти в [документации](docs/cronos-research.md).
|
Loading…
Reference in New Issue
Block a user