Tuesday, January 10, 2006

STUPID NASL

Darn nasl

function HelloWorld(first)
(
local_var message;
message = 'World!';
display(first + message);
}

HelloWorld(first:"hello");

First: There doesn't seem to be a way to prototype the function which means that its just like shell script :(( The best that you could do would be to source it from another file.

Second: When you call the function and you want to provide a value to the argument you need to use the variable name in the argument and the colon ":" as the assignment operator.

Third: In case you were wondering you CAN NOT provide a commnad line argument to a nasl script. You are supposed to declare a preference using script_add_preference() and in the scripts description block and then, in the pluin itself, access it using script_get_preference. Page 16 of the hard to find NASL reference manual.

Fourth: You have to use something like the Internet way back machine to get the NASL reference manual. Bastards

0 Comments:

Post a Comment

<< Home