Skip to content
This repository was archived by the owner on May 26, 2025. It is now read-only.

Modules

Andrewerr edited this page Jun 20, 2020 · 3 revisions

Modules allow to ddos2 to run on different platform as well as perform different type of DoS attacks. Each module must have 3 functions which will be run while main program is being initialised. To work with program libddos2 should be used(you could find headers in library/include/libddos2). Modules are loaded dynamically from shared objects(.so) which after successful build are put into bin/modules/

Functions

The following functions should be implemented in each module(of course, they could be just stubs):

  • module_config_t* mod_on_load(program_config_t* config) – runned after module was loaded. Here you should register arguments and return information about your module(see below for detailed explanations)
  • void mod_on_init(void) – Runned after arguments being parsed and some other stuff is done
  • void mod_on_run(void) – Runned when program is initialised and ready to run only in case if name of your module was passed after --module argument

mod_on_load

This function should accepts and returns configurations. It also should register arguments if it needs any. To provide necessary headers include ddos2/ddos2.h. The function should return module_config_t* which is generated by ddos2_modconfig(mod_name,mod_author,mod_description,mod_version)

mod_on_init

This function is called after arguments being parsed and all modules were loaded. So it should work with arguments.

mod_on_run

This function should be a stub if your module could not be run as attack(e.g. it implements network interface). It is called if and only if user passed --module <YOUR_MODULE_NAME> to arguments. NOTICE: it is not clear yet what part of attack would be done by main program, so when this information would be clarified this page will be updated.

Building

To build your module you can use any build system. However, you want to main build system to build it automatically you should do the following:

  • Move your sources to ddos2/modules/<your_module_name>
  • Write build.sh in above mentioned folder
  • Add <your_module_name> to array called MODULES in ddos2/build.sh
Clone this wiki locally