pom-ng:lua
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| pom-ng:lua [2012/10/24 12:58] – [Using plugins] 2001:7e8:2221:600:8cad:5bff:feb8:cbe | pom-ng:lua [2020/05/26 21:59] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 9: | Line 9: | ||
| ==== Register an output ==== | ==== Register an output ==== | ||
| - | To create a new output, you simply call **output.new(name, | + | To create a new output, you simply call **output.new(name, |
| - | + | ||
| - | After creating your output | + | |
| When the output is started, the function **open()** will be called. Similarily, the function **close()** will be called when the output is stopped. | When the output is started, the function **open()** will be called. Similarily, the function **close()** will be called when the output is stopped. | ||
| Line 30: | Line 28: | ||
| local param2_value = self: | local param2_value = self: | ||
| print(" | print(" | ||
| - | end | ||
| - | |||
| - | function my_output_register() | ||
| - | pom.output.register(my_output) | ||
| end | end | ||
| Line 176: | Line 170: | ||
| local key, value | local key, value | ||
| key, value = data_iter() | key, value = data_iter() | ||
| - | | + | |
| | | ||
| - | local value_type = type(v) | + | local value_type = type(value) |
| if value_type == " | if value_type == " | ||
| print(" | print(" | ||
| Line 194: | Line 188: | ||
| == Parameters: == | == Parameters: == | ||
| * // | * // | ||
| + | |||
| + | === pom.dns.forward_lookup(name) === | ||
| + | Perform a forward lookup for a hostname using the offline DNS database. | ||
| + | |||
| + | == Parameters: == | ||
| + | * //name//: A name to lookup | ||
| + | |||
| + | === pom.dns.reverse_lookup(name) === | ||
| + | Perform a reverse lookup for a hostname or IP using the offline DNS database. It will try to find out what was the original query that points to the provided name. | ||
| + | |||
| + | == Parameters: == | ||
| + | * //name//: A name or IP to lookup | ||
| === pom.log(level, | === pom.log(level, | ||
| Line 211: | Line 217: | ||
| == Returns: == | == Returns: == | ||
| An output class. | An output class. | ||
| - | |||
| - | === pom.output.register(output_class) === | ||
| - | Registers a new output. | ||
| - | |||
| - | == Parameters: == | ||
| - | * // | ||
| === pom.plugin.new(plugin_name) === | === pom.plugin.new(plugin_name) === | ||
| Line 250: | Line 250: | ||
| Returns a data object containing all the information related to this event. | Returns a data object containing all the information related to this event. | ||
| + | === event.timestsamp === | ||
| + | == Returns: == | ||
| + | Returns the timestamp when the event started in micro seconds since epoch. | ||
| ==== output ==== | ==== output ==== | ||
| Line 257: | Line 260: | ||
| Called when an instance of the output is stopped. This function must be implemented by addon. | Called when an instance of the output is stopped. This function must be implemented by addon. | ||
| - | === output: | + | === output: |
| Call this function to start listening to a particular event. You must call output: | Call this function to start listening to a particular event. You must call output: | ||
| Line 264: | Line 267: | ||
| * // | * // | ||
| * // | * // | ||
| + | * //filter//: String containing an event filter, optional. | ||
| === output: | === output: | ||
| Line 274: | Line 278: | ||
| Called when an instance of the output is started. This function must be implemented by addon. | Called when an instance of the output is started. This function must be implemented by addon. | ||
| - | === output: | + | === output: |
| Start listening to payloads. Every payload will be processed. It's up to the output to filter them. If you don't need a specific function, you can specify nil instead. | Start listening to payloads. Every payload will be processed. It's up to the output to filter them. If you don't need a specific function, you can specify nil instead. | ||
| Line 281: | Line 285: | ||
| * // | * // | ||
| * // | * // | ||
| + | * //filter//: Pload filter to use, optional. | ||
| == Parameters of the above functions: == | == Parameters of the above functions: == | ||
| Line 297: | Line 302: | ||
| ==== pload ==== | ==== pload ==== | ||
| + | |||
| + | === pload.data === | ||
| + | |||
| + | == Returns: == | ||
| + | Returns the data related to this payload. It contains the data that the analyzer identified. For example, images will contain ' | ||
| === pload.event === | === pload.event === | ||
| Line 303: | Line 313: | ||
| Returns the event related to this payload. | Returns the event related to this payload. | ||
| - | === pload.data === | + | === pload.filename |
| == Returns: == | == Returns: == | ||
| - | Returns the data related to this payload. It contains | + | Returns the pload filename if it has been set, nil otherwise. |
| + | |||
| + | === pload.parent === | ||
| + | |||
| + | == Returns: == | ||
| + | Returns | ||
| === pload.type === | === pload.type === | ||
| Line 340: | Line 355: | ||
| Close the plugin and releases all the associated data. | Close the plugin and releases all the associated data. | ||
| - | === plugin: | + | === plugin: |
| Have the plugin listens to a specific event and process it. | Have the plugin listens to a specific event and process it. | ||
| == Parameters: == | == Parameters: == | ||
| * // | * // | ||
| + | * //filter//: String containing an event filter, optional. | ||
| === plugin: | === plugin: | ||
| Line 378: | Line 394: | ||
| === plugin: | === plugin: | ||
| - | Process a specific payload. | + | Process a specific payload. |
| == Parameters: == | == Parameters: == | ||
pom-ng/lua.1351083518.txt.gz · Last modified: (external edit)
