Hello,

Knowledge Base (KB) is some data which is stored in database,It is is set by some dependencies (most of the detect NVT's) NVTs by using function 'set_kb_item(name:"string", value:related value);'

Later if you need the KB value you can retrieve it with "get_kb_item("string which is set by set kb item"))".

You can have a look at already created CentOS NVTs for example,
gb_CESA-2015_1083_abrt_centos7.nasl,  In this case gather-package-list.nasl

To understated clearly how set_kb_item and get_kb_item works, First have a look at some simple NVTs for like, gb_google_chrome_detect_lin.nasl, gb_google_chrome_mult_vuln02_jan15_lin.nasl

Thanks,
Antu Sanadi

On Wednesday 24 June 2015 01:00 AM, Brian Thompson wrote:

I'm new to writing *.nasl but I believe i can look-up information stored in the knowledge base (KB) and based on the value, I can run code. The problem is, I'm not sure what's in the KB. Is there a way to "dump" (or look-up) the contents of the KB for a specific host so I can get an idea of what I can use in my "if" block?


For example, if my host is running CentOS and has a specific RPM / product installed I want to check the config file for that product to make sure it's configured as expected and that the permissions are not world-writable.


EX:

if(description){

....

}


include("host_details.inc");


if(host_runs("CentOS") == "yes"){

  ....code block...

}

exit(0);


Brian



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


--
Saner Personal
A free vulnerability mitigation
software. Build strong defense.
http://www.secpod.com/saner-personal.html

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

Reply via email to