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

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

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

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

工具目录

分类

查看所有分类
Loading categories
firejail — Linux 命名空间和 seccomp-bpf 沙箱 | Kitploit
工具/GitHubGitHub/netblue30/firejail
防御工具安全虚拟化隐私保护
GitHubnetblue30/firejail

firejail

Linux 命名空间和 seccomp-bpf 沙箱

查看仓库网站
7.6k670113天前Kitploit 审核通过

最受欢迎

查看全部 →

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

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

Firejail

Build (GitLab) Build (GitHub) Build-extra Test Check-C Check-Profiles Check-Python Codespell Packaging status (Repology)

Firejail 是一款轻量级安全工具,旨在通过设置受限环境来运行(可能不受信任的)应用程序,从而保护 Linux 系统。

具体来说,它是一个 SUID 沙箱程序,通过使用 Linux 命名空间(namespaces)、seccomp-bpf 和 Linux capabilities 来降低发生安全破坏的风险。它允许一个进程及其所有子进程拥有对全局共享内核资源(如网络栈、进程表和挂载表)的私有视图。Firejail 可以在 SELinux 或 AppArmor 环境中运行,并且已与 Linux 控制组(Control Groups)集成。

该软件使用 C 语言编写,几乎没有依赖项,可在任何运行 3.x 或更高版本内核的 Linux 计算机上运行。它可以对任何类型的进程进行沙箱化:服务器、图形应用程序,甚至用户登录会话。该软件包含许多常见 Linux 程序的沙箱配置文件,例如 Mozilla Firefox、Chromium、VLC、Transmission 等。

沙箱非常轻量,开销很低。无需编辑复杂的配置文件,无需打开套接字连接,也无需在后台运行守护进程。所有安全功能都直接在 Linux 内核中实现,并可在任何 Linux 计算机上使用。

视频

链接

  • 项目网页: https://firejail.wordpress.com/
  • IRC: https://web.libera.chat/#firejail
  • 下载与安装: https://firejail.wordpress.com/download-2/
  • 功能特性: https://firejail.wordpress.com/features-3/
  • 文档: https://firejail.wordpress.com/documentation-2/
  • 常见问题(FAQ): https://github.com/netblue30/firejail/wiki/Frequently-Asked-Questions
  • Wiki: https://github.com/netblue30/firejail/wiki
  • GitHub Actions: https://github.com/netblue30/firejail/actions
  • GitLab CI: https://gitlab.com/Firejail/firejail_ci/pipelines
  • Debian CI: https://salsa.debian.org/reiner/firejail
  • Debian 软件包跟踪器: https://tracker.debian.org/pkg/firejail
  • Ubuntu PPA: https://launchpad.net/~deki/+archive/ubuntu/firejail
  • 视频频道: https://odysee.com/@netblue30:9?order=new
  • 备用视频频道: https://www.bitchute.com/profile/JSBsA1aoQVfW/

安全漏洞

参见 SECURITY.md。

安装

受支持的版本请参见 SECURITY.md。

Debian

注意:Debian stable 和 backports 中的版本可能已经过时,因此目前我们建议从最新版本下载并安装 .deb 软件包:

  • https://github.com/netblue30/firejail/releases/latest

或者从源码构建。

旧版说明

Debian stable(bullseye):我们建议使用 backports 软件包。

Ubuntu

注意:发行版和 PPA 中的版本可能已经过时,因此目前我们建议从最新版本下载并安装 .deb 软件包:

  • https://github.com/netblue30/firejail/releases/latest

或者从源码构建。

旧版说明

注意:PPA 建议主要针对 firejail 本身;如果 firetools 和 firejail 相关工具不在 PPA 中,直接从发行版安装也没有问题,因为它们往往更新频率较低。

对于 Ubuntu 18.04+ 及其衍生版本(如 Linux Mint),强烈建议用户使用 PPA。

如何添加并从 PPA 安装:

root@kitploit:~
sudo add-apt-repository ppa:deki/firejail
sudo apt-get update
sudo apt-get install firejail firejail-profiles

原因:Ubuntu 20.04 的 firejail 软件包在 Launchpad 上发布补丁后数月内,仍存在 CVE-2021-26910 漏洞:

  • CVE-2021-26910
  • Ubuntu 20.04 LTS 中的 firejail 版本存在 CVE-2021-26910 漏洞

另请参阅 https://wiki.ubuntu.com/SecurityTeam/FAQ:

Ubuntu 安全团队支持哪些软件?

Ubuntu 目前分为四个组件:main、restricted、universe 和 multiverse。main 和 restricted 中的所有二进制软件包在 Ubuntu 版本的生命周期内均由 Ubuntu 安全团队提供支持,而 universe 和 multiverse 中的二进制软件包则由 Ubuntu 社区提供支持。

此外,PPA 版本可能更新,并且包含更多配置文件修复。

