Jump to content

Developing new Lan Turtle modules


chmod750

Recommended Posts

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
}
Link to post
Share on other sites
  • 3 weeks later...

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!

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

Link to post
Share on other sites
  • 2 weeks later...

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.

Link to post
Share on other sites
  • 1 month later...

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.

Link to post
Share on other sites
  • 2 weeks later...

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

Link to post
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...