35 lines
1.1 KiB
JavaScript
35 lines
1.1 KiB
JavaScript
// ==UserScript==
|
|
// @name Wazuh Auto-Login
|
|
// @namespace http://tampermonkey.net/
|
|
// @version 1.0
|
|
// @description Auto-login to Wazuh dashboard with read-only user
|
|
// @match https://192.168.168.96/*
|
|
// @grant none
|
|
// @run-at document-idle
|
|
// ==/UserScript==
|
|
|
|
(function () {
|
|
const username = "";
|
|
const password = "";
|
|
|
|
const tryLogin = () => {
|
|
const userInput = document.querySelector('input[aria-label="username_input"]');
|
|
const passInput = document.querySelector('input[aria-label="password_input"]');
|
|
const loginButton = document.querySelector('button[data-test-subj="submit"]');
|
|
|
|
if (userInput && passInput && loginButton) {
|
|
userInput.value = username;
|
|
userInput.dispatchEvent(new Event('input', { bubbles: true }));
|
|
passInput.value = password;
|
|
passInput.dispatchEvent(new Event('input', { bubbles: true }));
|
|
|
|
setTimeout(() => loginButton.click(), 300);
|
|
} else {
|
|
setTimeout(tryLogin, 300);
|
|
}
|
|
};
|
|
|
|
tryLogin();
|
|
})();
|
|
|