Skip to content
KitploitKITPLOIT
OutilsBlog
Soumettre
OutilsBlog
Soumettre

Outils de Hacking, PenTest et Cybersécurité pour votre Arsenal de Sécurité !

Kitploit est un répertoire d'outils de hacking, de cybersécurité et de pentesting. Découvrez les dernières mises à jour des projets pour trouver des vulnérabilités, analyser des systèmes, automatiser les tests et renforcer votre sécurité.

··Flux·Contact·Confidentialité·© 2026 Kitploit

Répertoire d'outils

Catégories

Voir toutes les catégories
Loading categories
rdpy — Protocole de bureau à distance dans Twisted Python | Kitploit
Outils/GitHubGitHub/citronneur/rdpy
Sécurité RéseauTests d'IntrusionRed TeamingOutil d'Accès à Distance
GitHubcitronneur/rdpy

rdpy

Protocole de bureau à distance dans Twisted Python

Voir le dépôt
1.7k5406il y a 6 ansVérifié par Kitploit

Populaires

Voir tout →

Découvrez les outils les plus utilisés par notre communauté.

Explorer tous les outils

Parcourez notre collection d'outils

Voir tous les outils →
Partager

RDPY Build Status PyPI version

Protocole de bureau à distance en Python Twisted.

RDPY est une implémentation pure Python du protocole Microsoft RDP (Remote Desktop Protocol) (côté client et serveur). RDPY est construit sur le moteur réseau piloté par événements Twisted. RDPY prend en charge la couche de sécurité RDP standard, RDP sur SSL et l'authentification NLA (via le protocole d'authentification ntlmv2).

RDPY fournit les binaires RDP et VNC suivants :

  • Proxy RDP Man In The Middle qui enregistre les sessions
  • RDP Honeypot
  • RDP capture d'écran
  • Client RDP
  • Client VNC
  • VNC capture d'écran
  • Lecteur RSS

Compilation

RDPY est entièrement implémenté en Python, à l'exception de l'algorithme de décompression bitmap qui est implémenté en C pour des raisons de performance.

Dépendances

Les dépendances ne sont nécessaires que pour les binaires pyqt4 :

  • rdpy-rdpclient
