360 安全衛士 for Linux 使用結果

jopen 9年前發布 | 8K 次閱讀 Linux

測試了一把,結果顯示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標記來制造卸載的麻煩。

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打包政策,DebianUbuntu都只保留給最必要的包。

隨意使用 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://linux.cn/article-4574-1.html

原文來自: http://www.v2ex.com/t/158380 

 本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!