Jump to content
Sign in to follow this  
chmod750

Developing new Lan Turtle modules

Recommended Posts

Hello,

Thanks for this product.

Is it possible to develop new modules?

If yes, can you provide any procedure or wiki page to do it?

Thanks in advance

Have a nice day :)

Share this post


Link to post
Share on other sites

When I get back from DEF CON I'll be updating with wiki with proper developer documentation - but until then I'll just brain dump here:

- Any executable in /etc/turtle/modules will be treated as a module and show up in the modules menu

- For the current version, the executable should be a bash script (though it can call any language with an interpreter supported on the LAN Turtle like php and python)

- In addition to the interpreter also include /usr/lib/turtle/turtle_module (For example: #!/bin/bash /usr/lib/turtle/turtle_module)

- Modules should include the variables VERSION and DESCRIPTION (We will also add support for AUTHOR in the future)

- When the module menu is loaded, all modules are queried for their status

- All modules must support the functions start, stop, status and configure

- Status should echo a 1 if running and 0 if not

- When modules are enabled, the system will run the start function of the module on LAN Turtle boot

- Publishing a module to the LAN Turtle download center (modulemanager) is a matter of submitting a pull request with your module to https://github.com/hak5/lanturtle-wiki/tree/gh-pages/modules

- In lieu of an official "style guide", I recommend keeping to the dialog sizes used in the other modules (usually 18 72)

- To familiarize yourself with dialog and the module structure, open up any of the existing modules and see how they work

Example Stop Function:

function stop {
  /etc/init.d/openvpn stop
}
Example Status Function:
function status {
  if pgrep openvpn  > /dev/null; then echo "1"; else echo "0"; fi
}
  • Upvote 1

Share this post


Link to post
Share on other sites

Hi Darren!

Thanks for the nice little toy the Lan Turtle is :)

I have uploaded my first module. It's a very simple automatic MAC cloner of the client's address into the WAN interface, for added transparency of the bridging and bypass of mac filtering.

Is there any way to call a function in the module when it is enabled/disabled in the gui so that as to run some "installation" code? That way the start function doesn't need to also hold the code for persistance after reboot.

Also, I am not sure if I sent the pull request correctly, could you confirm?

Thanks again!

Share this post


Link to post
Share on other sites

Hi Darren,

Be prepared, this is possible a stupid question :unsure:

The existing modules are based on OS / pre-installed binaries like NetCat, nmap etc.

In case I want to publish a new module to the 'download center' / module repository, what's the preferred way to distribute a binary (cross-compiled for Atheros/MIPS) together with the module? Do I need to manage the download of the binary in the module code myself? (backgrounded wget or something)

Thanks,

Martijn

Share this post


Link to post
Share on other sites

Hi Darren,

Be prepared, this is possible a stupid question :unsure:

The existing modules are based on OS / pre-installed binaries like NetCat, nmap etc.

In case I want to publish a new module to the 'download center' / module repository, what's the preferred way to distribute a binary (cross-compiled for Atheros/MIPS) together with the module? Do I need to manage the download of the binary in the module code myself? (backgrounded wget or something)

Thanks,

Martijn

We'll be redoing the module center to handle modules in tar.gz form in the future but for now a dependency install in config or at first start like the pineapple does would do the trick.

Share this post


Link to post
Share on other sites

Is there any info out about "Code one in bash, python, or php with a dead simple API." I got a module more or less designed, but implementation will depend on the api as to not over complicate it.

Share this post


Link to post
Share on other sites

Hi,

has anyone a small example of a small module written in Python?

I have written a script I would like to rewrite so it will work on the Turtle. I'm just unsure how the dialogs are created with the installed Python.

Regards

Orm

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...