Skip to content
KitploitKITPLOIT
工具博客
提交
工具博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

··订阅源·联系·隐私·© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
lunar — 基于多个安全框架的UNIX安全审计工具 | Kitploit
工具/GitHubGitHub/lateralblast/lunar
漏洞扫描器配置审计云安全
GitHublateralblast/lunar

lunar

基于多个安全框架的UNIX安全审计工具

查看仓库
316625个月前Kitploit 审核通过

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

alt tag

LUNAR

锁定 Unix 审计与报告

版本

当前版本 15.9.1

请参考 lunar.sh 和更新日志以获取最新版本信息

许可证

CC BY-SA:https://creativecommons.org/licenses/by-sa/4.0/

在此赞助我:https://ko-fi.com/richardatlateralblast

** 注意 **

请仅以审计模式运行此脚本,例如使用 -a 或 --audit 参数。 自行承担锁定风险。如同任何系统更改,请做好备份。 我正在改进恢复模式,但仍可能存在缺陷。

我已尽可能使用 shellcheck 清理此脚本, 并启用了 -e(errexit)和 -u(nounset)shell 标志 以帮助防范错误。通过使用 -Q 或 --debug 标志可启用 -x(xtrace)shell 标志。

状态

进行中:

  • 更灵活的报告格式(例如 CSV)
  • 更多内联文档和文档输出
  • 添加 Azure 支持(当前重点)
  • 添加 Kubernetes 支持
  • 添加 Apache 支持

介绍

此脚本生成 Unix 主机安全性的评分审计报告。 它基于 CIS 及其他框架。在可能的情况下, 代码文档中引用了 CIS 和其他基准。

为什么选择 shell 脚本?我希望有一个工具能够在其他工具可能不可用的锁定系统上运行。 我还希望该工具能在所有版本的 UNIX 上运行。 尽管如此,sh 和 bash 之间存在一些差异, 因此我只使用了 sh 中的函数。

此脚本不提供任何明示或暗示的保证。 我建议仅以审计模式使用此脚本, 并通过策略、文档和配置管理单独处理每个警告。

我绝不是编码人员,因此脚本中必定存在缺陷和更好的处理方法, 衷心感谢为此代码中缺陷/功能提供反馈、更新和补丁的人们。

它也可以执行锁定。与其他一些脚本不同,我添加了 回滚更改的功能。文件使用 cpio 备份到基于日期的目录中。

虽然它可以执行锁定,但如前所述,我建议您 通过策略、文档和配置管理来处理警告。 这就是我使用该工具的方式。AWS 服务审计仅支持报告, 不提供锁定功能。

支持的操作系统

支持以下操作系统:

  • Linux
    • Rocky Linux
    • RHEL
    • CentOS
    • Scientific Linux
    • SLES
    • Debian
    • Ubuntu
    • Amazon Linux
  • Solaris
  • Mac OS X
  • FreeBSD(需要更多测试)
  • AIX(需要更多测试)
  • ESXi(初步支持 - 部分测试)

Windows 支持需要安装额外软件,因此我尚未研究。 尽管如此,未来可能通过 bash 提供 Windows 支持。

支持的服务

支持以下服务:

  • AWS
  • Azure
    • Entra ID(未完成)
    • 存储(未完成)
    • 计算(未完成)
  • Docker
  • Kubernetes(未完成)
  • Apache(未完成)

AWS 服务审计使用 AWS CLI,因此需要具有适当权限的用户。 它目前不支持锁定功能,仅支持根据 CIS 基准生成审计报告。

有一些检查只能通过 GUI 完成或解决。 例如启用计费。有关更多信息,请参阅 CIS 基准。

在可能的情况下,我已在详细审计输出中放置了建议的修复命令。 同样,在某些情况下,这些只能通过 CLI 完成。请参阅 CIS 基准了解更多信息。

此外,我添加了推荐模式,用于根据 Cloud Conformity 等公司公开提供的最佳实践检查 AWS。

配置管理

支持以下配置管理输出:

  • Ansible

此选项输出示例 Ansible 配置管理代码/代码段,用于实施建议。

要求

对于 UNIX:

  • Ubuntu / Debian
    • sysv-rc-conf
    • bc
    • finger

对于 AWS:

  • AWS
    • AWS CLI
    • AWS 凭证(API 访问密钥和秘密密钥)
    • 对相应 AWS 服务的读取权限,例如:
      • CloudTrail:DescribeTrails
      • Config:DescribeConfigurationRecorders
      • SNS:ListSubscriptionsByTopic

