Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7680155
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T18:02:52+00:00 2026-05-31T18:02:52+00:00

I am currently trying to do something similar to PSExec but entirely in Java.

  • 0

I am currently trying to do something similar to PSExec but entirely in Java.
I think my problem isnt directly relate to actually what I am doing, but how.
Currently I am trying to implement the creating and starting of a service remotely.

For this I got my hands on the midlc tool (version 0.6.1) and extended the svcctl.idl with the CreateService and DeleteService calls. After that I used midlc to generate code for usage with jcifs ( -t jcifs ). I then created a test-program to use that class and jcifs to communicate with a remote windows machine.

Here comes the code for that:

        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();
            }
        }

Unfortunately I am getting a DCERPC_FAULT_PROTO_ERROR alias nca_proto_error alias 0x1c01000b

So my simple question is … what am I doing wrong?

Chris

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T18:02:54+00:00Added an answer on May 31, 2026 at 6:02 pm

    Ok,

    I sorted this out. The problem was, that the request type was not initialized and hereby set to -1 which is not a valid value. By manually setting this, I was able to actually perform the tasks I was trying to do:

    https://dev.c-ware.de/confluence/pages/viewpage.action?pageId=15007754

    Chris

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is a fairly niche problem, but I'm currently trying to write a conventions-based
All I am currently trying implement something along the lines of dim l_stuff as
I am currently trying to achieve something like this: Based on this class, I
I'm currently trying to build (a simpler version of) a status website similar to
I'm trying to do something similar to this question. I've got a main app
I'm currently trying to code a custom image cropping system similar to other ones
I'm trying to create simple 2D action game, something similar to well known Fancy
I am trying something new and I am having issues with my current idea.
Im trying to write something to get my images to show correctly. I have
I'm trying to implement something like this: <div> <table> <thead> <tr> <td>Port name</td> <td>Current

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.