AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 841495
Accepted
KaAzZ
KaAzZ
Asked: 2017-03-31 00:12:59 +0800 CST2017-03-31 00:12:59 +0800 CST 2017-03-31 00:12:59 +0800 CST

将文件/目录添加到 rkhunter 检查

  • 772

我的问题很简单,我很惊讶以前没有人问过这个问题。

如何将文件或目录添加到 rkhunter 检查?有了它,我可以看到我的目录出现在 'rkhunter --propupd' 命令中

希望有人能帮助我!祝你有美好的一天 :)

rkhunter
  • 1 1 个回答
  • 3990 Views

1 个回答

  • Voted
  1. Best Answer
    Lenniey
    2017-03-31T00:28:46+08:002017-03-31T00:28:46+08:00

    编辑:也许我把你弄糊涂了(当然我做了,我写了or而不是and ...)

    这是一步一步:

    mkdir /var/local/test
    touch /var/local/test/test.bla
    

    添加配置rkhunter.conf:

    USER_FILEPROP_FILES_DIRS="/var/local/test/test.bla"
    

    跑rkhunter --propupd

    运行rkhunter --check [--sk](如果你愿意,应该不返回错误或警告)

    编辑文件/var/local/test/test.bla

    跑rkhunter --check [--sk]

    我的输出:

    /bin/dash                                                [ OK ]
    
    /var/local/test/test.bla                                 [ Warning ]
    

    您还可以/var/local/test/*将该目录中的所有文件用作通配符。


    这是一个命令行参数--propupd:

    从手册页(强调我的)

    --propupd [{文件名| 目录| package name},...] rkhunter 执行的一项检查是将各种命令的各种当前文件属性与其先前存储的文件属性进行比较。此命令选项使 rkhunter 用当前值更新其存储值的数据文件。如果使用了 filename 选项,那么它必须是完整路径名或纯文件名(例如,'awk')。使用时,只会更新该文件的文件属性数据库中的条目。如果使用了目录选项,那么只有在给定目录中的数据库中列出的那些文件将被更新。类似地,如果使用包名称选项,则仅更新数据库中属于指定包的那些文件。包名称必须是名称的基础部分,不应包含版本号 - 例如,'coreutils'。当然,只有在使用包管理器时,包名称才会存储在文件属性数据库中。如果包名与文件名相同 - 例如,'file' 可以指代 'file' 命令或 RPM 'file' 包(包含 'file' 命令) - 将使用包名. 如果没有给出特定选项,则更新整个数据库。

    警告:用户有责任确保系统上的文件是真实的并且来自可靠的来源。rkhunter 只能报告文件是否已更改,但不能报告导致更改的原因。因此,如果文件已更改,并且使用了 --propupd 命令选项,则 rkhunter 将假定该文件是真实的。

    或者,当然,将其更改为rkhunter.conf:

    #
    # This option is a space-separated list of commands, directories and file
    # pathnames which will be included in the file properties checks.
    # This option can be specified more than once.
    #
    # Whenever this option is changed, 'rkhunter --propupd' must be run.
    #
    # Simple command names - for example, 'top' - and directory names are
    # added to the internal list of directories to be searched for each of
    # the command names in the command list. Additionally, full pathnames
    # to files, which need not be commands, may be given. Any files or
    # directories which are already part of the internal lists will be
    # silently ignored from the configuration.
    #
    # Normal globbing wildcards are allowed, except for simple command names.
    # For example, 'top*' cannot be given, but '/usr/bin/top*' is allowed.
    #
    # Specific files may be excluded by preceding their name with an
    # exclamation mark (!). For example, '!/opt/top'. By combining this
    # with wildcarding, whole directories can be excluded. For example,
    # '/etc/* /etc/*/* !/etc/rc?.d/*'. This will look for files in the first
    # two directory levels of '/etc'. However, anything in '/etc/rc0.d',
    # '/etc/rc1.d', '/etc/rc2.d' and so on, will be excluded.
    #
    # NOTE: Only files and directories which have been added by the user,
    # and are not part of the internal lists, can be excluded. So, for
    # example, it is not possible to exclude the 'ps' command by using
    # '!/bin/ps'. These will be silently ignored from the configuration.
    #
    #USER_FILEPROP_FILES_DIRS="top /usr/local/sbin !/opt/ps*"
    #USER_FILEPROP_FILES_DIRS="/etc/rkhunter.conf"
    #USER_FILEPROP_FILES_DIRS="/etc/rkhunter.conf.local"
    #USER_FILEPROP_FILES_DIRS="/var/lib/rkhunter/db/*"
    #USER_FILEPROP_FILES_DIRS="!/var/lib/rkhunter/db/mirrors.dat"
    #USER_FILEPROP_FILES_DIRS="!/var/lib/rkhunter/db/rkhunter*"
    #USER_FILEPROP_FILES_DIRS="/var/lib/rkhunter/db/i18n/*"
    

    这应该将其添加到 rkhunter 数据库中。

    • 2

相关问题

  • rkhunter:几天后,我收到“系统已更改为自上次运行以来不使用预链接。”

  • rkhunter 报告文件属性的变化,但我没有看到它们已被 yum 更新

  • 百胜安装问题

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve