Страница 1 из 1
md5 слепок системы
Добавлено: 2008-04-14 10:23:17
sitnin
Вспомнил про довольно эффективную (в прошлом) под ДОСом технологию детектирования всяких ненужных изменений в файлах: получение хэша отслеживаемых файлов. Вспомнил, правда, не для защиты, а чтобы самому не забывать, что менял.
Вопрос в следующем: существует ли какой-то стандартное решения для получения хэша всех файлов, или
единственный способ?
Re: md5 слепок системы
Добавлено: 2008-04-14 11:35:01
hizel
буббльгум
Код: Выделить всё
> cd /usr/ports/security/bubblegum/
> cat pkg-descr
Bubblegum is a daemon which watches a file for changes in access, modification
and inode change times and MD5 checksums. It can run a command upon a change
a specified number of times, read from a file list and more.
WWW: http://bjk.sourceforge.net/
Re: md5 слепок системы
Добавлено: 2008-04-14 11:47:02
sitnin
hizel писал(а):буббльгум
производительность жрёт?
Re: md5 слепок системы
Добавлено: 2008-04-14 12:03:29
hizel
зависит от настройки
man bubblegum
-a Check the acces time of the file.
-m Check the modification time of the file.
-c Check the inode change time of the file.
-M Check the MD5 checksum of the file. The files checksum is updated
after detecting a change. The files modification time is used as the
time difference. Note that both MD5 and access time checking -a can-
not be specified because MD5 checking modifies the access time. Also
note that this option increases CPU overhead significantly, escpe-
cially with a short time interval and lots of files. This option is
only available if compiled with libmd support.
что то меня на цитирование man-ов сегодня прет

Re: md5 слепок системы
Добавлено: 2008-04-14 12:05:45
sitnin
Похоже, что find для меня действительно наиболее оптимальный выход. Если запоминать, когда проводился последний скан системы, то можно воспользоваться фильтром ctime. Например, так:
Выведет список всех файлов, изменённых 5 дней назад или позже.
Re: md5 слепок системы
Добавлено: 2008-04-14 14:13:31
hizel
хозяин - барин
Re: md5 слепок системы
Добавлено: 2008-04-14 14:27:13
sitnin
hizel, я не к тому, что ваше предложение плохое. совершенно наоборот -- оно очень хорошее. настолько, что мне оказалось не нужно так делать. я просто хочу не потерять свои конфиги на машине.

Re: md5 слепок системы
Добавлено: 2008-04-16 9:02:19
Гость
открой для себя mtree(8)
Код: Выделить всё
> mtree -Kmd5digest -cp/usr/src/ | head -30
# user: user
# machine: host
# tree: /usr/src
# date: Wed Apr 16 10:00:45 2008
# .
/set type=file uid=0 gid=0 mode=0755 nlink=1 flags=none
. type=dir nlink=22 size=30 time=1208311640.149422700
COPYRIGHT mode=0644 size=6188 time=1199138959.0 \
md5digest=d2d92029600c9a96d3a140fc06a222a8
LOCKS mode=0644 size=458 time=1201212423.0 \
md5digest=b01e5fb847aa55cc2878194ef7d9a2a3
MAINTAINERS mode=0644 size=6881 time=1201384732.0 \
md5digest=c7a21da293269aab352731c7cd4824c5
Makefile mode=0644 size=11859 time=1206991861.924476478 \
md5digest=b300cdb8c87cf4e56913b84abe80bd8b
Makefile.inc1 \
mode=0644 size=38547 time=1208311640.146420363 \
md5digest=195b4ff91dda07a399ced3fb4dcfe686
ObsoleteFiles.inc \
mode=0644 size=196012 time=1207066254.340573734 \
md5digest=cb66fc57777b543ed692c9f5c3e1b994
README mode=0644 size=3077 time=1149651228.0 \
md5digest=51f6306a5e8b62498de382edc7ee8e84
UPDATING mode=0644 size=41407 time=1207738690.535579028 \
md5digest=36123c30967174fa9e04a2cdeb82990d
# ./bin
bin type=dir nlink=38 size=40 time=1205478339.94555144
Makefile mode=0644 size=606 time=1205478339.93553620 \
Re: md5 слепок системы
Добавлено: 2008-04-16 9:06:12
Гость
а вообще среди HIDS популярна tripwire, но я ее не пробовал
Re: md5 слепок системы
Добавлено: 2008-04-16 11:34:23
sitnin
Спасибо, попробую и то и другое.