![]() |
|
[.NET] Remote (server side) code with netseal validation. - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [.NET] Remote (server side) code with netseal validation. (/showthread.php?tid=5530798) |
Remote (server side) code with netseal validation. - BahNahNah - Jan 22, 2017 I wanted to make a project to display some usages of SyncIO, so here it is. Download: Github All remote function calls are validated server side by the netseal api to check that the user making the call has a valid licence. Setting up the remote code [Remote code lib example]
The RemoteApp Attribute must be attached to classes containing remote functions. This attribute takes 2 parameters. 1) App ID: The netseal Application ID (Same one used to call Broker.Initialize) 2) Remote API Token: can be found in the netseal licence panel under remote. Each function that you want to be made avalible for remote calling must
The RemoteFunction Attribute takes 1 required argument, and one optional. 1) Function Name (Required): This is the name that will be used to call this function. 2) Description (Optional): Displayed on main app for your use only, has no effect on behavior. Put the dll in the "Remote" folder found in the same directory as SyncIONetSealRemoteCode.exe. If "Remote" directory is not found, run SyncIONetSealRemoteCode.exe to generate then close. Click settings -> Network and add any ports you wish to listen on. Close the ports window and the status label should indicate that the application is listening. ![]() Setting up the application This application will have both SyncIO.dll and SIORemoteCode.dll as dependencies when using this. [Application example]
The OnConnect event will be raised when connection is completed. On this event is where the GetFunction method should be called. Code [RemoteCode].GetFunction<return type>(function name)This will return a SecureFunction<return type> there are 2 methods that can be called from a SecureFunction Call: Non-blocking remote function call. Returns the Call Id of the requested function call (Subscribe to the ReturnCallback event to get the remote function return). CallWait: Calls the remote function and blocks the current thread until the return value is retrieved. If the function does not exist or throws an exception, the default value for the return type is retuned. Ill update this thread with more info at some point. * - gigajew - Jan 22, 2017 Great Job! I'm a fan of your coding * - Barret - Jan 22, 2017 Been scrolling into it, looks tight lad * - Malumâ„¢ - Jan 22, 2017 Great example to get people to use SyncIO. I'm loving it. Seriously, keep up the good work! * - debug - Jan 22, 2017 Can't wait to take a look at this when I get some free time. I tell people all the time Net Seal + Server sided code/variables is the way to go. Well done once again. * - BahNahNah - Jan 22, 2017 (Jan 22, 2017 04:45 PM)debug Wrote: Can't wait to take a look at this when I get some free time. I tell people all the time Net Seal + Server sided code/variables is the way to go. Be warned finished it at 6am so there might be some unexceptionably stupid code lying around. * - WinA - Jan 29, 2017 Really nice work there OP! Will you be continuing on SyncIO? * - Aristocles - Feb 1, 2017 Hello BahNahNah, First, thread rated 5/5, can't understand why is there so few replies. I would like to know if there is a limited amount of parameter allowed or is it only defined by the function itself ? https://github.com/BahNahNah/SyncIONSRemoteCode/blob/master/ExampleApplication/Program.cs#L50 Then, do you think it's possible to grab already-coded functions via dnlib/cecil in a main .exe file, extract them and inject them in the remote code library, adding the correct attribute according to user's netseal ID ? I'd like to do that but before I'd like to know if its theoretically possible. Again, thank you :) * - BahNahNah - Feb 1, 2017 (Feb 1, 2017 04:31 AM).NETGuard Wrote: Hello BahNahNah, When calling the remote function, it is up to the dev to make sure that the correct number of parameters are sent through as it is not checked client-side (it is determined by the function registered) So no, there is no limit, but the parameter amounts and types must be the same as the fucntion that was registered. And yes, it would be possible to add the attributes with dnlib/cecil. * - Cecilia - Feb 2, 2017 As always, quality work from Bah. A lovely edition to Net Seal security. (Feb 1, 2017 04:31 AM).NETGuard Wrote: Hello BahNahNah, Are you talking about a Net Seal auto-implementer? I would like to see something like it, especially with NETGuard. |