-
Notifications
You must be signed in to change notification settings - Fork 72
ExtendingLibrary
Ioannis Stais edited this page May 14, 2017
·
2 revisions
In order to extend the existing library files, you have to either place the files at "lightbulb/data/" or at "~/.Lightbulb" in your home folder. In both cases, the files must be places in folders named "regex", "grammars", "trees" or "configs", depending on their type.
For each file that you want to create, there must be always another one, having the same name, with a ".py" extension, containing the metadata about the file. For example, lets say that we want to create the "sample.y" file, then the "sample.py" file must be also created, containing the following content:
META = {
'author': 'Your name goes here',
'description': 'A short description about the file',
'type':'File Type (can be one of the Regex, Grammar, Tree, Configuration)',
'comments': ['Comments go here']
}
Now about the format of the normal files, it depends on their type.
- For regex, the file should comply with the FLEX type
- For grammars, the format is as following:
S: main
main: name
name: A
- For trees, the file is a binary tree in json format, as the following:
{
"RESULT": {
"False": Name of the WAF or if the result is false,
"True": Name of the WAF or if the result is true,
},
"STRING": "Payload to be tested"
}
- For configs, the file is a list of records in json format, as following:
{
"Numeric Identifier of the record": {
"data": {
"BLOCK": "A string in the response indicating that the WAF identified the attack",
"PARAM": "The HTTP parameter to use for the attack",
"BYPASS": "A string in the response indicating that the attack was successful", ,
"REQUEST_TYPE": "The HTTP method",
"RULE": "The library folder containing SEED files to be used for this WAF",
"URL": "The host in which the WAF is located"
},
"name": "The name of the WAF"
},
}