Skip to content

SMB2 over RPC example #22

Answered by oiweiwei
krasnovu asked this question in Q&A
Jan 21, 2025 · 3 comments · 4 replies
Discussion options

You must be logged in to vote

The actual problem (or problems) with provided code are following:

you use WithConnect() which is for most of security features (and especially when used within named pipe) will not allow you to establish communication. Use WithSeal() for named pipes which will ensure that your request will establish.

you don't specify parameter for QueryInformation.

So, the working code looks like following:

18,20d17
< 
< 	_ "github.com/oiweiwei/go-msrpc/msrpc/erref/ntstatus"
< 	_ "github.com/oiweiwei/go-msrpc/msrpc/erref/win32"
86c83
< 		dcerpc.WithSeal(),
---
> 		dcerpc.WithConnect(),
115c112
< 	respPolicyInfo, err := cli.QueryInformationPolicy2(ctx, &lsarpc.QueryInformationPolicy2Request{Policy: respP…

Replies: 3 comments 4 replies

Comment options

You must be logged in to vote
1 reply
@oiweiwei
Comment options

Comment options

You must be logged in to vote
1 reply
@krasnovu
Comment options

Answer selected by krasnovu
Comment options

You must be logged in to vote
2 replies
@oiweiwei
Comment options

@oiweiwei
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants