{"id":16828246,"url":"https://github.com/vletoux/rpcforsmblibrary","last_synced_at":"2025-03-17T04:31:48.299Z","repository":{"id":107043291,"uuid":"328349772","full_name":"vletoux/RPCForSMBLibrary","owner":"vletoux","description":"Extension of SMBLibrary for RPC calls","archived":false,"fork":false,"pushed_at":"2024-06-11T23:37:07.000Z","size":38,"stargazers_count":33,"open_issues_count":0,"forks_count":9,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-27T17:45:56.403Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vletoux.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"license.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-01-10T09:50:09.000Z","updated_at":"2024-06-11T23:37:11.000Z","dependencies_parsed_at":null,"dependency_job_id":"81efdb5e-02d7-43e5-b4e0-c752ea60024c","html_url":"https://github.com/vletoux/RPCForSMBLibrary","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vletoux%2FRPCForSMBLibrary","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vletoux%2FRPCForSMBLibrary/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vletoux%2FRPCForSMBLibrary/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vletoux%2FRPCForSMBLibrary/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vletoux","download_url":"https://codeload.github.com/vletoux/RPCForSMBLibrary/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243841223,"owners_count":20356446,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-13T11:25:39.986Z","updated_at":"2025-03-17T04:31:47.963Z","avatar_url":"https://github.com/vletoux.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# About RPCForSMBLibrary\n\nRPCForSMBLibrary is a complement of the project https://github.com/TalAloni/SMBLibrary made by TalAloni \n\nSMBLibrary is an open-source C# SMB 1.0/CIFS, SMB 2.0, SMB 2.1 and SMB 3.0 server and client implementation.\nSMBLibrary gives .NET developers an easy way to share a directory / file system / virtual file system, with any operating system that supports the SMB protocol.\nSMBLibrary is modular, you can take advantage of Integrated Windows Authentication and the Windows storage subsystem on a Windows host or use independent implementations that allow for cross-platform compatibility.\nSMBLibrary shares can be accessed from any Windows version since Windows NT 4.0.\n\n# RPC Calls\n\nA subset of LSA, NetLogon and EFS have been implemented.\nYou can for example get the SID of a user using this way:\n```\nvar client = new SMB2Client(); // SMB1Client can be used as well\nbool isConnected = client.Connect(IPAddress.Parse(\"192.168.0.X\"), SMBTransportType.DirectTCPTransport);\nif (isConnected)\n{\n   NTStatus status = client.Login(String.Empty, \"XXX\", \"XXX\");\n   if (status == NTStatus.STATUS_SUCCESS)\n   {\n      var o = LsaServiceHelper.ResolveNames(client, new List\u003cstring\u003e() { \"adiant\" }, out status);\n   }\n}\n```\n\nOr for Petit Potam:\n```\nvar client = new SMB2Client(); // SMB1Client can be used as well\nbool isConnected = client.Connect(IPAddress.Parse(\"192.168.0.X\"), SMBTransportType.DirectTCPTransport);\nif (isConnected)\n{\n   NTStatus status = client.Login(String.Empty, \"XXX\", \"XXX\");\n   if (status == NTStatus.STATUS_SUCCESS)\n   {\n      using (RPCCallHelper rpc = new RPCCallHelper(client, EFSService.ServicePipeName, EFSService.ServiceInterfaceGuid, EFSService.ServiceVersion))\n      {\n         status = rpc.BindPipe();\n         if (status != NTStatus.STATUS_SUCCESS)\n            return;\n         var ooo = EFSServiceHelper.EfsRpcOpenFileRaw(rpc, out handle, \"\\\\\\\\192.168.0.10\\\\test\", 0, out status);\n         Console.WriteLine(ooo);\n      }\n   }\n}\n```\n\nYou can use global helpers such as:\n```\nNetlogonServiceHelper.DsGetDCNames(client, \"192.1680.25\", \"test.mysmartlogon.com\", null, 0, out status);\nServerServiceHelperEx.NetrRemoteTOD(client, \"192.168.0.25\", out status);\nServerServiceHelperEx.NetrServerStatisticsGet(client, \"192.168.0.25\", \"LanmanWorkstation\", 0, 0, out status);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvletoux%2Frpcforsmblibrary","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvletoux%2Frpcforsmblibrary","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvletoux%2Frpcforsmblibrary/lists"}