• XSS.stack #1 – первый литературный журнал от юзеров форума

(Script) Playing around with vnc.. and there exploits.

root3d

RAID-массив
Забанен
Регистрация
24.11.2022
Сообщения
69
Реакции
29
Пожалуйста, обратите внимание, что пользователь заблокирован
There is always a room for improvement.
open for ideas.
open source.​
Python:
import os
import platform
import socket
import requests

import vncdotool
import stem
import stem.process

class RemoteViewer:
    def __init__(self, host, port):
        self.host = host
        self.port = port
        self.vnc_client = None
        self.tor_process = None

    def connect(self):
        self.tor_process = stem.process.launch_tor_with_config(
            config = {
                'SocksPort': str(self.port),
                'ControlPort': '9051',
                'ExitNodes': '{ru}',
            },
        )

        self.vnc_client = vncdotool.VNCDoTool(self.host, self.port)
        self.vnc_client.connect()

    def get_machine_info(self):
        machine_info = {}
        machine_info['hostname'] = socket.gethostname()
        machine_info['ip_address'] = socket.gethostbyname(machine_info['hostname'])
        machine_info['os_name'] = platform.system()
        machine_info['os_version'] = platform.release()
        machine_info['architecture'] = platform.machine()
        return machine_info

    def check_reachability(self):
        try:
            response = requests.get(f"http://{self.host}:{self.port}", timeout=5)
            if response.status_code == 200:
                return True
            else:
                return False
        except requests.exceptions.RequestException as e:
            return False

    def check_vnc_vulnerabilities(self):
        vulnerabilities = []
        # A list of known vulnerabilities in the VNC service
        known_vulnerabilities = [
            "CVE-2006-2369",
            "CVE-2006-2370",
            "CVE-2006-2371",
            "CVE-2006-2372",
            "CVE-2006-2373",
            "CVE-2006-2374",
            "CVE-2006-2375",
            "CVE-2006-2376",
            "CVE-2006-2377",
            "CVE-2006-2378",
            "CVE-2010-2237",
        ]
        # Check if the known vulnerabilities exist
        for cve in known_vulnerabilities:
            response = requests.get(f"https://cve.mitre.org/cgi-bin/cvename.cgi?name={cve}")
            if response.status_code == 200:
                vulnerabilities.append(cve)
        return vulnerabilities

    def run(self):
        self.connect()
        if self.check_reachability():
            machine_info = self.get_machine_info()
            print(f"Connected to {self.host}:{self.port}")
            print("Machine Information:")
            for key, value in machine_info.items():
                print(f"\t{key}: {value}")
            vnc_vulnerabilities = self.check_vnc_vulnerabilities()
            if vnc_vulnerabilities:
                print(f"VNC server has vulnerabilities: {vnc_vulnerabilities}")
            else:
                print("No known vulnerabilities found in VNC server.")
            for key, value in machine_info.items():
                print(f"\t{key}: {value}")
            self.vnc_client.start()
        else:
            print("Machine is unreachable or it's not possible!")

    def stop(self):
        self.vnc_client.close()
        self.tor_process.kill()

if __name__ == '__main__':
    remote_viewer = RemoteViewer(host='127.0.0.1', port=5900)
    try:
        remote_viewer.run()
    except KeyboardInterrupt:
        remote_viewer.stop()
 


Напишите ответ...
  • Вставить:
Прикрепить файлы
Верх