Linux anchor 4.4.0-210-generic #242-Ubuntu SMP Fri Apr 16 09:57:56 UTC 2021 x86_64
Apache/2.4.18 (Ubuntu)
Server IP : 10.10.100.4 & Your IP : 216.73.217.150
Domains :
Cant Read [ /etc/named.conf ]
User : www-data
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
var /
www /
wiki.bernardino.org /
includes /
utils /
Delete
Unzip
Name
Size
Permission
Date
Action
AutoloadGenerator.php
10.85
KB
-rw-r--r--
2016-11-28 20:20
AvroValidator.php
5.23
KB
-rw-r--r--
2016-11-28 20:20
BatchRowIterator.php
8.17
KB
-rw-r--r--
2016-11-28 20:20
BatchRowUpdate.php
3.62
KB
-rw-r--r--
2016-11-28 20:20
BatchRowWriter.php
2.22
KB
-rw-r--r--
2016-11-28 20:20
FileContentsHasher.php
3.27
KB
-rw-r--r--
2016-11-28 20:20
MWCryptHKDF.php
4.05
KB
-rw-r--r--
2016-11-28 20:20
MWCryptRand.php
2.94
KB
-rw-r--r--
2016-11-28 20:20
MWFileProps.php
3.98
KB
-rw-r--r--
2016-11-28 20:20
MWRestrictions.php
3.81
KB
-rw-r--r--
2016-11-28 20:20
README
531
B
-rw-r--r--
2016-11-28 20:20
RowUpdateGenerator.php
1.34
KB
-rw-r--r--
2016-11-28 20:20
UIDGenerator.php
22.95
KB
-rw-r--r--
2016-11-28 20:20
ZipDirectoryReader.php
21.63
KB
-rw-r--r--
2016-11-28 20:20
Save
Rename
<?php /** * A class to check request restrictions expressed as a JSON object * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * http://www.gnu.org/copyleft/gpl.html */ /** * A class to check request restrictions expressed as a JSON object */ class MWRestrictions { private $ipAddresses = [ '0.0.0.0/0', '::/0' ]; /** * @param array $restrictions * @throws InvalidArgumentException */ protected function __construct( array $restrictions = null ) { if ( $restrictions !== null ) { $this->loadFromArray( $restrictions ); } } /** * @return MWRestrictions */ public static function newDefault() { return new self(); } /** * @param array $restrictions * @return MWRestrictions * @throws InvalidArgumentException */ public static function newFromArray( array $restrictions ) { return new self( $restrictions ); } /** * @param string $json JSON representation of the restrictions * @return MWRestrictions * @throws InvalidArgumentException */ public static function newFromJson( $json ) { $restrictions = FormatJson::decode( $json, true ); if ( !is_array( $restrictions ) ) { throw new InvalidArgumentException( 'Invalid restrictions JSON' ); } return new self( $restrictions ); } private function loadFromArray( array $restrictions ) { static $validKeys = [ 'IPAddresses' ]; static $neededKeys = [ 'IPAddresses' ]; $keys = array_keys( $restrictions ); $invalidKeys = array_diff( $keys, $validKeys ); if ( $invalidKeys ) { throw new InvalidArgumentException( 'Array contains invalid keys: ' . implode( ', ', $invalidKeys ) ); } $missingKeys = array_diff( $neededKeys, $keys ); if ( $missingKeys ) { throw new InvalidArgumentException( 'Array is missing required keys: ' . implode( ', ', $missingKeys ) ); } if ( !is_array( $restrictions['IPAddresses'] ) ) { throw new InvalidArgumentException( 'IPAddresses is not an array' ); } foreach ( $restrictions['IPAddresses'] as $ip ) { if ( !\IP::isIPAddress( $ip ) ) { throw new InvalidArgumentException( "Invalid IP address: $ip" ); } } $this->ipAddresses = $restrictions['IPAddresses']; } /** * Return the restrictions as an array * @return array */ public function toArray() { return [ 'IPAddresses' => $this->ipAddresses, ]; } /** * Return the restrictions as a JSON string * @param bool|string $pretty Pretty-print the JSON output, see FormatJson::encode * @return string */ public function toJson( $pretty = false ) { return FormatJson::encode( $this->toArray(), $pretty, FormatJson::ALL_OK ); } public function __toString() { return $this->toJson(); } /** * Test against the passed WebRequest * @param WebRequest $request * @return Status */ public function check( WebRequest $request ) { $ok = [ 'ip' => $this->checkIP( $request->getIP() ), ]; $status = Status::newGood(); $status->setResult( $ok === array_filter( $ok ), $ok ); return $status; } /** * Test an IP address * @param string $ip * @return bool */ public function checkIP( $ip ) { foreach ( $this->ipAddresses as $range ) { if ( \IP::isInRange( $ip, $range ) ) { return true; } } return false; } }