P:\test>rsh
Runs commands on remote hosts running the RSH service.
RSH host [-l username] [-n] command
host Specifies the remote host on which to run command.
-l username Specifies the user name to use on the remote host. I
+f
omitted, the logged on user name is used.
-n Redirects the input of RSH to NULL.
command Specifies the command to run.
I vaguely remember that the NT Toolkit had a similar utility (netsh.exe?) if you have access to that.
Examine what is said, not who speaks.
Silence betokens consent.
Love the truth but pardon error.
| [reply] [d/l] |
What method are you using to access the remote machine? You'll need something like telnet or ssh or rsh to execute remote commands.. look into Net::Telnet or Net::SSH and possibly Expect. | [reply] |
Thanks Moot, I am connecting to the registry using Win32::TieRegistry. Is there any other way to run the netstat command on the remote machine ?
| [reply] |
Well, that's how you're talking to the registry.. how are you actually connecting to the remote system? Presumably you have some sort of login account on the remote server?
| [reply] |
You seem to be looking for the psexec utility from SysInternals.
..."I don't know what the facts are but somebody's certainly going to sit down with him and find out what he knows that they may not know, and make sure he knows what they know that he may not know, and that's a good thing. I think it's a very constructive exchange," --Donald Rumsfeld
| [reply] |
For running commands on a remote machine, I use a remote perl script with IO::Socket to accept requests from the local perl script and return results. More secure than using telnet, since you control what commands can be processed on the remote machine, but also less flexible. NT boxes usually aren't telnet friendly, though, so that's a factor as well.
--
Linux, sci-fi, and Nat Torkington, all at Penguicon 3.0
perl -e 'print(map(chr,(0x4a,0x41,0x50,0x48,0xa)))'
| [reply] [d/l] |