首页 技术 正文
技术 2022年11月14日
0 收藏 747 点赞 3,966 浏览 3834 个字

测试了一把,结果显示360基本对Linux社区规范和安全常识不give a fuck。

360 安全卫士 for Linux 使用结果

胡乱打包

首先,这个deb包就是胡乱打包,依赖关系就没弄好:

$ dpkg-deb -I 360safeforlinux-3.0.0.66-stripped.deb
[...]
Package: 360safeforlinux
Version: 3.0.0.66
Architecture: amd64
Maintainer: qihu360 company
Installed-Size: 23617
Depends: libc6 (>= 2.14),libglib2.0-0 (>= 2.38),python2.7 (>= 2.7.6),openssl(>= 1.0),curl,libqt4-network(>= 4.8.5),libqt4-sql(>= 4.8.5)
Section: gnome
Priority: required
Essential: yes
Description: 360 safe for linux

但是还实际依赖了libpython2.7和libqtgui4两个库没有标明,要我手动修复。

滥用 Essential

这个打包还通过滥用Essential标记来制造卸载的麻烦。

root@debian-amd64:/home/user# apt-get remove 360safeforlinux
[...]
The following packages will be REMOVED:
360safeforlinux
WARNING: The following essential packages will be removed.
This should NOT be done unless you know exactly what you are doing!
360safeforlinux
[...]
**You are about to do something potentially harmful.**
To continue type in the phrase 'Yes, do as I say!'
?]
Abort.root@debian-amd64:/home/user# aptitude remove 360safeforlinux
The following packages will be REMOVED:
360safeforlinux
[...]
The following ESSENTIAL packages will be REMOVED!
360safeforlinux WARNING: Performing this action will probably cause your system to break!
Do NOT continue unless you know EXACTLY what you are doing!
To continue, type the phrase "I am aware that this is a very bad idea":

关于Essential打包政策, Debian 和 Ubuntu 都只保留给最必要的包。

随意使用 setuid

安装后dpkg配置时它的postinst脚本直接给加上了setuid。如此随意地使用setuid,还能自称是安全?

if [ "$1" = "configure" ];then
chmod u+s /opt/360safeforlinux/s360SafeForLinux
[...]
fi

这个的意思就是,以普通用户权限运行这个东西,它会变成root:

user@debian-amd64:~$ id
uid=1000(user) gid=1000(user) groups=1000(user),24(cdrom),25(floppy),29(audio),30(dip),44(video),46(plugdev)
user@debian-amd64:~$ start360 &
[1] 4512
user@debian-amd64:~$ pstree -u
init─┬─dhclient
├─5*[getty]
├─login───bash(user)───startx───xinit─┬─Xorg(root)
│ └─x-window-manage
[...]
├─urxvtd(user)
└─urxvtd(user)─┬─bash───start360(root)─┬─{BackendTaskThre}
│ ├─{BrowserHomePage}
│ ├─{CpuMemUseState}
│ ├─{FileWatcher}
│ ├─{IsolateZone}
│ ├─{LogCleanThread}
│ ├─2*[{MyThread}]
│ ├─{VdUpload}
│ └─3*[{start360}]
└─bash───pstree

内核模块?

dpkg的prerm脚本还有奇怪的东西:

rc=`lsmod | grep "rk360" | xargs echo`
if [ -n "$rc" ];then
rmmod rk360 2>/dev/null 1>&2
rm -rf /etc/360safe/360safe.ko 2>/dev/null 1>&2
fi
rc=`lsmod | grep "immu" | xargs echo`
if [ -n "$rc" ];then
rmmod immu 2>/dev/null 1>&2
rm -rf /etc/360safe/immu.ko 2>/dev/null 1>&2
fi

360不仅不满足于root权限,还在用内核模块?不过这次使用中并未发现这两个内核模块。

运行的怪现状

start360启动,然后有两个运行时怪现状:

  1. 把pid保存到/etc/360safe/360safeforlinux.pid。会不会遵守FHS?
  2. 疯狂扫描系统文件,powertop显示闲置状态每秒30个唤醒,笔记本电池寿命已死。会不会用inotify?

功能的真相

它提供了一些功能。

  • 全盘扫描。所有文件都是按照标准设计的,哪个恶意哪个不恶意真不是360能说了算的。
  • 一键清理。可以使用这个命令替代:rm -r ~/.adobe ~/.cache ~/.local ~/.macromedia ~/.thumbnails /tmp/*。但是这些临时文件是有用的,也占不了多大空间。
  • 优化加速。就是把update-rc.d/chkconfig封装了一个图形界面。
  • 软件管家。360的私货app store。
  • 文件粉碎。Linux下有什么无法删除的“顽固”文件?还是重新发明了coreutils的/usr/bin/shred?来删除/proc试试?
  • 网盾。就是Firefox和Chrome的插件。
    ./etc/360safe/urlcheck
    ./etc/360safe/urlcheck/normalize.py
    ./etc/360safe/urlcheck/Firefox
    ./etc/360safe/urlcheck/Firefox/360webshield@qihoo.com.xpi
    ./etc/360safe/urlcheck/lcloud.ini
    ./etc/360safe/urlcheck/browserextensionsinstaller.py
    ./etc/360safe/urlcheck/Chrome
    ./etc/360safe/urlcheck/Chrome/360WebShield.crx
  • 还有二进制库的“云查杀”,QEX引擎,BitDefender引擎。不了解有什么用处。

许可证列举

360唯有一点用功了,就是列了一大堆非GPL的许可证:

license/zlib_license.txt
license/c-ares_license.txt
license/qt_license_lgpl.txt
license/unrar_license.txt
license/sqlite_license.txt
license/elftoolchain_license.txt
license/libcurl_license.txt
license/7-Zip_license.txt
license/boost_license.txt
license/openssl_licnese.txt
license/minizip_license.txt
license/jsoncpp_license.txt
license/protobuf_license.txt
license/Noto fonts_license.txt
license/qt_lgpl_exception.txt

这样人们就无权索要源代码。不过,一个安全产品不公开源代码,然后用setuid拿了root还要搞内核模块,谁知道你要干嘛?总之,360对Linux社区规范和安全常识基本不give a fuck。

为什么说缺乏安全常识。

首先,用setuid给一个图形网络程序整体提权到root就是自送漏洞,全身是洞,只要发现一个,就是远程root。

其次,用户界面永远不需要root,提权进行特定动作特定配置有polkit,更新系统配置文件可以有facl可以有SELinux/AppArmor,内核级文件扫描可以有auditd,这些机制都不需要一个以root运行的用户界面造成巨大的攻击面。

第三,以root权限运行网上下载的二进制文件是一切病毒发生的起源。尤其是这种既没有源代码可审计,也没有数字签名可验证真实性的东西。

注:本站对本文有部分修改。原文来自: http://www.v2ex.com/t/158380

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,078
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,553
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,402
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,177
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,814
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,898