Hi,
I am writing a NASL script and I need to set KB items that can hold several values.
Everything works fine except that the values are not recorded in the order they are written, but they assume an apparently random order.
For example:
I set the KB item named “banner” first with the value “Nr. 22” then with “Original” and then “New”.
When I print the array, the output is “[0] New” , “[1] Nr.22” and “[2] Original”.
set_kb_item(name: “banner”, value: “Nr. 22”);
set_kb_item(name:" banner", value: “Original” );
set_kb_item(name: “banner”, value: “New”);
banner_list = make list ( get_kb_list ( banner ) );
display = (banner_list [0]);
display = (banner_list [1]);
display = (banner_list [2]);
This happens both when the KB item is set several times in the same script and when the item is set in different scripts over the same scan.
Can someone help me to understand why this happens? And maybe also how to keep the order?
Thanks!