Hello,

I don't arrive to connect with SMB on target system with openvas to carry
out a scan and to recover OVAL characteristics system. In the file log, I
always the same message which is “nasl_wmi_connect: WMI Connect failed”.

I tried to connect with wmi client in command line : wmic -U
mydomain/myuser%mypassword //myIP “Select * from Win32_OperatingSystem”

Connexion is ok and I have a result. So my domain name, user, password and
address ip are good.

I tried a script with a simple call to the function wmi_connect with the
parameters host, username and password as the script
“gb_nist_win_oval_sys_char_generator.nasl”. The output is the same erreur
that previously : “nasl_wmi_connect: WMI Connect failed" and "Failed to get
handle ”.

Where is the problem coming? wmi can it connect to the target machine
without the namespace?

I use Openvas-8.


 *My script test* :

include("wmi_file.inc");

include("wmi_os.inc");

  ## Variables Initialization

host = "";

usrname = "";

passwd = "";

 handle = "";


  usrname = "mydomain/test";

passwd = "test";

host = get_host_ip();



  security_note(data:"User Name : "+usrname);

security_note(data:"Passwd : "+passwd);

security_note(data:"Host : "+host);


  if(!host || !usrname || !passwd){

security_note(data:string("\nImproper info provided"));

exit(0);

}

 ## WMI Registry Connect

handle = wmi_connect(host:host, username:usrname, password:passwd);

  if(!handle){

security_note(data:string("\nFailed to get handle "));

exit(0);

}

 security_note(data:string("\nConnected to host with handle ", handle));

 wmi_close(wmi_handle:handle);


 -----------------------------------------


 Thanks

JOUVENT Yoann
_______________________________________________
Openvas-discuss mailing list
[email protected]
https://lists.wald.intevation.org/cgi-bin/mailman/listinfo/openvas-discuss

Reply via email to