Facebook Profile ID Extractor (OSINT)

Extracts Facebook profile ID

目前為 2025-02-18 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Facebook Profile ID Extractor (OSINT)
// @version      1.0
// @description  Extracts Facebook profile ID
// @author       SH3LL
// @match        https://www.facebook.com/*
// @namespace https://greasyfork.org/users/762057
// ==/UserScript==

(function() {
    'use strict';

    let popup = null; // Store the popup element
    let labelAdded = false;

    function createPopup() {
        popup = document.createElement('div');
        popup.style.cssText = `
            position: fixed;
            top: 65px;
            right: 43%;
            background-color: black;
            border: 1px solid #ccc;
            padding: 10px;
            border-radius: 5px;
            z-index: 9999; /* Ensure it's on top */
            font-weight: bold;
        `;
        document.body.appendChild(popup);
    }

    function extractInfo() {
        if (labelAdded) return;

        try {
            const userIdRegex = /"userID":"(\d+)"/;
            const userIdMatch = document.documentElement.outerHTML.match(userIdRegex);

            if (userIdMatch && userIdMatch[1]) {
                const userId = userIdMatch[1];
                const link = document.createElement('a'); // Create a link element
                link.href = "https://www.facebook.com/profile.php?id=" + userId; // Set the URL
                link.target = "_blank"; // Open in a new tab (optional)
                link.style.color = 'red';
                link.innerText = "User ID: " + userId;


                if (!popup) {
                    createPopup(); // Create popup if it doesn't exist
                }
                popup.appendChild(link); // Add the link to the popup
                labelAdded = true;
            } else {
                console.error("Facebook ID not found.");
                return;
            }
        } catch (e) {
            console.error("Error processing request: " + e.message);
            if (!popup) {
                createPopup();
            }
            return;
        }
    }

    const checkInterval = setInterval(() => {
        if (document.readyState === 'complete') { // Check if the page is fully loaded
            clearInterval(checkInterval);
            extractInfo();
        }
    }, 500);

})();