对于 Azure:

  • Azure
    • Azure CLI
    • 扩展
      • databricks
      • bastion
      • resource-graph
      • application-insights

用法

root@kitploit:~
Usage: ./lunar.sh -switch|--switch

switch(es):
-----------
-1|--list)
  List changes/backups
-2|--tests)
  Print tests
-3|--printfunct)
  Print function
-4|--dryrun)
  Run in dryrun mode
-6|--format)
  Outpt format/type
-7|--file)
  Output file
-8|--usesudo)
  Use sudo
-9|--shellcheck)
  Run shellcheck against script
-0|--force)
  Force action
-a|--audit)
  Run in audit mode (for Operating Systems - no changes made to system)
-A|--fullaudit)
  Run in audit mode and include filesystems (for Operating Systems - no changes made to system)
-b|--backups|--listbackups)
  List backups
-B|--basedir)
  Set base directory
-c|--codename|--distro)
   Distro/Code name (used with docker/multipass)
-C|--shell)
  Run docker-compose testing suite (drops to shell in order to do more testing)
-d|--dockeraudit)
  Run in audit mode (for Docker - no changes made to system)
-D|--dockertests)
  List all Docker functions available to selective mode
-e|--host)
  Run in audit mode on external host (for Operating Systems - no changes made to system)
-E|--hash|--passwordhash)
  Password hash
-f|--action)
  Action (e.g delete - used with multipass)
-F|--tempfile)
  Temporary file to use for operations
-g|--giturl)
  Git URL for code to copy to container
-G|--wheelgroup)
  Set wheel group
-h|--help)
  Display help
-H|--usage)
  Display usage
-i|--anacron)
  Enable/Disable anacron
-I|--type)
  Audit type
-k|--kubeaudit)
  Run in audit mode (for Kubernetes - no changes made to system)
-K|--function|--test)
  Do a specific function
-l|--lockdown)
  Run in lockdown mode (for Operating Systems - changes made to system)
-L|--fulllockdown|fulllock)
  Run in lockdown mode (for Operating Systems - changes made to system)
-m|--machine|--vm)
  Set virtualisation type
-M|--workdir)
  Set work directory
-n|--ansible)
  Output ansible
-N|--nocat)
  Do output cat in score
-o|--os|--osver)
  Set OS version
-O|--osinfo|--systeminfo)
  Print OS/System information
-p|--previous)
  Print previous audit information
-P|--sshsandbox|--sandbox)
  Enable/Disabe SSH sandbox
-q|--quiet|--nostrict)
  Run in quiet mode
-Q|--debug)
  Run in debug mode
-r|--awsregion|--region)
  Set AWS region
-R|--moduleinfo|--testinfo)
  Print information about a module
-s|--select|--check)
  Run in selective mode (only run tests you want to)
-S|--unixtests|--unix)
  List UNIX tests
-t|--tag|--name)
  Set docker tag
-T|--tempdir)
  Set temp directoru
-u|--undo)
  Undo lockdown (for Operating Systems - changes made to system)
-U|--dofiles)
  Include filesystems
-v|--verbose)
  Run in verbose mode
-V|--version)
  Print version
-w|--awsaudit)
  Run in audit mode (for AWS - no changes made to system)
-W|--awstests|--aws)
  List all AWS functions available to selective mode
-x|--awsrec)
  Run in recommendations mode (for AWS - no changes made to system)
-X|--strict)
  Run shellcheck against script
-z)
  Run specified audit function in lockdown mode
-Z|--changes|--listchanges)
  List changes

示例

执行完整审计(不含递归文件系统检查):

root@kitploit:~
./lunar.sh --audit

列出测试:

root@kitploit:~
./lunar.sh --tests

列出 AWS 测试:

root@kitploit:~
./lunar.sh --tests aws

执行特定测试:

root@kitploit:~
./lunar.sh --audit --select remote_shell

为测试创建 Ubuntu 24.04 multipass 虚拟机:

root@kitploit:~
./lunar.sh --action create --machine multipass --osver 24.04 

更多信息

更多信息请参阅 Wiki:

Wiki

Usage

Ansible

Ubuntu

Solaris 11

CentOS

Amazon Linux

AWS

Docker

测试

添加了一个简单的测试框架,用于调试 lunar 脚本本身。 它使用 docker compose 启动一个容器,挂载 lunar 目录并运行 lunar。

下载工具