Télécharger l’outil
  • rdpy-rdpscreenshot
  • rdpy-vncclient
  • rdpy-vncscreenshot
  • rdpy-rssplayer
  • Linux

    Exemple pour les systèmes basés sur Debian :

    root@kitploit:~
    sudo apt-get install python-qt4
    

    OS X

    Exemple pour OS X pour installer PyQt avec homebrew

    root@kitploit:~
    $ brew install qt sip pyqt
    

    Windows

    x86x86_64
    PyQt4PyQt4
    PyWin32PyWin32

    Compilation

    root@kitploit:~
    $ git clone https://github.com/citronneur/rdpy.git rdpy
    $ pip install twisted pyopenssl qt4reactor service_identity rsa pyasn1
    $ python rdpy/setup.py install
    

    Ou utilisez PIP :

    root@kitploit:~
    $ pip install rdpy
    

    Pour virtualenv, vous devrez lier la bibliothèque qt4 à celui-ci :

    root@kitploit:~
    $ ln -s /usr/lib/python2.7/dist-packages/PyQt4/ $VIRTUAL_ENV/lib/python2.7/site-packages/
    $ ln -s /usr/lib/python2.7/dist-packages/sip.so $VIRTUAL_ENV/lib/python2.7/site-packages/
    

    Binaires RDPY

    RDPY est livré avec des binaires très utiles. Ces binaires sont compatibles Linux et Windows.

    rdpy-rdpclient

    rdpy-rdpclient est un client RDP Qt4 simple.

    root@kitploit:~
    $ rdpy-rdpclient.py [-u username] [-p password] [-d domain] [-r rss_ouput_file] [...] XXX.XXX.XXX.XXX[:3389]
    

    Vous pouvez utiliser rdpy-rdpclient dans un scénario de session d'enregistrement, utilisé dans rdpy-rdphoneypot.

    rdpy-vncclient

    rdpy-vncclient est un client VNC Qt4 simple.

    root@kitploit:~
    $ rdpy-vncclient.py [-p password] XXX.XXX.XXX.XXX[:5900]
    

    rdpy-rdpscreenshot

    rdpy-rdpscreenshot enregistre l'écran de connexion dans un fichier.

    root@kitploit:~
    $ rdpy-rdpscreenshot.py [-w width] [-l height] [-o output_file_path] XXX.XXX.XXX.XXX[:3389]
    

    rdpy-vncscreenshot

    rdpy-vncscreenshot enregistre la première mise à jour d'écran dans un fichier.

    root@kitploit:~
    $ rdpy-vncscreenshot.py [-p password] [-o output_file_path] XXX.XXX.XXX.XXX[:5900]
    

    rdpy-rdpmitm

    rdpy-rdpmitm est un proxy RDP qui vous permet de réaliser une attaque Man In The Middle sur le protocole RDP. Enregistre un scénario de session dans un fichier rss qui peut être rejoué par rdpy-rssplayer.

    root@kitploit:~
    $ rdpy-rdpmitm.py -o output_dir [-l listen_port] [-k private_key_file_path] [-c certificate_file_path] [-r (for XP or server 2003 client)] target_host[:target_port]
    

    Le répertoire de sortie est utilisé pour enregistrer le fichier rss avec le format suivant (YYYYMMDDHHMMSS_ip_index.rss) Le fichier de clé privée et le fichier de certificat sont des fichiers cryptographiques classiques pour les connexions SSL. Le protocole RDP peut négocier sa propre couche de sécurité. Si l'un des deux paramètres est omis, le serveur utilise le RDP standard comme couche de sécurité.

    rdpy-rdphoneypot

    rdpy-rdphoneypot est un pot de miel RDP. Utilise un scénario de session enregistré pour rejouer le scénario via le protocole RDP.

    root@kitploit:~
    $ rdpy-rdphoneypot.py [-l listen_port] [-k private_key_file_path] [-c certificate_file_path] rss_file_path_1 ... rss_file_path_N
    

    Le fichier de clé privée et le fichier de certificat sont des fichiers cryptographiques classiques pour les connexions SSL. Le protocole RDP peut négocier sa propre couche de sécurité. Si l'un des deux paramètres est omis, le serveur utilise le RDP standard comme couche de sécurité. Vous pouvez spécifier plusieurs fichiers pour correspondre à des tailles d'écran plus courantes.

    rdpy-rssplayer

    rdpy-rssplayer est utilisé pour rejouer les fichiers de scénario de session enregistrée (rss) générés par les binaires rdpy-rdpmitm ou rdpy-rdpclient.

    root@kitploit:~
    $ rdpy-rssplayer.py rss_file_path
    

    Widget Qt RDPY

    RDPY peut également être utilisé comme widget Qt via la classe rdpy.ui.qt4.QRemoteDesktop. Il peut être intégré dans votre propre application Qt. qt4reactor doit être utilisé dans votre application pour que Twisted et Qt fonctionnent ensemble. Pour plus de détails, consultez les sources de rdpy-rdpclient.

    Bibliothèque RDPY

    En résumé, RDPY peut être utilisé comme une bibliothèque de protocole avec un moteur twisted.

    Client RDP simple

    root@kitploit:~
    from rdpy.protocol.rdp import rdp
    
    class MyRDPFactory(rdp.ClientFactory):
    
        def clientConnectionLost(self, connector, reason):
            reactor.stop()
    
        def clientConnectionFailed(self, connector, reason):
            reactor.stop()
    
        def buildObserver(self, controller, addr):
    
            class MyObserver(rdp.RDPClientObserver):
    
                def onReady(self):
                    """
                    @summary: Call when stack is ready
                    """
                    #send 'r' key
                    self._controller.sendKeyEventUnicode(ord(unicode("r".toUtf8(), encoding="UTF-8")), True)
                    #mouse move and click at pixel 200x200
                    self._controller.sendPointerEvent(200, 200, 1, true)
    
                def onUpdate(self, destLeft, destTop, destRight, destBottom, width, height, bitsPerPixel, isCompress, data):
                    """
                    @summary: Notify bitmap update
                    @param destLeft: xmin position
                    @param destTop: ymin position
                    @param destRight: xmax position because RDP can send bitmap with padding
                    @param destBottom: ymax position because RDP can send bitmap with padding
                    @param width: width of bitmap
                    @param height: height of bitmap
                    @param bitsPerPixel: number of bit per pixel
                    @param isCompress: use RLE compression
                    @param data: bitmap data
                    """
                    
                def onSessionReady(self):
    		        """
    		        @summary: Windows session is ready
    		        """
    
                def onClose(self):
                    """
                    @summary: Call when stack is close
                    """
    
            return MyObserver(controller)
    
    from twisted.internet import reactor
    reactor.connectTCP("XXX.XXX.XXX.XXX", 3389, MyRDPFactory())
    reactor.run()
    

    Serveur RDP simple

    root@kitploit:~
    from rdpy.protocol.rdp import rdp
    
    class MyRDPFactory(rdp.ServerFactory):
    
        def buildObserver(self, controller, addr):
    
            class MyObserver(rdp.RDPServerObserver):
    
                def onReady(self):
                    """
                    @summary: Call when server is ready
                    to send and receive messages
                    """
    
                def onKeyEventScancode(self, code, isPressed):
                    """
                    @summary: Event call when a keyboard event is catch in scan code format
                    @param code: scan code of key
                    @param isPressed: True if key is down
                    @see: rdp.RDPServerObserver.onKeyEventScancode
                    """
    
                def onKeyEventUnicode(self, code, isPressed):
                    """
                    @summary: Event call when a keyboard event is catch in unicode format
                    @param code: unicode of key
                    @param isPressed: True if key is down
                    @see: rdp.RDPServerObserver.onKeyEventUnicode
                    """
    
                def onPointerEvent(self, x, y, button, isPressed):
                    """
                    @summary: Event call on mouse event
                    @param x: x position
                    @param y: y position
                    @param button: 1, 2, 3, 4 or 5 button
                    @param isPressed: True if mouse button is pressed
                    @see: rdp.RDPServerObserver.onPointerEvent
                    """
    
                def onClose(self):
                    """
                    @summary: Call when human client close connection
                    @see: rdp.RDPServerObserver.onClose
                    """
    
            return MyObserver(controller)
    
    from twisted.internet import reactor
    reactor.listenTCP(3389, MyRDPFactory())
    reactor.run()
    

    Client VNC simple

    root@kitploit:~
    from rdpy.protocol.rfb import rfb
    
    class MyRFBFactory(rfb.ClientFactory):
    
        def clientConnectionLost(self, connector, reason):
            reactor.stop()
    
        def clientConnectionFailed(self, connector, reason):
            reactor.stop()
    
        def buildObserver(self, controller, addr):
            class MyObserver(rfb.RFBClientObserver):
    
                def onReady(self):
                    """
                    @summary: Event when network stack is ready to receive or send event
                    """
    
                def onUpdate(self, width, height, x, y, pixelFormat, encoding, data):
                    """
                    @summary: Implement RFBClientObserver interface
                    @param width: width of new image
                    @param height: height of new image
                    @param x: x position of new image
                    @param y: y position of new image
                    @param pixelFormat: pixefFormat structure in rfb.message.PixelFormat
                    @param encoding: encoding type rfb.message.Encoding
                    @param data: image data in accordance with pixel format and encoding
                    """
    
                def onCutText(self, text):
                    """
                    @summary: event when server send cut text event
                    @param text: text received
                    """
    
                def onBell(self):
                    """
                    @summary: event when server send biiip
                    """
    
                def onClose(self):
                    """
                    @summary: Call when stack is close
                    """
    
            return MyObserver(controller)
    
    from twisted.internet import reactor
    reactor.connectTCP("XXX.XXX.XXX.XXX", 3389, MyRFBFactory())
    reactor.run()