fsockopen pfsockopen function is disabled, solution to abnormal SMTP mail sending, fsockopen function is disabled_PHP tutorial

WBOY
Release: 2016-07-12 09:08:00
Original
1048 people have browsed it

fsockopen pfsockopen function is disabled, the solution to abnormal SMTP mail sending, fsockopen function is disabled

1: Recently, hackers used fsockopen to carry out PHPDDOS attacks after exploiting program vulnerability injection, resulting in Some servers are unstable. The dangerous function fsockopen is now temporarily disabled. Some program functions may have problems. The following lists known problems and common solutions:

General solution:
Find the fsockopen function in the program and replace it with: pfsockopen to solve all problems. The difference between the two functions is that pfsockopen remains keep-alive, making it impossible for hackers to carry out connection number attacks.
The path of the program file that uses the fsockopen function is known (add p before fsockopen, that is, change fsockopen to pfsockopen)

Two: The server has disabled fsockopen and pfsockopen at the same time, then use other functions instead, such as stream_socket_client(). Note: The parameters of stream_socket_client() and fsockopen() are different.
Specific operations:
Search the string fsockopen( in the program and replace it with stream_socket_client(. Then, delete the port parameter "80" in the original fsockopen function and add it to $host.
An example is as follows

Before modification:

$fp = fsockopen($host, 80, $errno, $errstr, 30);

After modification:

$fp = stream_socket_client($host."80", $errno, $errstr, 30);
List of files in the website system of domestic mainstream PHP websites involving the fsockopen function:
List of files in the website system of domestic mainstream PHP websites involving the fsockopen function:

DEDECMS:

Copy code The code is as follows:
sourcefunctionfunction_core.php This file has 2 fsockopen and the other is pfsockopen, please pay attention to the distinction
uc_clientclient.php This file has 2 fsockopen and the other is pfsockopen, please pay attention to the distinction
uc_clientlibsendmail.inc.php
This file uc_clientmodelmisc.php has 2 fsockopens and the other is pfsockopen. Please pay attention to the distinction
This file uc_serverinstallfunc.inc.php has 2 fsockopens and the other is pfsockopen. Please pay attention to the distinction
uc_serverlibsendmail.inc.php
The file uc_servermodelmisc.php has 2 fsockopens and the other is pfsockopen. Please pay attention to the distinction

Discuz! 2.5:

Copy code The code is as follows:
sourcefunctionfunction_core.php This file has 2 fsockopen and the other is pfsockopen, please pay attention to the distinction
uc_clientclient.php This file has 2 fsockopen and the other is pfsockopen, please pay attention to the distinction
uc_clientlibsendmail.inc.php
This file uc_clientmodelmisc.php has 2 fsockopens and the other is pfsockopen. Please pay attention to the distinction
This file uc_serverinstallfunc.inc.php has 2 fsockopens and the other is pfsockopen. Please pay attention to the distinction
uc_serverlibsendmail.inc.php
The file uc_servermodelmisc.php has 2 fsockopens and the other is pfsockopen. Please pay attention to the distinction

ecms (Empire):

eclassclass.smtp.php

ECSHOP:

Copy code The code is as follows:
adminindex.php
demoincludeslib_updater.php
includescls_smtp.php
includescls_transport.php
includeslib_base.php
includesmodulespaymentpaypal.php


shopex:

Copy code The code is as follows:
coreapiincludeapi_utility.php
coreapitools1.0api_b2b_1_0_tools.php
corefunc_ext.php
corelibnusoap.php
corelibuc_clientclient.php
instalsvinfo.php
pluginspassportpassport.ucenter.php
pluginspaymentpay.nochek.php
pluginspay.paypal.php
pluginspay.paypal.server.php
pluginspay.paypal_cn.php

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1057476.htmlTechArticlefsockopen The pfsockopen function is disabled, the solution to abnormal SMTP sending emails, the fsockopen function is disabled 1: Recent hacker use Use fsockopen to perform PHPDDO after program vulnerability injection...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template