標籤:
測試了一把,結果顯示360基本對Linux社區規範和安全常識不give a fuck。
胡亂打包
首先,這個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標記來製造卸載的麻煩。
[email protected]:/home/user# apt-get remove 360safeforlinux[...]The following packages will be REMOVED: 360safeforlinuxWARNING: 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.[email protected]:/home/user# aptitude remove 360safeforlinuxThe 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:
[email protected]:~$ iduid=1000(user) gid=1000(user) groups=1000(user),24(cdrom),25(floppy),29(audio),30(dip),44(video),46(plugdev)[email protected]:~$ start360 &[1] 4512[email protected]:~$ pstree -uinit─┬─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>&2firc=`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>&2fi
360不僅不滿足於root許可權,還在用核心模組?不過這次使用中並未發現這兩個核心模組。
啟動並執行怪現狀
start360啟動,然後有兩個運行時怪現狀:
- 把pid儲存到/etc/360safe/360safeforlinux.pid。會不會遵守FHS?
- 瘋狂掃描系統檔案,powertop顯示閑置狀態每秒30個喚醒,筆記本電池壽命已死。會不會用inotify?
功能的真相
它提供了一些功能。
許可證列舉
360唯有一點用功了,就是列了一大堆非GPL的許可證:
license/zlib_license.txtlicense/c-ares_license.txtlicense/qt_license_lgpl.txtlicense/unrar_license.txtlicense/sqlite_license.txtlicense/elftoolchain_license.txtlicense/libcurl_license.txtlicense/7-Zip_license.txtlicense/boost_license.txtlicense/openssl_licnese.txtlicense/minizip_license.txtlicense/jsoncpp_license.txtlicense/protobuf_license.txtlicense/Noto fonts_license.txtlicense/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
360 安全衛士 for Linux 使用結果