Parser¶
Here is the parser interface definition in order to implement a new parser.
-
class
burpui.misc.parser.interface.
BUIparser
[source]¶ burpui.misc.parser.interface.BUIparser
defines a generic interface forburp
configuration files parser.-
abstract
cancel_backup
(name=None)[source]¶ burpui.misc.parser.interface.BUIparser.cancel_backup()
called byburpui.misc.backend.interface.BUIbackend.cancel_server_backup()
in order to cancel a server-initiated backup.- Parameters
name (str) – Client name
- Returns
A list of notifications to return to the UI (success or failure)
-
abstract
cancel_restore
(name=None)[source]¶ burpui.misc.parser.interface.BUIparser.cancel_restore()
called byburpui.misc.backend.interface.BUIbackend.cancel_server_restore()
in order to cancel a server-initiated restoration.- Parameters
name (str) – Client name
- Returns
A list of notifications to return to the UI (success or failure)
-
abstract
is_client_revoked
(client=None)[source]¶ burpui.misc.parser.interface.BUIparser.is_client_revoked()
is used to check if a given client has it’s certificate revoked or not.- Parameters
client (str) – The name of the client to check
- Returns
True or False
-
abstract
list_clients
()[source]¶ burpui.misc.parser.interface.BUIparser.list_clients()
is used to retrieve a list of clients with their configuration file.- Returns
A list of clients with their configuration file
-
abstract
list_static_templates
()[source]¶ burpui.misc.parser.interface.BUIparser.list_static_templates()
is used to retrieve a list of static templates with their absolute paths.- Returns
A list of templates
-
abstract
list_templates
()[source]¶ burpui.misc.parser.interface.BUIparser.list_templates()
is used to retrieve a list of templates with their absolute paths.- Returns
A list of templates
-
abstract
param
(name, obj='server_conf', client=None)[source]¶ burpui.misc.parser.interface.BUIparser.param()
lookup for a given param in the conf.- Parameters
name (str) – Param name
obj (str) – Object to look param for
client (str) – Search for a given client param
- Returns
The asked param
-
abstract
path_expander
(pattern=None, source=None, client=None)[source]¶ burpui.misc.parser.interface.BUIparser.path_expander()
is used to expand path of file inclusions glob the user can set in the setting panel.- Parameters
pattern (str) – The glob/path to expand
source (str) – What file we are working in
client (str) – The client name when working on client files
- Returns
A list of files or an empty list
-
abstract
read_backup
(name=None)[source]¶ burpui.misc.parser.interface.BUIparser.read_backup()
called byburpui.misc.backend.interface.BUIbackend.is_server_backup()
in order to test the existence of a server-initiated backup file.- Parameters
name (str) – Client name
- Returns
A True if the file is found, else False.
-
abstract
read_client_conf
(client=None, conf=None, template=False, statictemplate=False)[source]¶ burpui.misc.parser.interface.BUIparser.read_client_conf()
is called byburpui.misc.backend.interface.BUIbackend.read_conf_cli()
in order to parse the burp-clients configuration files.It works the same way as
burpui.misc.parser.interface.BUIparser.read_server_conf()
-
abstract
read_restore
(name=None)[source]¶ burpui.misc.parser.interface.BUIparser.read_restore()
called byburpui.misc.backend.interface.BUIbackend.is_server_restore()
in order to read a server-initiated restoration file.- Parameters
name (str) – Client name
- Returns
A dict describing the content of the file
-
abstract
read_server_conf
(conf=None)[source]¶ burpui.misc.parser.interface.BUIparser.read_server_conf()
is called byburpui.misc.backend.interface.BUIbackend.read_conf_srv()
in order to parse the burp-server configuration file.- Parameters
conf (str) – Complementary configuration file (for instance, file inclusions)
- Returns
Dict of options
Example:
{ "boolean": [ { "name": "hardlinked_archive", "value": false }, { "name": "syslog", "value": true }, ], "clients": [ { "name": "client1", "value": "/etc/burp/clientconfdir/client1" }, { "name": "client2", "value": "/etc/burp/clientconfdir/client2" }, ], "common": [ { "name": "mode", "value": "server" }, { "name": "directory", "value": "/srv/burp" }, ], "includes": [], "includes_ext": [], "integer": [ { "name": "port", "value": 4971 }, { "name": "status_port", "value": 4972 }, { "name": "max_children", "value": 5 }, { "name": "max_status_children", "value": 5 } ], "multi": [ { "name": "keep", "value": [ "7", "4", "4" ] }, { "name": "timer_arg", "value": [ "12h", "Mon,Tue,Thu,Fri,17,18,19,20,21,22,23", "Wed,Sat,Sun,06,07,08,09,10,11,12,13,14,15,16,17,18,19,20,21,22,23" ] }, ], "hierarchy": [ { "children": [ { "children": [], "dir": "/tmp/burp/conf.d", "full": "/tmp/burp/conf.d/empty.conf", "name": "empty.conf", "parent": "/tmp/burp/burp-server.conf" }, { "children": [], "dir": "/tmp/burp/conf.d", "full": "/tmp/burp/conf.d/ipv4.conf", "name": "ipv4.conf", "parent": "/tmp/burp/burp-server.conf" } ], "dir": "/tmp/burp", "full": "/tmp/burp/burp-server.conf", "name": "burp-server.conf", "parent": null } ] }
-
abstract
remove_client
(client=None, keepconf=False, delcert=False, revoke=False, template=False, statictemplate=False, delete=False)[source]¶ burpui.misc.parser.interface.BUIparser.remove_client()
is used to delete a client from burp’s configuration.- Parameters
client (str) – The name of the client to remove
keepconf – Whether to keep the conf (in order to just revoke/delete the cert)
keepconf – bool
delcert (bool) – Whether to delete the associated certificate
revoke (bool) – Whether to revoke the associated certificate
template (bool) – Whether we remove a template
statictemplate (bool) – Whether we remove a static template
delete (bool) – Whether to remove data as well
- Returns
A list of notifications to return to the UI (success or failure)
- Return type
list
-
abstract
remove_conf
(path=None)[source]¶ burpui.misc.parser.interface.BUIparser.remove_conf()
is used to remove a configuration file. It only works for “included” files within the server configuration file.- Parameters
path (str) – The path of the file to remove
-
abstract
rename_client
(client=None, newname=None, template=False, statictemplate=False, keepcert=False, keepdata=False)[source]¶ burpui.misc.parser.interface.BUIParser.rename_client()
is used to rename a client.- Parameters
client (str) – The name of the client to rename
newname (str) – The new name of the client
template (bool) – Whether we remove a template
statictemplate (bool) – Whether we remove a static template
keepcert (bool) – Whether to keep using the same certificate or not
keepdata (bool) – Whether to keep the already saved data or not
- Returns
A list of notifications to return to the UI (success or failure)
- Return type
list
-
abstract
server_initiated_backup
(name=None)[source]¶ burpui.misc.parser.interface.BUIparser.server_initiated_backup()
called byburpui.misc.backend.interface.BUIbackend.server_backup()
in order to create a server-initiated backup file.- Parameters
name (str) – Client name
- Returns
A list of notifications to return to the UI (success or failure)
-
abstract
server_initiated_restoration
(name=None, backup=None, files=None, strip=None, force=None, prefix=None, restoreto=None)[source]¶ burpui.misc.parser.interface.BUIparser.server_initiated_restoration()
called byburpui.misc.backend.interface.BUIbackend.server_restore()
in order to create server-initiated restoration file.- Parameters
name (str) – Client name
backup (int) – Backup number
files (str) – List of files to restore
strip (int) – Number of leading path to strip
force (bool) – Whether to force overriding files or not
prefix (str) – Where to restore files
agent (str) – What server to ask (only in multi-agent mode)
- Returns
A list of notifications to return to the UI (success or failure)
-
abstract
store_client_conf
(data, client=None, conf=None, template=False, statictemplate=False, content='')[source]¶ burpui.misc.parser.interface.BUIparser.store_client_conf()
is used byburpui.misc.backend.BUIbackend.store_conf_cli()
.It works the same way as
burpui.misc.parser.interface.BUIparser.store_conf()
with an extra parameter:- Parameters
client (str) – Name of the client for which to apply this config
conf (str) – The explicit filename of the conf
template (bool) – Is this file a template
statictemplate (bool) – Whether we remove a static template
content (str) – What default content to put in the file
-
abstract
store_conf
(data, conf=None, client=None, mode='srv', insecure=False, template=False, statictemplate=False, content='')[source]¶ burpui.misc.parser.interface.BUIparser.store_conf()
is used to store the configuration from the web-ui into the actual configuration files. It is used byburpui.misc.backend.BUIbackend.store_conf_srv()
.- Parameters
data (dict) – Data sent by the web-form
conf (str) – Force the file path (for file inclusions for instance)
client (str) – Client name
mode (str) – We actually use the same method for clients and server files
insecure (bool) – Used for the CLI
template (bool) – Is it a template
statictemplate (bool) – Whether we remove a static template
content (str) – What default content to put in the file
- Returns
A list of notifications to return to the UI (success or failure)
Example:
[[0, "Success"]]
-
abstract