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

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

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

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

工具目录

分类

查看所有分类
Loading categories
CVE-2021-39273-CVE-2021-39274 — XeroSecurity 在 Sn1per v9.0 免费版中发现两个安全问题 | Kitploit
工具/GitHubGitHub/nikip72/cve-2021-39273-cve-2021-39274
权限提升漏洞分析漏洞利用渗透测试错误配置
GitHubnikip72/cve-2021-39273-cve-2021-39274

CVE-2021-39273-CVE-2021-39274

XeroSecurity 在 Sn1per v9.0 免费版中发现两个安全问题

查看仓库

最受欢迎

查看全部 →

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

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享
1165年前尚未审核

CVE-2021-39273

在 XeroSecurity Sn1per 9.0(免费版)中,应用程序执行时设置了不安全的权限(0777),导致非特权用户可以修改应用程序、模块和配置文件。这可能导致以 root 权限执行任意代码。

CVE-2021-39274

在 XeroSecurity Sn1per 9.0(免费版)中,安装期间设置了不安全的目录权限(0777),允许非特权用户修改主应用程序和应用程序配置文件。这导致以 root 权限执行任意代码。

测试环境:Ubuntu 21.04

来自 Sn1per 安装说明:

KALI/UBUNTU/DEBIAN/PARROT LINUX 安装:

git clone https://github.com/1N3/Sn1per
cd Sn1per
bash install.sh

安装过程

root@snipertest:~# git clone https://github.com/1N3/Sn1per
Cloning into 'Sn1per'...
remote: Enumerating objects: 2838, done.
remote: Counting objects: 100% (13/13), done.
remote: Compressing objects: 100% (9/9), done.
remote: Total 2838 (delta 5), reused 10 (delta 4), pack-reused 2825
Receiving objects: 100% (2838/2838), 43.18 MiB | 18.76 MiB/s, done.
Resolving deltas: 100% (1950/1950), done.
root@snipertest:~# cd Sn1per/
root@snipertest:~/Sn1per# bash install.sh
                ____
    _________  /  _/___  ___  _____
   / ___/ __ \ / // __ \/ _ \/ ___/
  (__  ) / / // // /_/ /  __/ /
 /____/_/ /_/___/ .___/\___/_/
               /_/

 + -- --=[ https://xerosecurity.com
 + -- --=[ Sn1per by @xer0dayz

[>] This script will install sn1per under /usr/share/sniper. Are you sure you want to continue? (Hit Ctrl+C to exit)
y
[snip]
'/usr/share/sniper/sniper.conf' -> '/root/.sniper.conf'
Please run msfdb as a non-root user
[*] Adding start menu and desktop shortcuts...
[>] Done!
[>] To run, type 'sniper'!
root@snipertest:~/Sn1per#

CVE-2021-39274

安装完成后,安装目录权限设置如下:

root@snipertest:~/Sn1per# ls -ld /usr/share/sniper/
❗drwxrwxrwx❗ 10 root root 4096 Aug 16 19:19 /usr/share/sniper/

root@snipertest:~/Sn1per# ls -la /usr/share/sniper/
total 6668
drwxrwxrwx  10 root root    4096 Aug 16 19:19 .
drwxr-xr-x 222 root root   12288 Aug 16 19:41 ..
-rw-r--r--   1 root root   36518 Aug 16 18:33 CHANGELOG.md
-rw-r--r--   1 root root    1269 Aug 16 18:33 Dockerfile
-rw-r--r--   1 root root     306 Aug 16 18:33 LICENSE.md
-rw-r--r--   1 root root   11697 Aug 16 18:33 README.md
-rw-r--r--   1 root root 6491364 Aug 16 18:33 Sn1per.gif
-rw-r--r--   1 root root  159147 Aug 16 18:33 Sn1per.jpg
drwxr-xr-x   2 root root    4096 Aug 16 18:33 bin
drwxr-xr-x   2 root root    4096 Aug 16 19:41 conf
rwxr-xr-x   1 root root   11548 Aug 16 18:33 install.sh
drwxr-xr-x   9 root root    4096 Aug 16 19:42 loot
drwxr-xr-x   2 root root    4096 Aug 16 18:33 modes
drwxr-xr-x  43 root root    4096 Aug 16 19:27 plugins
drwxr-xr-x   2 root root    4096 Aug 16 18:33 pro
-rw-r--r--   1 root root     276 Aug 16 18:33 sn1per.desktop
-rw-r--r--   1 root root    4283 Aug 16 18:33 sn1per.png
-rwxr-xr-x   1 root root   28290 Aug 16 18:33 sniper
-rw-r--r--   1 root root    9752 Aug 16 18:33 sniper.conf
drwxr-xr-x   4 root root    4096 Aug 16 18:33 templates
-rwxr-xr-x   1 root root     980 Aug 16 18:33 uninstall.sh
drwxr-xr-x   2 root root    4096 Aug 16 18:33 wordlists

尽管所有文件均由 root 拥有,但容器目录的权限允许我们操纵文件,因此可以在其中一个脚本中植入后门。另一种可能更隐蔽的修改方式是将后门放置在配置文件(sniper.conf)中,因为该文件通过 bash 的 source 命令加载。

由于应用程序必须以 root 身份运行(脚本中的 EUID 检查确保了这一点):

if [[ $EUID -ne 0 ]]; then
   echo "此脚本必须以 root 身份运行"
   exit 1
fi

在配置文件中植入后门将在下次使用应用程序时以 root 权限 执行。

根本原因

安装脚本的第 37-40 行:

mkdir -p $INSTALL_DIR 2> /dev/null
chmod 777 -Rf $INSTALL_DIR 2> /dev/null
chown root $INSTALL_DIR/sniper 2> /dev/null
chmod 4777 $INSTALL_DIR/sniper 2> /dev/null

CVE-2021-39273

与 CVE-2021-39274 不同的问题

在应用程序首次作为扫描仪执行时,主脚本 sniper 会执行 init 函数,该函数递归地更改安装目录及其内容的权限。

与 CVE-2021-39274 类似,这允许修改所有应用程序文件(包括可执行文件和配置文件),并在其中植入后门,下次 root 用户使用应用程序时将以 root 权限 执行。

根本原因

主脚本的第 464-466 行:

chmod 777 -Rf $INSTALL_DIR 2> /dev/null
chown root $INSTALL_DIR/sniper 2> /dev/null
chmod 4777 $INSTALL_DIR/sniper 2> /dev/null

由 Nikola Pepelishev 于 2021 年 8 月发现

下载工具