Quote: http://www.rtfiber.com.tw/~changyj/linuxtips/html/tripwire-easy.html

它能把檔案的特徵,如物件大小、擁有者、群組、存取權限等建立成指紋資料庫(fingerprints),並定期執行檢查。當發現檔案現況與指紋資料庫不符合時,tripwire 會提出警告,告知你哪些項目與指紋資料庫不符。

ChangeLog: 2007/06/10

Fedora Core 6
[1.] yum install tripwire

tripwire –version
Tripwire(R) 2.4.1.1 built for i686-pc-linux-gnu

[2.] Generate the system-specific cryptographic key files
/usr/sbin/tripwire-setup-keyfiles

———————————————-
The Tripwire site and local passphrases are used to sign a  variety  of
files, such as the configuration, policy, and database files.

Passphrases should be at least 8 characters in length and contain  both
letters and numbers.

See the Tripwire manual for more information.

———————————————-
Creating key files…

(When selecting a passphrase, keep in mind that good passphrases typically
have upper and lower case letters, digits and punctuation marks, and are
at least 8 characters in length.)

Enter the site keyfile passphrase:
Verify the site keyfile passphrase:
Generating key (this may take several minutes)…Key generation complete.

(When selecting a passphrase, keep in mind that good passphrases typically
have upper and lower case letters, digits and punctuation marks, and are
at least 8 characters in length.)

Enter the local keyfile passphrase:
Verify the local keyfile passphrase:
Generating key (this may take several minutes)…Key generation complete.

———————————————-
Signing configuration file…
Please enter your site passphrase:
Wrote configuration file: /etc/tripwire/tw.cfg

A clear-text version of the Tripwire configuration file:
/etc/tripwire/twcfg.txt
has been preserved for your inspection.  It  is  recommended  that  you
move this file to a secure location and/or encrypt it in place (using a
tool such as GPG, for example) after you have examined it.

———————————————-
Signing policy file…
Please enter your site passphrase:
Wrote policy file: /etc/tripwire/tw.pol

A clear-text version of the Tripwire policy file:
/etc/tripwire/twpol.txt
has been preserved for  your  inspection.  This  implements  a  minimal
policy, intended only to test  essential  Tripwire  functionality.  You
should edit the policy file to  describe  your  system,  and  then  use
twadmin to generate a new signed copy of the Tripwire policy.

Once you have a satisfactory Tripwire policy file, you should move  the
clear-text version to a secure location  and/or  encrypt  it  in  place
(using a tool such as GPG, for example).

Now run "tripwire –init" to enter Database Initialization  Mode.  This
reads the policy file, generates a database based on its contents,  and
then cryptographically signs the resulting  database.  Options  can  be
entered on the command line to specify which policy, configuration, and
key files are used  to  create  the  database.  The  filename  for  the
database can be specified as well. If no  options  are  specified,  the
default values from the current configuration file are used.

[3.] Initialize the Tripwire database file.
/usr/sbin/tripwire –init

Wrote database file: /var/lib/tripwire/ssorc.tw.twd
The database was successfully generated.

[4.] Run the first integrity check.
/usr/sbin/tripwire –check

——————————————————————————-
*** End of report ***

Tripwire 2.4 Portions copyright 2000 Tripwire, Inc. Tripwire is a registered
trademark of Tripwire, Inc. This software comes with ABSOLUTELY NO WARRANTY;
for details use –version. This is free software which may be redistributed
or modified only under certain conditions; see COPYING for details.
All rights reserved.
Integrity check complete.

[5.] view report
/usr/sbin/twprint -m r –twrfile /var/lib/tripwire/report/<name>.twr

[6] view database
/usr/sbin/twprint -m d –print-dbfile | less

[7.]update database
/usr/sbin/tripwire –update –twrfile /var/lib/tripwire/report/`hostname`.twr

[8.] update policy file
/usr/sbin/twadmin –print-polfile > /etc/tripwire/twpol.txt
/usr/sbin/twadmin –create-polfile -S site.key /etc/tripwire/twpol.txt
rm /var/lib/tripwire/`hostname`.twd
/usr/sbin/tripwire –init

[7.] Email
vi /etc/tripwire/twpol.txt

(
   rulename = "Networking Programs",
   severity = $(SIG_HI),
   emailto = cross@ssorc.tw;cross2@ssorc.tw # < 在想用 Email 通知的某個區塊加入這行
)

/usr/sbin/twadmin –print-polfile > /etc/tripwire/twpol.txt
/usr/sbin/twadmin –create-polfile -S site.key /etc/tripwire/twpol.txt
rm /var/lib/tripwire/`hostname`.twd
/usr/sbin/tripwire –init

[8.] test email
/usr/sbin/tripwire –test –email cross@ssorc.tw

[9.] update configuration file
/usr/sbin/twadmin –print-cfgfile > /etc/tripwire/twcfg.txt
/usr/sbin/twadmin –create-cfgfile -S site.key /etc/tripwire/twcfg.txt

詳細參考: /usr/share/doc/tripwire-2.4.1.1/README.Fedora

Related posts 相關文章
iScanner – 掃描你的網站有沒有惡意程式碼
More...
Yahoo、Google廣告平台會傳送惡意程式
More...
掃不到木馬不代表沒有木馬
More...
警告惡意網站
More...

作者

留言

撰寫回覆或留言

發佈留言必須填寫的電子郵件地址不會公開。