详情请参阅以下讨论:

  • 我还应该继续使用发行版仓库中的 firejail 版本吗?
  • 如何在 Ubuntu 及其衍生版本上安装最新版本

其他

Firejail 可用于多个 Linux 发行版:

Repology

Packaging status (Repology)

除上述例外情况外,只要您的发行版提供受支持版本的 firejail,通常建议从发行版安装。

安装后可通过 firejail --version 检查版本。

您也可以安装已发布的软件包之一。

构建

从源码构建并安装当前开发版本的说明。

在适用的情况下,建议使用下面针对特定发行版的说明,因为它们会生成原生软件包,从而更易于与系统其他部分集成并方便软件包管理。

对于其他发行版,请参阅通用说明。

另请参阅 .gitlab-ci.yml 了解如何在 CI 中完成特定发行版的构建。

Arch

注意:AUR 软件包并非由我们维护。

从 AUR 安装 firejail-git。

示例:

root@kitploit:~
yay -S firejail-git

Debian

适用于 Debian、Ubuntu 及其衍生版本:

注意:任何 ./configure 标志都应传递给 mkdeb.sh(例如 ./mkdeb.sh --enable-foo)。

root@kitploit:~
sudo apt-get update -qy
sudo apt-get install -qy \
  git build-essential fakeroot lintian libapparmor-dev pkg-config gawk
