Remote Agents

  • Thread starter Thread starter KV
  • Start date Start date
K

KV

Anybody here created an agent? I need to create an agent that runs as a
Windows service. The agent would listen on a certain TCP port and run
executable files sent to it from a master program.

I have these questions:

- Is C# a decent language to write this in?
- If there are any major issues, what are they?
- Do you know where I can find example source code for such a project?
It can be in almost any language.

Any help would be appreciated.

-KV
 
Hi,

- Is C# a decent language to write this in?

Sure it's
- If there are any major issues, what are they?

security, you have to be very carefull with who has permission to exec. what
- Do you know where I can find example source code for such a project?

This is nothing different than a regular TCP server with a defined protocol
to send/receive commands.

Cheers,
 
I have worked on IBM aglets SDK which was built using Java and is similar to
what you are referring to. There are many frameworks that enable you to do
the same. I have looked at .NET as a platform for making a remote agent
system and it is suitable to develop such a framework. You can use C#,
VB.NET or any .NET language. IBM aglets SDK and many other similar frame
works are open source.
Can I ask you what you are trying to achieve?
I think such a framework in MS developers' hands makes it easy to come up
with killer apps and thus makes the framework more meaningful.
 
Sankar said:
I have worked on IBM aglets SDK which was built using Java and is similar to
what you are referring to. There are many frameworks that enable you to do
the same. I have looked at .NET as a platform for making a remote agent
system and it is suitable to develop such a framework. You can use C#,
VB.NET or any .NET language. IBM aglets SDK and many other similar frame
works are open source.
Can I ask you what you are trying to achieve?
I think such a framework in MS developers' hands makes it easy to come up
with killer apps and thus makes the framework more meaningful.

I appreciate your help, as well as Ignacio's. I found the Aglet site,
so I will learn as much as possible there.

The place where I work has many remote machines that are not part of a
domain. These machines cannot be managed by WMI, and therefore not by
SMS or other such management programs, due to permissions issues. But
these machines must be updated when certain problems crop up. The most
recent example is Windows XP SP2. We wanted to update all of these
remote computers so their firewall is disabled when SP2 is installed.
Besides, there are times when we want to do custom updates as well.
Simply having a patch management program won't do this. A custom
written agent could be used on every computer, and could be made to
execute any program.

As it stands right now, we have an FTP server running on every single
remote machine. The FTP program has an extension that allows downloaded
files to be executed. Due to the insecure nature of FTP, and given the
fact that our approach is generally cheesy, I would like to write
something better.

I'm only beginning C#, and I don't have any C++ experience. But I've
found the best way to learn is by doing something. That is why I've
asked for examples. I'm confident I can learn the basics, but I want to
engage in good practices that are fairly standardized.

As far as what I'm trying to write - it only needs to be capable of
receiving programs via TCP/IP and executing them through the shell (Most
of what I push down is a custom-written app without a console anyway).
I would think this is simple to write. It needs to run as a service
(all of our machines are NT-based). Later, I could imagine adding some
logging and other features. I would like to keep it as simple as
possible at first so I can learn.

I would certainly welcome any specific ideas you might have.

-KV
 
You may also want to check out (google) psexec.exe at sysinternals.com. Can
run a command at remote windows server and see output. Can also upload a
file and run it simply. May give you some ideas.
 
Hi,

If this is your case then I will also take a look at installing terminal
services. You see some programs ( including the SP 2 setup? ) needs user
interaction as they are not prepared to be used from the command line. this
may be also true with some configuration settings of windows.

Cheers,
 
Ignacio said:
Hi,

If this is your case then I will also take a look at installing terminal
services. You see some programs ( including the SP 2 setup? ) needs user
interaction as they are not prepared to be used from the command line. this
may be also true with some configuration settings of windows.

Cheers,

Terminal services would work for a few workstations, maybe even a dozen.
I have over 300 that I must look after in this fashion. All are in
remote locations, coming in through different ISPs, with different
connection speeds, etc.

XP SP2 firewall can be disabled through a registry key, proactively,
before SP2 is even installed. I did this through a script.

Almost everything can be controlled, or at least crippled, via command
line. I remember one time McAfee screwed up all of our machines by
releasing a bad pattern file (it caused an unrecoverable BSOD during a
subsequent reboot). We had to update all of our machines in a hurry
before they rebooted. We sent a .reg file that prevented the virus
scanner from starting. We only lost about 10 computers that day.

Anyway, those are some of the reasons I'm seeking what I am. I don't
imagine it will be easy to write. Hey, anyone want to start a new open
source project?!? =)

-KV
 
Back
Top