OPNsense Forum

English Forums => Development and Code Review => Topic started by: rhyse on February 05, 2018, 11:31:56 pm

Title: Seemingly Simple Plugin
Post by: rhyse on February 05, 2018, 11:31:56 pm
Hi

I am trying to create a simple plugin that takes a variable then outputs the output to the screen. I have tried bastardising teh arp-scanner plugin but seem to have got stuck (I am not a programmer/developer by any means)

Essentially I would like something similar to the traceroute / ping options under Interfaces -> Diagnostics.

But I can't find those under the opnsense/plugins git. If you want to look at my intial very poor attempt you can find it here https://github.com/rhysxevans/plugins/tree/master/security/nmap .

Any chance to get the code for the ping / traceroute "plugins" ?

Once I have the intial command one working , I can potentially look at adding checkboxes etc for the variables

Basically , I need a portscanner and os identifier (will look at extending this)

Any help is appreciated

Thansk




Title: Re: Seemingly Simple Plugin
Post by: MasterXBKC on February 06, 2018, 01:52:23 am
so you need nmap?
Title: Re: Seemingly Simple Plugin
Post by: franco on February 06, 2018, 08:03:34 am
The ping code uses static pages, which you shouldn't use to build new components: more code, hard to maintain, no API.

Michael's blog has numerous step-by-step tutorials for building new plugins:

http://www.routerperformance.net/opnsense/create-a-new-plugin-from-scratch-by-example-pt-1-lldp/

For more see the "OPNsense" tab.


Cheers,
Franco
Title: Re: Seemingly Simple Plugin
Post by: rhyse on February 06, 2018, 08:05:48 am
Hi

In short yes,  for now. but there is a longer term aim of getting something like openvas into the system (note I dont know how feasible that is).

But baby steps for now

Franco - I will reread that link

Thanks
Title: Re: Seemingly Simple Plugin
Post by: rhyse on February 28, 2018, 11:43:00 pm
Ok, just to keep people updated. I haven't progressed any further on this due to time constraints. Primarily work related

So a not so simple question, what is the possibility of someone picking this up ? One option would be to convert the ping / traceroute pages static pages into default "plugins" - I could then "learn" from that (please note I am not a delveloper in any shape or form) and move forward from there

Other option is anyone willing to do this at a resonable cost (be it direct or via donation to the project)

I am thinking something similar to the pfsense nmap lugins options in the gui, but it could be as simple as a dns name or ip address to input initially.

I know MasterXBKC has attempted this, but has come across some blockers. I appreciate his efforts.

Apologies if this is not the way to go via this. If it is can someone please direct me to where I should be looking (i did google opnsense coders)

Thansk

Title: Re: Seemingly Simple Plugin
Post by: franco on March 01, 2018, 09:50:19 am
You can use the code that MasterXBKC provided manually no problem and go from there.

It's in here... https://github.com/opnsense/plugins/pull/557/files


Cheers,
Franco