Dear friends,
I searched the mailing list for quite a week without finding an answer for my question:
My plugin needs the IP address (and eventually the MAC address) of the default gateway of the machine wich runs Nessus 3. This is because I need to perform an ARP spoofing. I was able to perform that ARP spoofing by manually writing the default gateway IP address in the plugin. But this parameter should be variable.
I searched for a builtin function that retrieves this address but I didn't found it. So I'm looking for a way to add a preference in the Nesuss GUI where I can manually enter the value.
I managed to edit the file config.default.xml and now I can see two custom entries in the preferences dialog. But I'm not able to access those values and actually it seems that I can't access also the default ones.
I use the following code:
if(description)
{
script_id(99997);
name["english"] = "Temp";
script_name(english:name["english"]);
desc["english"] = "Desc";
script_description(english:desc["english"]);
summary["english"] = "TEMP";
script_summary(english:summary["english"]);
script_category(ACT_GATHER_INFO);
script_copyright(english:"This script is Copyright (C) 2008");
family["english"] = "General";
script_family(english:family["english"]);
#Custom made preference
script_add_preference(name:"Default Gateway IP : ",
type:"entry",
value:"192.168.15.1");
#One of the default preferences
script_add_preference(name:"HTTP account :", type:"entry", value:"root");
exit(0);
}
gwip = script_get_preference("Default Gateway IP : ");
http = script_get_preference("HTTP account :");
report = "gateway=" + gwip +" http account="+http;
#Just to see the values...
security_warning(data:report);
Is there something I'm doing wrong? Please help me...
Thanks in advance
Massimo
I searched the mailing list for quite a week without finding an answer for my question:
My plugin needs the IP address (and eventually the MAC address) of the default gateway of the machine wich runs Nessus 3. This is because I need to perform an ARP spoofing. I was able to perform that ARP spoofing by manually writing the default gateway IP address in the plugin. But this parameter should be variable.
I searched for a builtin function that retrieves this address but I didn't found it. So I'm looking for a way to add a preference in the Nesuss GUI where I can manually enter the value.
I managed to edit the file config.default.xml and now I can see two custom entries in the preferences dialog. But I'm not able to access those values and actually it seems that I can't access also the default ones.
I use the following code:
if(description)
{
script_id(99997);
name["english"] = "Temp";
script_name(english:name["english"]);
desc["english"] = "Desc";
script_description(english:desc["english"]);
summary["english"] = "TEMP";
script_summary(english:summary["english"]);
script_category(ACT_GATHER_INFO);
script_copyright(english:"This script is Copyright (C) 2008");
family["english"] = "General";
script_family(english:family["english"]);
#Custom made preference
script_add_preference(name:"Default Gateway IP : ",
type:"entry",
value:"192.168.15.1");
#One of the default preferences
script_add_preference(name:"HTTP account :", type:"entry", value:"root");
exit(0);
}
gwip = script_get_preference("Default Gateway IP : ");
http = script_get_preference("HTTP account :");
report = "gateway=" + gwip +" http account="+http;
#Just to see the values...
security_warning(data:report);
Is there something I'm doing wrong? Please help me...
Thanks in advance
Massimo