近期黑客利用程序漏洞注入后使用 fsockopen 进行PHPDDOS 攻击,导致部分服务器不稳定,现在将危险函数 fsockopen 暂时禁用,部分程序功能可能有问题,以下列出已知问题及通用解决方法:
通用解决方法:
找到程序里的 fsockopen 函数,替换为:pfsockopen,即可解决所有问题,两个函数的区别在于 pfsockopen 保持 keep-alive,使得黑客无法进行 连接数攻击。
已知使用 fsockopen 函数的程序文件路径(在fsockopen 前加 p, 即fsockopen 修改为 pfsockopen 即可 )[其他程序可通过错误提示的文件路径查看更改]:
Discuz X2 安装提示不支持fsockopen:
将 /include/install_var.php 文件里的
$func_items = array(‘mysql_connect’, ‘fsockopen
‘, ‘gethostbyname’, ‘file_get_contents’, ‘xml_parser_create’);
替换为:
$func_items = array(‘mysql_connect’, ‘pfsockopen
‘, ‘gethostbyname’, ‘file_get_contents’, ‘xml_parser_create’);
即可正常安装。
X2全部包含fsockopen的文件(如果用邮件只修改邮件即可,其他文件都是自动判断 pfsockopen):
\api\manyou\Manyou.php
\api\trade\api_alipay.php
\install\include\install_function.php
\install\include\install_lang.php
\install\include\install_var.php
\source\admincp\admincp_addons.php
\source\admincp\admincp_checktools.php
\source\admincp\admincp_cloud.php
\source\admincp\admincp_misc.php
\source\admincp\cloud\cloud_doctor.php
\source\class\class_image.php
\source\class\class_sphinx.php
\source\class\block\xml\block_xml.php
\source\function\function_connect.php
\source\function\function_core.php
\source\function\function_filesock.php
\source\function\function_importdata.php
\source\function\function_mail.php 邮件相关
\source\function\function_plugin.php
\source\include\portalcp\portalcp_upload.php
\source\language\lang_admincp_cloud.php
\source\module\forum\forum_ajax.php
\source\module\misc\misc_manyou.php
\uc_client\client.php
\uc_client\lib\sendmail.inc.php 邮件相关
\uc_client\model\misc.php
\uc_server\install\func.inc.php
\uc_server\install\lang.inc.php
\uc_server\lib\sendmail.inc.php 邮件相关
\uc_server\model\misc.php
Discuz 品牌空间不能安装,提示UC地址不正确:
修改 /install/func.inc.php 里的 fsockopen函数为 pfsockopen
Discuz 7.2:(非首次安装,可以只改绿色部分。)
问题:使用 uc 不能登录
, fsockopen
函数位于:
include\global.func.php(240): $fp = @fsockopen(($ip ? $ip : $host), $port, $errno, $errstr, $timeout); include\sendmail.inc.php(54): if(!$fp = fsockopen($mail['server'], $mail['port'], $errno, $errstr, 30)) { install\func.inc.php(803): $fp = @fsockopen(($ip ? $ip : $host), $port, $errno, $errstr, $timeout); install\var.inc.php(70): $func_items = array('mysql_connect', 'fsockopen', 'gethostbyname', 'file_get_contents', 'xml_parser_create'); uc_client\client.php(211): $fp = @fsockopen(($ip ? $ip : $host), $port, $errno, $errstr, $timeout); uc_client\lib\sendmail.inc.php(40): if(!$fp = fsockopen($mail_setting['mailserver'], $mail_setting['mailport'], $errno, $errstr, 30)) { uc_client\model\misc.php(97): $fp = @fsockopen(($ip ? $ip : $host), $port, $errno, $errstr, $timeout); uc_server\lib\sendmail.inc.php(40): if(!$fp = fsockopen($mail_setting['mailserver'], $mail_setting['mailport'], $errno, $errstr, 30)) { uc_server\model\misc.php(94): $fp = @fsockopen(($ip ? $ip : $host), $port, $errno, $errstr, $timeout);
DEDECMS 问答积分功能出现 service.dedecms.com:
修改 /ask/data/scores.inc.php 里的 fsockopen 为 pfsockopen
附带dedecms 全部含 fsockopen 的文件列表:
./include/dedehttpdown.class.php: $this->m_fp = @fsockopen($this->m_host, $this->m_port, $errno, $errstr,10); ./include/sphinxclient.class.php: $fp = @fsockopen ( $host , $port, $errno, $errstr ); ./include/sphinxclient.class.php: $fp = @fsockopen ( $host , $port, $errno, $errstr, $this->_timeout ); ./include/dedecollection.func.php: $m_fp = fsockopen($ghost, 80, $errno, $err str,10); ./include/dedecollection.func.php: $m_fp = fsockopen($ghost, 80, $errno, $err str,10) or die($ghost.'<br />'); ./include/mail.class.php: //is used in fsockopen() ./include/mail.class.php: $this->sock = @fsockopen($this->relay_host, $th is->smtp_port, $errno, $errstr, $this->time_out); ./include/mail.class.php: $this->sock = @fsockopen($host, $this->smtp _port, $errno, $errstr, $this->time_out); ./ask/data/scores.inc.php: $fp = fsockopen($host,80,$errno,$errstr,30); ./dede/module_main.php: $fp = fsockopen('www.dedecms.com',80,$errno,$errs tr,30); ./dede/api_ucenter.php: $fp = @fsockopen(($host ? $host : $ip), $port, $errno, $ errstr, $timeout); ./dede/plus_bshare.php: if (!$fp=@fsockopen($parse['host'],$parse['port'],$er rnum,$errstr,$timeout)) { ./plus/bshare.php: if (!$fp=@fsockopen($parse['host'],$parse['port'],$errnum, $errstr,$timeout)) {
UC通信不正常,DEDE整合UC连接不上的解决办法:
修改:
uc_client/client.php
uc_client/model/misc.php
替换里面的 fsockopen 为 pfsockopen
SHOPEX:
./install/svinfo.php: $fp = @fsockopen(“unix://”.DB_HOST);
./install/svinfo.php: $fp = @fsockopen(“tcp://”.$host, $port, $errno, $errstr,2);
./install/svinfo.php: $rst = is_callable(‘fsockopen’);
./install/svinfo.php: $items['fsockopen支持'] = array(
./install/svinfo.php: $fp =
fsockopen(isset($_SERVER['SERVER_ADDR'])?$_SERVER['SERVER_ADDR']:$_SERVER['HTTP_HOST'],
$_SERVER['SERVER_PORT'], $errno, $errstr, 2);
./plugins/payment/pay.paypal_cn.php: $fp = fsockopen (‘www.paypal.com’, 80, $errno, $errstr, 30);
./plugins/payment/pay.paypal_cn.php: $fp = fsockopen (‘ssl://www.paypal.com’, 443, $errno, $errstr, 30);
./plugins/payment/pay.nochek.php: $fp = fsockopen (‘www.nochex.com’, 80, $errno, $errstr, 10);
./plugins/payment/pay.paypal.server.php: $fp = fsockopen (‘www.paypal.com’, 80, $errno, $errstr, 30);
./plugins/payment/pay.paypal.php: $fp = fsockopen (‘www.paypal.com’, 80, $errno, $errstr, 30);
./plugins/passport/passport.ucenter.php: $fp=@fsockopen(($ip ? $ip : $host),$port,$errorno,$errorstr,$timeout);
./core/lib/nusoap.php: $this->debug(‘calling fsockopen with
host ‘ . $host . ‘ connection_timeout ‘ . $connection_timeout);
./core/lib/nusoap.php: $this->fp = @fsockopen( $host,
$this->port, $this->errno, $this->error_str,
$connection_timeout);
./core/lib/nusoap.php: $this->fp = @fsockopen( $host, $this->port, $this->errno, $this->error_str);
./core/lib/uc_client/client.php: $fp = @fsockopen(($ip ? $ip : $host), $port, $errno, $errstr, $timeout);
./core/func_ext.php: $fp = pfsockopen($url['host'], isset($url['port'])?$url['port']:80, $errno, $errstr, 2);
./core/func_ext.php: $fp = pfsockopen( $host, $port, $errno, $errstr, $timeout );
./core/api/include/api_utility.php: $process = fsockopen($this->host, $this->port, $errno, $errstr, 10);
./core/api/include/api_utility.php: $process = fsockopen($host, 80, $errno, $errstr, 10);
./core/api/tools/1.0/api_b2b_1_0_tools.php: $fp = fsockopen( $host, $port, $errno, $errstr, $timeout );
http://help.vit.cn/item/113.html
相关推荐
下载此文件,解压并上传到网站源码根目录。然后访问这个文件【例如您网站的源码是直接放在abc.com的根目录,则访问http://abc.com/pfsockopen.php】,直接点【开始执行替换操作】,即可。
二、如何解决fsockopen函数被禁用1、如果服务器没有同时禁用pfsockopen,那么直接将fsockopen函数替换为pfsockopen。具体操作:搜索程序中的字符串 fsockopen( 替换为 pfsockopen( 。示例如下修改前:$fp = ...
近期黑客利用程序漏洞注入后使用 fsockopen 进行PHPDDOS 攻击,导致部分服务器不稳定,现在将危险函数 fsockopen 暂时禁用,部分程序功能可能有问题,以下列出已知问题及通用解决方法
主要介绍了PHP的fsockopen、pfsockopen函数被主机商禁用的解决办法,一是使用stream_socket_client函数代替,二是写一个类似fsockopen功能的自定义函数,需要的朋友可以参考下
本文实例讲述了php使用fsockopen函数发送post,get请求获取网页内容的方法。分享给大家供大家参考。 具体实现代码如下: 复制代码 代码如下:$post =1; $url = parse_url($url); $host =’//www.jb51.net’; $path ...
fsockopen用法.txt
主要介绍了phpmailer在服务器上不能正常发送邮件的解决办法,本文的原因是服务器的安全设置造成,服务器中屏蔽fsockopen函数的使用权限,所以导致发送失败,需要的朋友可以参考下
最近研究php多线程的问题,发现中文资源少的可怜,仅有的几篇文章被转了又转,但文中内容价值有限。搜索过程中发现国外很多网站引用的一篇文章写的不错,所以翻译过来
fsockopen get/post 表单及上传文件例子。
有没有办法在php中实现多线程呢?假设你正在写一个基于多台服务器的php应用,理想的情况时同时向多台服务器发送请求,而不是一台接一台。可以实现吗?回答是当然可以,下面看解决方法
fsockopen是对socket客户端代码的封装,该函数中封装了socket_create,socket_connect。服务器端代码:server.php复制代码 代码如下:<?phperror_reporting(E_ALL);set_time_limit(0);$address = ‘127.0.0.1’;$...
目前记得服务器PHP环境不能禁止fsockopen函数,否则邮件发送不了,但这问题也有解决的办法。总之,一开始使用,总有不顺,由于时间久远,现在想来,也不知道具体改了什么。所以,将现在正在使用的PHPMailer目录文件...
本文利用 fsockopen() 函数,编写一个功能简单的端口扫描器。 2、关键技术 本实例的端口号是固定的,通过对数组的遍历,利用 fsockopen() 函数连接,如果连接成功,则该端口处于开放状态,否则该...
Discuz!X1远程图片本地化插件v4 插件简介:远程图片本地化。可设置版块,用户组,保存目录,支持缩略图,水印功能。...3,本服务器不支持相关函数。如copy,file_get_contents,fsockopen等。 以上原因均与插件无关。