Re: [Plugins-writers] Accessing multiple sub keys in the Windows registery

From: George A. Theall (theall@private)
Date: Thu Apr 06 2006 - 12:51:31 PDT


On Thu, Apr 06, 2006 at 03:49:24PM +0000, jfvanmeter@private wrote:

> # Setup Connection
> if ( ! get_port_state(port) ) exit(0);

You haven't initialized 'port'.

> #To read the value of a subkey; Function ReadRegistryGetSubkey which
> allows you to enumerate
> #all the keys below a specified key. Useful for building a directory
> tree of the registry just call it
> #continuously until "Not Found" is returned and store the returned
> value(s) in an array or something.
> Text1 = 0;
> Res = 0;
> i = 0;
> Text1.Text = [ "one", "two", "three" ];
> RegistryLocation = "AppID\.Default";
> Text1 = ReadRegistry(HKEY_CLASSES_ROOT, RegistryLocation, "");
> Res = ReadRegistryGetSubkey(HKEY_CLASSES_ROOT, "AppID", i);
> Do Until Res = "Not Found"
>    Text1.Text = Text1.Text & " " & Res
>    i = i + 1
>    Res = ReadRegistryGetSubkey(HKEY_CLASSES_ROOT, "AppID", i);
> exit(0);

Where did you come up with this? This looks like VisualBasic, not NASL.

Take a look at Michel Arboi's on-line NASL reference,
<http://michel.arboi.free.fr/nasl2ref/>, especially the part about
smb_nt.inc. Then take an existing plugin and use it as a template to do
what you want. For example, gator.nasl is a really simple one that pulls
info from the registry.

Btw, note that you can't use the commandline NASL interpreter to access
the remote Windows registry; you will need to run your scripts using
nessusd.


George
_______________________________________________
Plugins-writers mailing list
Plugins-writers@private
http://mail.nessus.org/mailman/listinfo/plugins-writers



This archive was generated by hypermail 2.1.3 : Thu Apr 06 2006 - 12:52:04 PDT