qshinoの日記

Powershell関係と徒然なこと

LinuxからWindows制御

LinuxからWindows制御

winexeが使える。

コンピュータ名 hunnyの場合。

winexe -U hunny/Administrator%poi //192.168.1.1 "echo Oha-"

開放が必要なポート

  • 135/tcp(RPCエンドポイント・マッパー)
  • 445/tcp(ダイレクト・ホスティングSMB)
  • 1025~65535/tcp(RPC動的ポート)

UAC

User Access Controlに拒否される場合がある。その場合は、UAC無効化が必要。

レジストリ

win7ではレジストリ変更が必要。

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System

のDWordで

LocalAccountTokenFilterPolicy = 1

エラーの場合

下記のエラーが出る場合

[winexe/winexe.c:120:on_ctrl_pipe_error()] ERROR: Failed to install service winexesvc – NT code 0x00000424

サービス登録する

sc create winexesvc binPath= C:\WINDOWS\WINEXESVC.EXE start= auto DisplayName= winexesvc
sc description winexesvc “Remote command provider for Zenoss monitoring”

https://orebibou.com/2015/03/linuxでコンソールからwindowsを操作しよう!psexecのlinux版『winexe』/

参考

winexe

http://eol.ovh.org/winexe/

http://technet.microsoft.com/ja-jp/magazine/cc162490.aspx

http://www.atmarkit.co.jp/fsecurity/column/ueno/43.html

https://www.google.co.jp/amp/fujishinko.exblog.jp/amp/8239119/

UAC無効化

http://www.atmarkit.co.jp/ait/spv/0703/09/news127.html

Win7ではレジストリ変更が必要。

http://takuya-1st.hatenablog.jp/entry/2014/08/03/170845

以上