403Webshell
Server IP : 35.80.110.71  /  Your IP : 216.73.216.221
Web Server : Apache/2.4.58 (Ubuntu)
System : Linux ip-172-31-21-44 6.17.0-1019-aws #19~24.04.1-Ubuntu SMP Tue Jun 23 18:53:06 UTC 2026 x86_64
User : ubuntu ( 1000)
PHP Version : 8.3.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/landscape/lib/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/landscape/lib/machine_id.py
import logging
import uuid

# exclude _get_machine_id
__all__ = [
    "get_namespaced_machine_id",
    "LANDSCAPE_CLIENT_APP_UUID",
    "MACHINE_ID_FILE",
    "MACHINE_ID_SIZE",
]

# Used to build a namespaced-uuid from the machine ids of client instances.
# It was generated using `uuidgen -r`
# This value should never change. Ever.
LANDSCAPE_CLIENT_APP_UUID = uuid.UUID("534a0cda-35a7-4f8a-a5cb-d8d9bb24a790")

# https://manpages.ubuntu.com/manpages/bionic/man5/machine-id.5.html
# We expect 32 ASCII characters, so we won't read in any more than
# the expected 32 bytes.
MACHINE_ID_FILE = "/etc/machine-id"
MACHINE_ID_SIZE = 32


def _get_machine_id() -> str:
    with open(MACHINE_ID_FILE, "r") as f:
        machine_id = f.read(MACHINE_ID_SIZE)
    return machine_id


def get_namespaced_machine_id() -> str | None:
    try:
        machine_id = _get_machine_id()
    except Exception as e:
        logging.warning(str(e))
        return
    if not machine_id:
        return
    return str(uuid.uuid5(LANDSCAPE_CLIENT_APP_UUID, machine_id))

Youez - 2016 - github.com/yon3zu
LinuXploit