|
I am working on a RAT (Remote Administration Tool)... Below is an explanation and the question... If you'd like you can skip the rest and read the question
[Program Explanation]
A program working on the Admin-side sends a command to the Client-side program (through TCP/IP), and after interpreting the instruction, it does the requested action.
For example, if the Admin-side sends "list drives", the Client-side program interprets the command and sends a string[] back to the Admin as a byte[]... The admin-side would convert the byte[] to a string[] That's no big deal...
[End of Program Explanation]
[Question]
The question is... Can I send multiple Network Streams at one time, and each are separately recognized by the receiving-end? This is important if more than one task are performed at one time - such as getting a file and keyboard logs... (Since the conversion at the receiving-end needs to be made for the relevant response...
Last I tried, I sent two different Network Streams exactly after each other and the receiving end had thought that it was the same stream!! - It resulted in total chaos
[End of Question]
[Program Coding]
To send a command, there are two important methods
public byte[] Serialize(object oSerialize)
{
ms = new MemoryStream();
bf = new BinaryFormatter();
bf.Serialize(ms, oSerialize);
return ms.ToArray();
}
public byte[] Serialize(object oSerialize)
{
ms = new MemoryStream();
bf = new BinaryFormatter();
bf.Serialize(ms, oSerialize);
return ms.ToArray();
}
On the receiving end, a similar system is used, being Receive and DeSerialize...
[End of Program Coding]
|
|
|
|
|
You can never be sure that the message sent is recieved as one piece at the client.
To be sure, you may use some Start and End indentifier for each message you send. At the client side, write a function which
makes sure that stream is completely recieved and if not retrieve the remaining message from the next received.
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
How to create a Pipe through the API createNamedPipe in c#, and how to do the send a message from one exe to other using callNamedPipe in c#?
|
|
|
|
|
|
how can access other controls such as button, textbox etc. in an other application from C#. For example I want to design a form that has a combo box with some data in it, and by choosing an Item from the combo box, that item will be copied to the search box of Internet Explorer (for example).
|
|
|
|
|
Member 6289976 wrote: how can access other controls such as button, textbox etc. in an other application from C#.
With extreme difficulty.
Controlling another appication requires you to use Win32 API functions to search for windows, then search those windows for other windows, representing buttons and other controls, to find the one you want, get it's window handle, craft an appropriate window message to send to it and then send the message. There is also no guarantee that the control you're "talking" to will respond to the message you send.
IE complicates this even further, because now you have to use an entirely different method, using IE's Document Object Model, to get at the controls on a web form.
|
|
|
|
|
SO that's possible...... but a little hard as you say. can you mention some basic information for solving this problem. I mean what background should I have to do this.
and thank you very much for your reply.
|
|
|
|
|
You need the Win32 API functions FindWindowEx and SendMessage at a minimum. You've got enough to Google with and find examples on how to use them.
|
|
|
|
|
Hi,
FWIW, you could tackle your particular example in quite some different ways:
1.
for Google, you can come up with the URL that specifies your search (just try it manually and see what URL Google generates when you hit the Search button; now use Process.Start(searchURL) to launch your default web browser and have it search right away.
2.
or put a WebBrowser Control on your Form and give it a Navigate() command.
Luc Pattyn [Forum Guidelines] [My Articles]
DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.
|
|
|
|
|
thank you luc. but I just meant an example. my question was general, I mean what if I want to access a button in photoshop for example, to make a little plugin for myself...
thank you again.
|
|
|
|
|
Then you'd use the SDK for PhotoShop to create the plugin. Not some screwed up method of "remote controlling" another application.
|
|
|
|
|
hay can you help me
i saw code here : http://www.codeproject.com/KB/IP/ListNetworkComputers.aspx
can somebody help me to make software which turns off comp on the network
i mean when i run it i select comp. and turn it off
|
|
|
|
|
If I read your question right, you want to
1) Scan your network, and find all computers on it.
2) Select a computer from this list.
3) Power down this computer, as if you were sat in front of it and gave the "shut down windows" command.
Is this correct?
Why would you want to do that?
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
Don't know. But I could have some fun at work with that....
Regards,
Rob Philpott.
|
|
|
|
|
I'm already having some fun myself. I'm not shutting down the "targets" workstation, but locking it while he's using it is turning out to be very funny!
|
|
|
|
|
Dave, you're a bad guy.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
So you liked it too?
Luc Pattyn [Forum Guidelines] [My Articles]
DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.
|
|
|
|
|
You mean - you liked it too? Great minds and all that, Luc...
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Try this code[^] - I haven't tested it myself.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
You could try using the Remote Shutdown tool[^] from your code.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Hi,
I'm looking for a way to convert a Doc file into an image object with c#.
I need this project in order to create an application that will enable the user to give evaluations on paperworks originated by MS Word.
My goal is to create a panel that will enable the user to view the doc as an image and paint on it.
My thinking was to create two panels, MainPanel and ChildPanel. The ChildPanel will be hosted by the MainPanel.
The MainPanel backgroud will be an image of the Word document and the user will be able paint on the ChildPanel.
I use Main and Child panels so I can have it as layers, so if the user like to make changes to his evaluations he can do so by erasing/adding changes to the child panel without altering the main document.
tnx
Leeoz
|
|
|
|
|
Hi all,
I am trying to show the current files which have been opened on my system in my program ...Plz guide me about it.Is there any API for showing the current files opened on my system?
|
|
|
|
|
Use OpenFiles.exe[^] to get the information.
जय हिंद
modified on Saturday, June 13, 2009 4:41 AM
|
|
|
|
|
d@nish wrote: EnumWindows in User32.dll might help as well.
From the doc: The EnumWindows function enumerates all top-level windows on the screen ...
The OP's requirement is to find all the files that are opened. I don't see how EnumWindows() can help.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Corrected.
जय हिंद
|
|
|
|