Skip to content

How to Create Mark V Pineapple Infusions/Plugins

by on December 4, 2013



The Pineapple (since Mark IV) has introduced the idea of infusions; community written plugins that when approved become available on the Pineapple-Bar for all to use.  Since the introduction of Interface 3.0/Mk4 or 1.0/Mk5 these infusions have changed to a more uniformed modular approach.  This has the following benefits:

  • easier to create
  • modular design
  • similar code-base (easier to review)
  • generally more secure code

Now creating new plugins may seem daunting but it is actually quite easy.  The MarkV even supports a nice create & manage plugins page called Bartender, that allows you to start from a clean plugin template on the Pineapple or the sd-card.

Create a Plugin

Example: My first plugin

Create Plugin:create_wifi_plugin

Manage Plugin:


SSH into the Pineapple, after creating a ‘Test’ sd-card infusion.

root@Pineapple:/sd/infusions/test# ls -l
-rw-r--r--    1 root     root             0 Nov  3 08:56 functions.php
-rw-r--r--    1 root     root           567 Nov  3 08:56 handler.php
-rw-r--r--    1 root     root             0 Nov  3 08:56 large_tile.php
-rw-r--r--    1 root     root             0 Nov  3 08:56 small_tile.php
  • The ‘functions.php‘ is essentially the code where are your parameters get processed.
  • The ‘handler.php‘ is essentially the helper module, that does not need to be manually edited; it contains the plugin name, version, author etc, and links to the other template files.
  • The *_tile.php are the main display code for the tiles you see on the pineapple homepage.

The pineapples large_tile for infusion works in a Javascript popup type method, using regular HTML forms would cause this to break, so we use AJAX. This prevents the pineapple going to a new page. More information can be found in the example section below.

Example Infusion: Test


<form action="/components/infusions/test/functions.php" method="POST" onSubmit="$(this).AJAXifyForm(callback); return false;">
  <input type="text" name="text" placeholder="Enter some meaningless text here..." />
  <input type="submit" name="submit" value="Submit">

<script type="text/javascript">

function callback(data){




  echo "Hello World!: ".$_POST['text'];


You will end up with a blank small_tile.php, but when you click on it (to get the large_tile.php), you will be presented with a form.  Once you click “submit”, the form details will be sent to functions.php, which will process the data; resulting in outputting your “text-box contents” onto the webpage.

You can use this very simple example to create more complex scripts that drive 3rd-party applications E.g. sslstrip, dnsspoof, urlsnarf etc.  Remember the *_tiles.php, displays the forms, and any input/output. Functions.php actually drives the infusion, and operates any program calls.

From → pentura, web, WiFi

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: