[INFO] Imagen:
[INFO] Este es un proyecto para Windows, pero también se pueden generar los scripts en Linux.
[INFO] Este proyecto combina Python, BATCH y VBS (Visual Basic Scripting).
[INFO] Especiales agradecimientos a Euronymou5 sin el que este proyecto habría sido inviable.
[INFO] Sistemas operativos soportados:
| Sistema operativo | Soporte |
|---|---|
| Windows | ✔️ |
| Linux | ✔️ |
| MacOS | ❌ |
| Android | ❌ |
| Apple & IOS | ❌ |
[INFO] Instalación en Windows:
[1] Descarga el archivo .zip
[2] Abre la carpeta y ejecuta el install.bat gráficamente o desde el terminal con start install.bat
[INFO] Instalación en Linux:
[1] Instalación con comandos:
sudo apt update && sudo apt upgrade && git clone https://www.github.com/VBSInjection && cd VBSInjection && chmod +x setup.sh && chmod 777 setup.sh && sudo bash setup.sh
[INFO] Hotkeys soportadas:
[INFO] Source: https://ss64.com/vb/sendkeys.html
| Hotkey | Manera |
|---|---|
| SHIFT | (+ prefix) wshshell.sendkeys "%{F6}" |
| CTRL | (^ PREFIX) wshshell.sendkeys "^{escape}" |
| ALT | (% prefix) wshshell.sendkeys "%{F4}" |
| Hotkey | Soporte para la v1 |
|---|---|
| ENTER | ✔️ |
| ESCAPE | ✔️ |
| BACKSPACE | ✔️ |
| BREAK | ✔️ |
| CAPSLOCK | ✔️ |
| CLEAR | ✔️ |
| DELETE | ✔️ |
| INSERT | ✔️ |
| LEFT/RIGHT/UP/DOWN | ✔️ |
| END | ✔️ |
| F1-F16 | ✔️ |
| HELP | ✔️ |
| HOME | ✔️ |
| NUMLOCK | ✔️ |
| PGUP/PGDN | ✔️ |
| PRTSC (print screen) | ✔️ |
| SCROLLOCK | ✔️ |
| TAB | ✔️ |
[INFO] Comandos:
$ python3 main.py --help
usage: main.py [-h] [--open OPEN] [--begin BEGIN] [--sleep SLEEP] [--write WRITE] [--keyhot KEYHOT] [--appactivate APPACTIVATE] [--message MESSAGE]
[--close CLOSE]
options:
-h, --help show this help message and exit
--open OPEN, -o OPEN Indica el nombre y la extensión del archivo a abrir
--begin BEGIN, -b BEGIN
Empieza creando el objeto de VBS en el archivo. Este argumento es necesario para empezar a crear el script
--sleep SLEEP, -s SLEEP
Crea una pausa en el script de VBS del tiempo especificado en el argumento
--write WRITE, -w WRITE
Escribe una tecla normal en el script VBS para que sea inyectada cuando se ejecute
--keyhot KEYHOT, -k KEYHOT
Escribe una hotkey especificada en mayúscuñas en el archivo VBS
--appactivate APPACTIVATE, -a APPACTIVATE
Avtiva la app indicada
--message MESSAGE, -m MESSAGE
Indica el texto a mostrar en el mensaje
--close CLOSE, -c CLOSE
Cierra el archivo
[INFO] Funcionamiento:
[INFO] Se importan las librerías:
import os, argparse, sys
from colorama import Fore, Back[INFO] Creamos los argumentos de parser:
parser = argparse.ArgumentParser()
parser.add_argument('--open', '-o',
required=False,
help="Indica el nombre y la extensión del archivo a abrir")
args = parser.parse_args()[INFO] Para crear los colores del texto:
class color:
RED = Fore.RED + Back.RESET
RESET = Fore.RESET + Back.RESET[INFO] Procesamos los argumentos con una condicional:
if args.begin == 'true':
file = open('inject.vbs', 'a')
file.write('Set WshShell = WScript.CreateObject("WScript.Shell")\n')
file.write('strName = wshShell.ExpandEnvironmentStrings( "%USERNAME%" )\n')
sys.exit()[INFO] Comandos de VBS soportados:
[INFO] MsgBox:
MsgBox"Hello World",48,"Mensaje del sistema"[INFO] Inciar el código creando el objeto:
Set WshShell = WScript.CreateObject("WScript.Shell")
strName = wshShell.ExpandEnvironmentStrings( "%USERNAME%" )[INFO] Iniciar una app:
wshshell.run "cmd.exe"
wshshell.AppActivate "cmd.exe"[INFO] Tiempo de pausa. En el argumento de Python se indica el tiempo en segundos y se traduce a milisegundos en el programa de VBS:
WScript.sleep 1000[INFO] Inyección de pulsaciones del teclado:
wshshell.sendkeys "hello"[INFO] Inyección de hotkeys:
wshshell.sendkeys "{ENTER}"[INFO] Ejemplos de ejecución:
python3 main.py -o true
python3 main.py -b true
python3 main.py -s 1
python3 main.py -a cmd.exe
python3 main.py -s 1
python3 main.py -m Ejecutando...
python3 main.py -w ipconfig
python3 main.py -k ENTER
python3 main.py -s 1
python3 main.py -w exit
python3 main.py -k ENTER
python3 main.py -c true
[INFO] Esto generaría un programa de output (inject.vbs) donde estaría el siguiente contenido:
Set WshShell = WScript.CreateObject("WScript.Shell")
strName = wshShell.ExpandEnvironmentStrings( "%USERNAME%" )
WScript.sleep 1000
wshshell.run "cmd.exe"
wshshell.AppActivate "cmd.exe"
WScript.sleep 1000
MsgBox"Ejecutando...",48,"Mensaje del sistema"
wshshell.sendkeys "ipconfig"
wshshell.sendkeys "{ENTER}"
WScript.sleep 1000
wshshell.sendkeys "exit"
wshshell.sendkeys "{ENTER}"
[INFO] En este caso el programa serviría para abrir el CMD, ejecutar el comando ipconfig y salir del terminal.
[ 📬 ] Contacta conmigo a través de Discord mandando una invitación a qwfkr.
qwfkr
[ 📬 ] Si lo prefieres, mándame un correo a 3xpl017.contact@proton.me.
3xpl017.contact@proton.me.