git clone 'https://github.com/netblue30/firejail.git' &&
cd firejail &&
./configure &&
make dist &&
./mkdeb.sh &&
sudo dpkg -i ./*.deb &&
make installcheck

Fedora

适用于 Fedora 及其衍生版本:

注意:任何 ./configure 标志都应传递给 mkrpm.sh(例如 ./platform/rpm/mkrpm.sh --enable-foo)。

root@kitploit:~
sudo dnf update -y
sudo dnf install -y rpm-build gcc make
git clone 'https://github.com/netblue30/firejail.git' &&
cd firejail &&
./configure &&
make dist &&
./platform/rpm/mkrpm.sh &&
sudo rpm -i ./*.rpm &&
make installcheck

通用

通用构建/安装说明:

root@kitploit:~
git clone 'https://github.com/netblue30/firejail.git' &&
cd firejail &&
./configure &&
make -j "$(nproc)" &&
sudo make install-strip &&
make installcheck

在 Debian/Ubuntu 上,您需要安装 git 和 gcc。

若要启用 AppArmor 支持进行构建(通常用于 Debian、Ubuntu、openSUSE 及其衍生版本),请安装 AppArmor 开发库和 pkg-config,并使用 --enable-apparmor ./configure 选项:

root@kitploit:~
sudo apt-get install git build-essential libapparmor-dev pkg-config gawk

若要启用 SELinux 支持进行构建(通常用于 Fedora、RHEL 及其衍生版本),请安装 libselinux1-dev(Fedora 上为 libselinux-devel),并使用 --enable-selinux ./configure 选项。

有关从 git 使用 firejail 的详细信息,请参阅 wiki。

运行沙箱

注意:请确保使用程序的完整路径(例如,使用 firejail /usr/bin/firefox 而不是 firejail firefox),以避免潜在的 firejail 嵌套(firejail-in-firejail)问题(参见 #2877)。

要启动沙箱,请在命令前加上 firejail:

root@kitploit:~
firejail /usr/bin/firefox            # starting Mozilla Firefox
firejail /usr/bin/transmission-gtk   # starting Transmission BitTorrent
firejail /usr/bin/vlc                # starting VideoLAN Client
sudo firejail /etc/init.d/nginx start

在终端中运行 firejail --list 可列出所有活动沙箱。示例:

root@kitploit:~
$ firejail --list
1617:netblue:/usr/bin/firejail /usr/bin/firefox-esr
7719:netblue:/usr/bin/firejail /usr/bin/transmission-qt
7779:netblue:/usr/bin/firejail /usr/bin/galculator
7874:netblue:/usr/bin/firejail /usr/bin/vlc --started-from-file file:///home/netblue/firejail-whitelist.mp4
7916:netblue:firejail --list

桌面集成

通过运行以下两条命令将您的沙箱集成到桌面:

root@kitploit:~
firecfg --fix-sound
sudo firecfg

第一条命令解决了 PulseAudio 9.0 之前版本中的一些共享内存/PID 命名空间错误。第二条命令将 Firejail 集成到您的桌面中。您需要注销并重新登录才能应用 PulseAudio 更改。

以您习惯的方式启动程序:桌面管理器菜单、文件管理器、桌面启动器。

此集成适用于 Firejail 默认支持的所有程序。当前 Firejail 版本包含 900 多个默认应用程序,而且这个数字随着每个新版本不断增长。

我们将应用程序列表保存在 src/firecfg/firecfg.config(安装后位于 /etc/firejail/firecfg.config)。

安全配置文件

大多数 Firejail 命令行选项都可以通过配置文件传递给沙箱。

您可以在 etc/(安装后为 /etc/firejail/)中找到所有受支持应用程序的配置文件。

我们还在 etc-fixes/ 中保留了针对先前发布版本的配置文件修复列表。

如果您在公共仓库中维护额外的 Firejail 安全配置文件,请提供链接给我们:

  • https://github.com/chiraag-nataraj/firejail-profiles
  • https://github.com/triceratops1/fe

使用此 issue 来请求新的配置文件:

  • 配置文件请求

您也可以使用此工具获取程序所需的系统调用列表:

  • contrib/syscalls.sh

卸载

firecfg 会在 /usr/local/bin 中创建符号链接,因此要完全移除 firejail,请在卸载前运行以下命令:

root@kitploit:~
sudo firecfg --clean

详情请参阅 man firecfg。

注意:在 $PATH 中搜索可执行文件时会忽略损坏的符号链接,因此不执行上述操作直接卸载也不会引发问题。

最新发布版本:0.9.80

当前开发版本:0.9.81

Landlock 支持 —— 进行中/实验性

  • 于 #6078 中添加,基于 ChrysoliteAzalea/landlock 的 #5315
  • 基于 linux/landlock.h 进行编译时检测 —— 如果找到该头文件,则该功能会被编译进来
  • 基于内核是否支持 Landlock 以及系统上是否启用该功能进行运行时检测
root@kitploit:~
LANDLOCK
       Landlock is a Linux security module first introduced in version 5.13 of
       the  Linux  kernel.  It allows unprivileged processes to restrict their
       access to the filesystem.  Once imposed, these restrictions  can  never
       be  removed,  and  all child processes created by a Landlock-restricted
       processes inherit these restrictions.  Firejail supports Landlock as an
       additional  sandboxing  feature.  It can be used to ensure that a sand‐
       boxed application can only access files and directories that it was ex‐
       plicitly  allowed  to access.  Firejail supports populating the ruleset
       with both a basic set of rules (see --landlock) and with a  custom  set
       of rules.

       Important notes:

              - A process can install a Landlock ruleset only if it has either
              CAP_SYS_ADMIN in its effective capability set, or  the  "No  New
              Privileges"  restriction enabled.  Because of this, enabling the
              Landlock feature will also cause Firejail to enable the "No  New
              Privileges"  restriction,  regardless  of  the  profile  or  the
              --nonewprivs command line option.

              - Access to the /proc directory is managed through  the  --land‐
              lock.proc command line option.

              -  Access  to  the  /etc directory is automatically allowed.  To
              override this, use the --writable-etc command line option.   You
              can  also use the --private-etc option to restrict access to the
              /etc directory.

       To enable Landlock self-restriction on top of your current Firejail se‐
       curity  features,  pass  --landlock flag to Firejail command line.  You
       can also use --landlock.read, --landlock.write, --landlock.special  and
       --landlock.execute  options  together with --landlock or instead of it.
       Example:

       $ firejail --landlock --landlock.read=/media --landlock.proc=ro /usr/bin/mc

配置文件统计

一个用于打印配置文件统计信息的小工具。照常编译并安装。该工具安装在 /usr/lib/firejail 目录中。

对 /etc/profiles 中的配置文件运行它:

root@kitploit:~
$ /usr/lib/firejail/profstats /etc/firejail/*.profile
No include .local found in /etc/firejail/noprofile.profile
Warning: multiple caps in /etc/firejail/tidal-hifi.profile
Warning: multiple caps in /etc/firejail/tqemu.profile
Warning: multiple caps in /etc/firejail/transmission-daemon.profile
Warning: multiple caps in /etc/firejail/trivalent.profile

Stats:
    profiles			1342
    include local profile	1341   (include profile-name.local)
    include globals		1307   (include globals.local)
    blacklist ~/.ssh		1201   (include disable-common.inc)
    seccomp			1213
    capabilities		1335
    noexec			1214   (include disable-exec.inc)
    noroot			1105
    memory-deny-write-execute	320
    restrict-namespaces		1048
    apparmor			869
    private-bin			817
    private-dev			1172
    private-etc			842
    private-cache		865
    private-lib			86
    private-tmp			1036
    whitelist home directory	662
    whitelist var		975   (include whitelist-var-common.inc)
    whitelist run/user		1305   (include whitelist-runuser-common.inc
					or blacklist ${RUNUSER})
    whitelist usr/share		760   (include whitelist-usr-share-common.inc
    net none			452
    dbus-user none 		766
    dbus-user filter 		206
    dbus-system none 		970
    dbus-system filter 		13
下载工具
快速入门
快速入门
高级浏览器安全
高级浏览器安全
Tor 浏览器安全
Tor 浏览器安全