views:

85

answers:

2

Hello,

  I'm looking for how to recorgnize some server (windows in my case) network configuration (information we obtain using netstat dos command).

  I have the login and password of the target (server), and I developp with visual studio 2005 (c# or vB.NET doesn't matter).

  (Can I use WMI for that ???)

Regards,

A: 

Have a look at this SO:

http://stackoverflow.com/questions/221181/how-can-i-access-netstat-like-ethernet-statistics-from-a-windows-program/221237#221237

And of course ou can remotely access the WMI of a remote server; just make sure the corresponding services are not disabled and running on the target machine.

Andreas
thanks Andreas, now I can connect to remote computer, but I'm lost in wmi, it's the first time I use wmi (withc script to display all existing connection ip + open port) thanks in advance
bidak
Andreas
even with this tool, I don't find the solution yet , it will be greet if someone help, no example found on the internet !
bidak
After a quick investigation, I cannot find any helpful WMI classes in your case. As it seems, they are useful to display performance statistics ans so on. But not for displaying the active connections, programs and all the stuff netstat does. So next approach would be to remotely invoke netstat and grab the output.
Andreas
thanks for your reply and help, apparently it's impossible (see : http://www.tek-tips.com/viewthread.cfm?qid=1220505)Like you said try to remotly invoke netstat and get the result : ManagementClass processClass = new ManagementClass("Win32_Process");ManagementBaseObject inParams = processClass.GetMethodParameters("Create");inParams["CommandLine"] = "netstat.exe";ManagementBaseObject outParams = processClass.InvokeMethod("Create", inParams,null);string netstatResult = outParams["returnValue"].ToString();but dosn't work
bidak
The problem is, that it is not the return value of netstat that you want to capture, but its output. I've searched through the web and all I could find were some approaches using a bat file redirecting the program's output. If you can manage file transfer, have a look here: http://www.codeproject.com/KB/cs/Remote_Process_using_WMI_.aspx?msg=3046341
Andreas
Hi Andreas, I tried this approach but also not working, right now I test with PsExec tool, it's working but very slow, I'm looking to optimize it or find an other similar tool more faster
bidak
Be aware of PsExec reported as a false positive trojan by some Virus Scanners. Besides, it seems that it is the only possibility for you at the moment. Hopefully WMI gets pimped with the necessary information some time.
Andreas
there is also another utility smaller and faster than PSExec : RemCom , but I still hope there is another approch using .NET framework
bidak
there is also another utility smaller and faster than PSExec : RemCom, but I still hope there is another approch using .NET framework
bidak
A: 

there is also another utility smaller and faster than PSExec : RemCom, but I still hope there is another approch using .NET framework

bidak