Today I am going to go over creating your own module for my PPF framework. But first a few things I recommend you have knowledge about.

  1. C Programming
  2. Linux

If you have decent knowledge of these you will be set.


PPF Module Files

At the moment in version 0.0.1 of PPF. To create a module you need to have a Makefile for compiling your module (PPF has a command for auto compiling all modules or specific ones). The next file you will need is a '.ppfconf' file this file will hold configuration information about your module. The name must be the same as your module, for example if my module is called 'pinkenum' then the name of my ppfconf file will be pinkenum.ppfconf. The next important file is the '.ppfhelp' file, this file is where you write the help screen for your module. And the last needed file would be your SO file or Shared Object file. This file is your compiled module that will be loaded in to the framework for execution. All of these files must be put in your modules directory.


Creating a module

When creating a module I like to create a header file. Here is my header file for a test module I made called pinkenum.

pinkenum.h

In every module there needs to be a call otherwise your module will do nothing. In this module there is one call named pemain, this call utilizes three arguments; rhost, ofile, and ports. ALL ARGUMENTS IN EVERY MODULE MUST BE CHAR ARRAYS. If your arguments are not char arrays PPF will fail to set arguments for your module. If you need an integer for your call you can use atoi() to convert your C string of, lets say 4 to an integer 4.

Now lets look at the source of this module.

pinkenum.c

As you can see, it is a very simple module! This module takes a target host (rhost) a file to write the scan to (ofile) and the ports to scan (ports).

Once you have your source figured out you should create a Makefile for your module to be compiled. PPF has a command called 'makemod' that will run make for you and compile all the modules or a selected module. In my module Makefiles I usually include a command to remove object files (.o files) to save space and be more organized. Here is my Makefile for pinkenum.

Makefile

Now we will need to create a configuration file for this module to help PPF load information about the module. These files need to end in '.ppfconf', here is mine.

pinkenum.ppfconf

The syntax for these configuration files is:

VAR_NAME<space>value of var here

At the moment there are only four options to set:

  • MOD_NICKNAME - The nice name of the module
  • MOD_DESC - A brief description of the module
  • MOD_AUTHOR - The author of the module
  • MOD_SO_PATH - The shared object file path of your module

The last file needed for the module to be complete is a help file these files end in '.ppfhelp', here is how mine looks.

pinkenum.ppfhelp

Just a file with the help screen you want to display for the user who is using your module.


Module Directories

So now that our module files are all complete we need to place these files in a directory in the modules directory of the framework how these directories work is very simple it starts at 'modules/' within that directory are the type directories (you can create as many type directories as you'd like). I have pinkenum in the 'enumeration/'  type directory. Inside the type directory goes the directory of your module, the names of your module files need to be the same as the directory name. My module directory name is 'pinkenum/', inside it are all my files for the module. However you can specify a path for the module shared object file in the ppfconf file. But I decided to keep all my files together, here is my directory contents.

PPF/modules/enumeration/pinkenum/

Now that our files are in the correct space lets get it loaded and running!


Loading & Executing Modules

Once you have PPF compiled with the make command execute it with './ppf'.

Now we need to compile our module, we can do this with the command 'makemod module pinkenum'.

Now that our module is compiled we can load it and execute it!

Load Module:

To load a module we can use the 'wield' or the 'use' command.

Set Arguments:

Once the module is loaded it will show your module's nice name. Next you must set the arguments, to see the arguments use the 'help' command. Then use 'sync' to set the argument of your choice.

Execute A Call:

Once you have the arguments, you use the call names to execute them directly! So I use 'run pemain', which executes the pemain call.


Final Tips

Once you have finished using the module use the 'retreat' command to go back to the main PPF shell. Hopefully this helped clear up the modular side of PPF for those of you who love C like me! I have many more ideas for this framework including something I'm working on implementing that I'm calling 'Service Modules', these modules will be loaded the whole time PPF is running so that other modules can communicate with them. This can allow for PPF API's to program your modules against! Anyways, if you have any questions let me know on twitter!