私は現在、PSExec に似た何かをしようとしていますが、完全に Java です。私の問題は、実際に私がしていることに直接関係しているとは思いませんが、どのように. 現在、サービスの作成と開始をリモートで実装しようとしています。
このために、私は midlc ツール (バージョン 0.6.1) を手に入れ、CreateService 呼び出しと DeleteService 呼び出しで svcctl.idl を拡張しました。その後、midlc を使用して、jcifs ( -t jcifs ) で使用するコードを生成しました。次に、そのクラスと jcifs を使用してリモートの Windows マシンと通信するテスト プログラムを作成しました。
そのためのコードは次のとおりです。
rpc.policy_handle scHandle = new rpc.policy_handle();
SvcCtl.OpenSCManager openSCManagerRpc = new SvcCtl.OpenSCManager(host, null, 0x0001 | 0x0002, scHandle);
// Connection-oriented DCE/RPC over SMB named pipes.
DcerpcHandle handle = DcerpcHandle.getHandle("ncacn_np:" + host + "[\\PIPE\\svcctl]",
ConcurrentNtlmAuthenticator.getInstance().getNtlmPasswordAuthentication());
try {
handle.sendrecv(openSCManagerRpc);
if (openSCManagerRpc.retval != 0) {
throw new SmbException(openSCManagerRpc.retval, true);
}
} catch(Exception e) {
e.printStackTrace();
} finally {
try {
handle.close();
} catch(IOException ioe) {
ioe.printStackTrace();
}
}
残念ながら、私は DCERPC_FAULT_PROTO_ERROR エイリアス nca_proto_error エイリアス 0x1c01000b を取得しています
だから私の簡単な質問は...私は何を間違っているのですか?
クリス