Hey,
I know remote execution has been discussed a lot in the forum. I have seen udf’s RemoteExec() and fnRemoteExec()…
So I decided to use the methods to execute commands on a remote client.
Something likes Radimus’s REM. Some remote DOS console which could execute commands on the remote machine.
Due to the fact remoteexec process has no network permissions, I followed the suggestion to include the commands in a batch file, copy it to the remote machine and then execute the batch file using remoteexec.
The Environment is W2K Sp4 on both local and remote client.
Same user with local admin right is logged on both clients.
Client are member of AD domain.
The Kix 4.52
Code:
$computer = "172.60.10.10"
$RemotePath = \\172.60.10.10\C$\Winnt\Temp\
Copy "C:\Script\dir.bat" $RemotePath /C
sleep 3
$rc = RMTEXEC($computer, 'C:\Winnt\Temp\dir.bat')
Function RMTEXEC($computer, $command)
Dim $Connect
$Connect = GetObject("winmgmts:{impersonationLevel=impersonate}!//$computer/root/cimv2:Win32_Process")
$RMTEXEC = $Connect.Create($Command)
Exit @error
$Connect = 0
EndFunction
Well, the batch file was copied, but nothing seems happen after that
I was hopping a CMD windows was pop up on the remote client and performed the content of the batch file.
What could be wrong or missing?