[Plugins-writers] New to Nessus - Trouble with tcp_ping_host

From: Benjamin Sayo (Benjamin_Sayo@private)
Date: Fri Dec 05 2003 - 13:46:35 PST

  • Next message: Renaud Deraison: "Re: [Plugins-writers] New to Nessus - Trouble with tcp_ping_host"

    Hi everyone,
    
    I am new to Nessus and have been trying to build a simple plugin in C. I
    am having problems with this line:
    
      ping = tcp_ping_host(*p_addr);
    
    If I comment out this line, I can build the plugin, upload it and view
    the plugin from the Nessus client. As soon as I uncomment the line, the
    plugin is no longer visible from the client.
    
    Source code for the plugin is pasted below. Please let me know what I'm
    missing. Thanks for any help.
    
    Ben Sayo
    
    ------------------
    #include <includes.h>
    #include <nessusraw.h>
    
    #define NAME "test plugin"
    #define DESCRIPTION "test plugin"
    #define SUMMARY "test"
    #define COPYRIGHT "test"
    
    PlugExport int plugin_init(struct arglist *desc);
    PlugExport int plugin_init(struct arglist *desc)
    {
      plug_set_name(desc, NAME, NULL);
      plug_set_description(desc, DESCRIPTION,NULL);
      plug_set_summary(desc, SUMMARY, NULL);
      plug_set_family(desc, "Test", NULL);
      plug_set_category(desc, ACT_GATHER_INFO);
    
      return(0);
    }
    
    PlugExport int plugin_run(struct arglist *env);
    PlugExport int plugin_run(struct arglist *env)
    {
      int soc;
      char * data;
      int ping;
      struct in_addr * p_addr = plug_get_host_ip(env);
    
      if(!host_get_port_state(env, 139))return(0);
    
      ping = tcp_ping_host(*p_addr);
    
      return(0);
    }
    
    
    _______________________________________________
    Plugins-writers mailing list
    Plugins-writers@private
    http://mail.nessus.org/mailman/listinfo/plugins-writers
    



    This archive was generated by hypermail 2b30 : Sat Dec 06 2003 - 10:28:24 PST