Bulding NINJA PingU plugins is very easy. The three following C functions have to be implemented to accomplish this.
· Plugin InitializerTo carry out plugin initialization actions, the following function has to be declared:
· Plugin FinalizerTo carry out plugin end actions, the following function has to be declared:
· Scanner Input ProvideThe messages that the scanner will send after a successful connection are provided by the following function.
void getServiceInput(int port, char *msg);
· Scanner Output AnalysisThe responses of the target will be given to the following function.
void provideOutput(char *host, int port, char *msg);
Integrating a NINJA PingU is very easy, you can add to the Makefile the following file for automatic compilation.
gcc -c src/plugin/PLUGINNAME/scanner.c -o src/plugin/PLUGINNAME/scanner.o -pedantic -g -Wall -std=c99 -fpic -I. gcc -o src/plugin/PLUGINNAME/scanner.so src/plugin/PLUGINNAME/scanner.o -shared
Using your plugin in NINJA PingU can be achieved by using the -m flag with your plugin name. For instance.
$ ./bin/npingu -m PLUGINNAME 126.96.36.199
More information about plugin development and code samples can be found in the NINJA PingU codebase.