Submit
Path:
F:
/
Inetpub
/
vhosts
/
solasmarine.com.tr
/
httpdocs
/
wp-admin
/
includes
/
File Content:
class-ftp-sockets.php
<?php /** * PemFTP - An Ftp implementation in pure PHP * * @package PemFTP * @since 2.5.0 * * @version 1.0 * @copyright Alexey Dotsenko * @author Alexey Dotsenko * @link https://www.phpclasses.org/package/1743-PHP-FTP-client-in-pure-PHP.html * @license LGPL https://opensource.org/licenses/lgpl-license.html */ /** * Socket Based FTP implementation * * @package PemFTP * @subpackage Socket * @since 2.5.0 * * @version 1.0 * @copyright Alexey Dotsenko * @author Alexey Dotsenko * @link https://www.phpclasses.org/package/1743-PHP-FTP-client-in-pure-PHP.html * @license LGPL https://opensource.org/licenses/lgpl-license.html */ class ftp_sockets extends ftp_base { function __construct($verb=FALSE, $le=FALSE) { parent::__construct(true, $verb, $le); } // <!-- --------------------------------------------------------------------------------------- --> // <!-- Private functions --> // <!-- --------------------------------------------------------------------------------------- --> function _settimeout($sock) { if(!@socket_set_option($sock, SOL_SOCKET, SO_RCVTIMEO, array("sec"=>$this->_timeout, "usec"=>0))) { $this->PushError('_connect','socket set receive timeout',socket_strerror(socket_last_error($sock))); @socket_close($sock); return FALSE; } if(!@socket_set_option($sock, SOL_SOCKET , SO_SNDTIMEO, array("sec"=>$this->_timeout, "usec"=>0))) { $this->PushError('_connect','socket set send timeout',socket_strerror(socket_last_error($sock))); @socket_close($sock); return FALSE; } return true; } function _connect($host, $port) { $this->SendMSG("Creating socket"); if(!($sock = @socket_create(AF_INET, SOCK_STREAM, SOL_TCP))) { $this->PushError('_connect','socket create failed',socket_strerror(socket_last_error($sock))); return FALSE; } if(!$this->_settimeout($sock)) return FALSE; $this->SendMSG("Connecting to \"".$host.":".$port."\""); if (!($res = @socket_connect($sock, $host, $port))) { $this->PushError('_connect','socket connect failed',socket_strerror(socket_last_error($sock))); @socket_close($sock); return FALSE; } $this->_connected=true; return $sock; } function _readmsg($fnction="_readmsg"){ if(!$this->_connected) { $this->PushError($fnction,'Connect first'); return FALSE; } $result=true; $this->_message=""; $this->_code=0; $go=true; do { $tmp=@socket_read($this->_ftp_control_sock, 4096, PHP_BINARY_READ); if($tmp===false) { $go=$result=false; $this->PushError($fnction,'Read failed', socket_strerror(socket_last_error($this->_ftp_control_sock))); } else { $this->_message.=$tmp; $go = !preg_match("/^([0-9]{3})(-.+\\1)? [^".CRLF."]+".CRLF."$/Us", $this->_message, $regs); } } while($go); if($this->LocalEcho) echo "GET < ".rtrim($this->_message, CRLF).CRLF; $this->_code=(int)$regs[1]; return $result; } function _exec($cmd, $fnction="_exec") { if(!$this->_ready) { $this->PushError($fnction,'Connect first'); return FALSE; } if($this->LocalEcho) echo "PUT > ",$cmd,CRLF; $status=@socket_write($this->_ftp_control_sock, $cmd.CRLF); if($status===false) { $this->PushError($fnction,'socket write failed', socket_strerror(socket_last_error($this->stream))); return FALSE; } $this->_lastaction=time(); if(!$this->_readmsg($fnction)) return FALSE; return TRUE; } function _data_prepare($mode=FTP_ASCII) { if(!$this->_settype($mode)) return FALSE; $this->SendMSG("Creating data socket"); $this->_ftp_data_sock = @socket_create(AF_INET, SOCK_STREAM, SOL_TCP); if ($this->_ftp_data_sock < 0) { $this->PushError('_data_prepare','socket create failed',socket_strerror(socket_last_error($this->_ftp_data_sock))); return FALSE; } if(!$this->_settimeout($this->_ftp_data_sock)) { $this->_data_close(); return FALSE; } if($this->_passive) { if(!$this->_exec("PASV", "pasv")) { $this->_data_close(); return FALSE; } if(!$this->_checkCode()) { $this->_data_close(); return FALSE; } $ip_port = explode(",", preg_replace("/^.+ \\(?([0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]+,[0-9]+)\\)?.*$/s", "\\1", $this->_message)); $this->_datahost=$ip_port[0].".".$ip_port[1].".".$ip_port[2].".".$ip_port[3]; $this->_dataport=(((int)$ip_port[4])<<8) + ((int)$ip_port[5]); $this->SendMSG("Connecting to ".$this->_datahost.":".$this->_dataport); if(!@socket_connect($this->_ftp_data_sock, $this->_datahost, $this->_dataport)) { $this->PushError("_data_prepare","socket_connect", socket_strerror(socket_last_error($this->_ftp_data_sock))); $this->_data_close(); return FALSE; } else $this->_ftp_temp_sock=$this->_ftp_data_sock; } else { if(!@socket_getsockname($this->_ftp_control_sock, $addr, $port)) { $this->PushError("_data_prepare","cannot get control socket information", socket_strerror(socket_last_error($this->_ftp_control_sock))); $this->_data_close(); return FALSE; } if(!@socket_bind($this->_ftp_data_sock,$addr)){ $this->PushError("_data_prepare","cannot bind data socket", socket_strerror(socket_last_error($this->_ftp_data_sock))); $this->_data_close(); return FALSE; } if(!@socket_listen($this->_ftp_data_sock)) { $this->PushError("_data_prepare","cannot listen data socket", socket_strerror(socket_last_error($this->_ftp_data_sock))); $this->_data_close(); return FALSE; } if(!@socket_getsockname($this->_ftp_data_sock, $this->_datahost, $this->_dataport)) { $this->PushError("_data_prepare","cannot get data socket information", socket_strerror(socket_last_error($this->_ftp_data_sock))); $this->_data_close(); return FALSE; } if(!$this->_exec('PORT '.str_replace('.',',',$this->_datahost.'.'.($this->_dataport>>8).'.'.($this->_dataport&0x00FF)), "_port")) { $this->_data_close(); return FALSE; } if(!$this->_checkCode()) { $this->_data_close(); return FALSE; } } return TRUE; } function _data_read($mode=FTP_ASCII, $fp=NULL) { $NewLine=$this->_eol_code[$this->OS_local]; if(is_resource($fp)) $out=0; else $out=""; if(!$this->_passive) { $this->SendMSG("Connecting to ".$this->_datahost.":".$this->_dataport); $this->_ftp_temp_sock=socket_accept($this->_ftp_data_sock); if($this->_ftp_temp_sock===FALSE) { $this->PushError("_data_read","socket_accept", socket_strerror(socket_last_error($this->_ftp_temp_sock))); $this->_data_close(); return FALSE; } } while(($block=@socket_read($this->_ftp_temp_sock, $this->_ftp_buff_size, PHP_BINARY_READ))!==false) { if($block==="") break; if($mode!=FTP_BINARY) $block=preg_replace("/\r\n|\r|\n/", $this->_eol_code[$this->OS_local], $block); if(is_resource($fp)) $out+=fwrite($fp, $block, strlen($block)); else $out.=$block; } return $out; } function _data_write($mode=FTP_ASCII, $fp=NULL) { $NewLine=$this->_eol_code[$this->OS_local]; if(is_resource($fp)) $out=0; else $out=""; if(!$this->_passive) { $this->SendMSG("Connecting to ".$this->_datahost.":".$this->_dataport); $this->_ftp_temp_sock=socket_accept($this->_ftp_data_sock); if($this->_ftp_temp_sock===FALSE) { $this->PushError("_data_write","socket_accept", socket_strerror(socket_last_error($this->_ftp_temp_sock))); $this->_data_close(); return false; } } if(is_resource($fp)) { while(!feof($fp)) { $block=fread($fp, $this->_ftp_buff_size); if(!$this->_data_write_block($mode, $block)) return false; } } elseif(!$this->_data_write_block($mode, $fp)) return false; return true; } function _data_write_block($mode, $block) { if($mode!=FTP_BINARY) $block=preg_replace("/\r\n|\r|\n/", $this->_eol_code[$this->OS_remote], $block); do { if(($t=@socket_write($this->_ftp_temp_sock, $block))===FALSE) { $this->PushError("_data_write","socket_write", socket_strerror(socket_last_error($this->_ftp_temp_sock))); $this->_data_close(); return FALSE; } $block=substr($block, $t); } while(!empty($block)); return true; } function _data_close() { @socket_close($this->_ftp_temp_sock); @socket_close($this->_ftp_data_sock); $this->SendMSG("Disconnected data from remote host"); return TRUE; } function _quit() { if($this->_connected) { @socket_close($this->_ftp_control_sock); $this->_connected=false; $this->SendMSG("Socket closed"); } } } ?>
Edit
Rename
Chmod
Delete
FILE
DIR
INFO
CMD
Name
Size
Permission
Action
admin-filters.php
8034bytes
0666
admin.php
3628bytes
0666
ajax-actions.php
152775bytes
0666
bookmark.php
11678bytes
0666
class-automatic-upgrader-skin.php
3663bytes
0666
class-bulk-plugin-upgrader-skin.php
2590bytes
0666
class-bulk-theme-upgrader-skin.php
2660bytes
0666
class-bulk-upgrader-skin.php
6661bytes
0666
class-core-upgrader.php
15198bytes
0666
class-custom-background.php
21706bytes
0666
class-custom-image-header.php
49183bytes
0666
class-file-upload-upgrader.php
4163bytes
0666
class-ftp-pure.php
5426bytes
0666
class-ftp-sockets.php
8479bytes
0666
class-ftp.php
27343bytes
0666
class-language-pack-upgrader-skin.php
2870bytes
0666
class-language-pack-upgrader.php
15528bytes
0666
class-pclzip.php
196695bytes
0666
class-plugin-installer-skin.php
11947bytes
0666
class-plugin-upgrader-skin.php
3278bytes
0666
class-plugin-upgrader.php
23249bytes
0666
class-theme-installer-skin.php
12974bytes
0666
class-theme-upgrader-skin.php
4176bytes
0666
class-theme-upgrader.php
26783bytes
0666
class-walker-category-checklist.php
5092bytes
0666
class-walker-nav-menu-checklist.php
5781bytes
0666
class-walker-nav-menu-edit.php
14298bytes
0666
class-wp-ajax-upgrader-skin.php
4193bytes
0666
class-wp-application-passwords-list-table.php
6949bytes
0666
class-wp-automatic-updater.php
61902bytes
0666
class-wp-comments-list-table.php
34613bytes
0666
class-wp-community-events.php
18647bytes
0666
class-wp-debug-data.php
71960bytes
0666
class-wp-filesystem-base.php
24410bytes
0666
class-wp-filesystem-direct.php
18607bytes
0666
class-wp-filesystem-ftpext.php
23273bytes
0666
class-wp-filesystem-ftpsockets.php
18497bytes
0666
class-wp-filesystem-ssh2.php
23390bytes
0666
class-wp-importer.php
7823bytes
0666
class-wp-internal-pointers.php
4593bytes
0666
class-wp-links-list-table.php
9514bytes
0666
class-wp-list-table-compat.php
1497bytes
0666
class-wp-list-table.php
53080bytes
0666
class-wp-media-list-table.php
27036bytes
0666
class-wp-ms-sites-list-table.php
22765bytes
0666
class-wp-ms-themes-list-table.php
30227bytes
0666
class-wp-ms-users-list-table.php
15691bytes
0666
class-wp-plugin-install-list-table.php
24974bytes
0666
class-wp-plugins-list-table.php
58107bytes
0666
class-wp-post-comments-list-table.php
1453bytes
0666
class-wp-posts-list-table.php
64983bytes
0666
class-wp-privacy-data-export-requests-list-table.php
5563bytes
0666
class-wp-privacy-data-removal-requests-list-table.php
5715bytes
0666
class-wp-privacy-policy-content.php
32665bytes
0666
class-wp-privacy-requests-table.php
14791bytes
0666
class-wp-screen.php
37440bytes
0666
class-wp-site-health-auto-updates.php
14337bytes
0666
class-wp-site-health.php
131241bytes
0666
class-wp-site-icon.php
6414bytes
0666
class-wp-terms-list-table.php
21071bytes
0666
class-wp-theme-install-list-table.php
15703bytes
0666
class-wp-themes-list-table.php
10339bytes
0666
class-wp-upgrader-skin.php
7064bytes
0666
class-wp-upgrader-skins.php
1477bytes
0666
class-wp-upgrader.php
48366bytes
0666
class-wp-users-list-table.php
19004bytes
0666
comment.php
6231bytes
0666
continents-cities.php
20540bytes
0666
credits.php
5832bytes
0666
dashboard.php
70383bytes
0666
deprecated.php
41753bytes
0666
edit-tag-messages.php
1478bytes
0666
export.php
25976bytes
0666
file.php
97913bytes
0666
image-edit.php
43994bytes
0666
image.php
45171bytes
0666
import.php
6617bytes
0666
list-table.php
3802bytes
0666
media.php
119934bytes
0666
menu.php
9640bytes
0666
meta-boxes.php
66857bytes
0666
misc.php
46443bytes
0666
ms-admin-filters.php
1296bytes
0666
ms-deprecated.php
3770bytes
0666
ms.php
34252bytes
0666
nav-menu.php
49127bytes
0666
network.php
27038bytes
0666
noop.php
1148bytes
0666
options.php
4244bytes
0666
plugin-install.php
39040bytes
0666
plugin.php
93281bytes
0666
post.php
82260bytes
0666
privacy-tools.php
33441bytes
0666
revision.php
16629bytes
0666
schema.php
45583bytes
0666
screen.php
6390bytes
0666
taxonomy.php
8483bytes
0666
template.php
99684bytes
0666
theme-install.php
6990bytes
0666
theme.php
47533bytes
0666
translation-install.php
11075bytes
0666
update-core.php
72771bytes
0666
update.php
34844bytes
0666
upgrade.php
116693bytes
0666
user.php
23950bytes
0666
widgets.php
10546bytes
0666