Skip to content
KitploitKITPLOIT
工具漏洞利用博客
Log in
提交
工具漏洞利用博客
提交

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

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

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

工具目录

分类

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

lunar

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

查看仓库
31662201天前Kitploit 审核通过

最受欢迎

查看全部 →

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

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

alt tag

LUNAR

Lockdown UNix 审计与报告

版本

当前版本 15.9.3

有关最新版本信息,请参阅 lunar.sh 和 CHANGELOG.md

许可证

CC BY-NC-SA: https://creativecommons.org/licenses/by-nc-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(未完成)
    • Storage(未完成)
    • Compute(未完成)
  • 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

用法

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

示例

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

./lunar.sh --audit

列出测试:

./lunar.sh --tests

列出 AWS 测试:

./lunar.sh --tests aws

执行特定测试:

./lunar.sh --audit --select remote_shell

创建 Ubuntu 24.04 multipass VM 用于测试:

./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。

下载工具