add: new 'listen' and 'listen_status' options (closes #279)

This commit is contained in:
ziirish 2018-08-16 14:07:17 +02:00
parent ec47a55131
commit 84d10723f3
No known key found for this signature in database
GPG key ID: 72DB229A64B54E46
4 changed files with 65 additions and 15 deletions

View file

@ -6,7 +6,8 @@ Current
- **BREAKING**: the *single* and *version* options within the ``[Global]`` section have been removed in favor of a new unified *backend* option
- Add: new `audit logging <https://git.ziirish.me/ziirish/burp-ui/issues/260>`_ system
- Add: new ``bui-monitor`` processes pool + ``async`` backend to parallelize some requests
- Add: new ``bui-monitor`` processes pool + ``async`` backend to parallelize some requests `#278 <https://git.ziirish.me/ziirish/burp-ui/issues/278>`_
- Add: new `listen` and `listen_status` options in burp-2.2.10 `#279 <https://git.ziirish.me/ziirish/burp-ui/issues/279>`_
- Fix: issue `#268 <https://git.ziirish.me/ziirish/burp-ui/issues/268>`_
- `Full changelog <https://git.ziirish.me/ziirish/burp-ui/compare/0.6.0...master>`__

View file

@ -33,8 +33,8 @@ class Parser(Doc):
:type backend: :class:`burpui.misc.backend.burp1.Burp`
"""
self.backend = backend
self.conf = backend.burpconfsrv
self.confcli = backend.burpconfcli
self.conf = getattr(backend, 'burpconfsrv', None)
self.confcli = getattr(backend, 'burpconfcli', None)
self.logger.info('Parser initialized with: {}'.format(self.conf))
self.clients = []
self._server_conf = {}

View file

@ -18,18 +18,45 @@ class Parser(Burp1):
"""Extends :class:`burpui.misc.parser.burp1.Parser`"""
pver = 2
pair_srv = [
'port',
'max_children',
'status_port',
'max_status_children',
]
pair_associations = {
'port': 'max_children',
'max_children': 'port',
'status_port': 'max_status_children',
'max_status_children': 'status_port',
}
_pari_srv = None
_pair_associations = None
@property
def pair_associations(self):
if self._pair_associations is None:
self._pair_associations = {
'port': 'max_children',
'max_children': 'port',
'status_port': 'max_status_children',
'max_status_children': 'status_port',
}
if self.backend and getattr(self.backend, 'server_version', '') >= '2.1.10':
self._pair_associations = {
'listen': 'max_children',
'max_children': 'listen',
'listen_status': 'max_status_children',
'max_status_children': 'listen_status',
}
return self._pair_associations
@property
def pair_srv(self):
if self._pari_srv is None:
self._pair_srv = [
'port',
'max_children',
'status_port',
'max_status_children',
]
if self.backend and getattr(self.backend, 'server_version', '') >= '2.1.10':
self._pari_srv = [
'listen',
'max_children',
'listen_status',
'max_status_children',
]
return self._pair_srv
integer_srv = Burp1.integer_srv
for rem in ['port', 'max_children', 'status_port', 'max_status_children']:
integer_srv.remove(rem)
@ -77,6 +104,8 @@ class Parser(Burp1):
'randomise': __("max secs"),
'manual_delete': __("path"),
'label': __("some informations"),
'listen': __("[address]:[port]"),
'listen_status': __("[address]:[port]"),
'status_address': __("address|localhost"),
'glob_after_script_pre': "0|1",
'enabled': "0|1",
@ -131,6 +160,18 @@ class Parser(Burp1):
" output. The idea is to provide a mechanism for"
" arbitrary values to be passed to clients of the server"
" status monitor."),
'listen': __("Defines the main TCP address and port that the server listens"
" on. The default is either '::' or '0.0.0.0', dependent upon"
" compile time options. Specify multiple 'listen' entries on"
" separate lines in order to listen on multiple addresses and"
" ports. Each pair can be configured with its own 'max_children'"
" value."),
'listen_status': __("Defines the main TCP address and port that the server"
" listens on for status requests. Specify multiple"
" 'listen_status' entries on separate lines in order to"
" listen on multiple addresses and ports. Each pair can"
" be configured with its own 'max_status_children' value."
" Comment out to have no status server."),
'status_address': __("Defines the main TCP address that the server "
"listens on for status requests. The default "
"is special value 'localhost' that includes "

View file

@ -915,3 +915,11 @@ class Doc(BUIparser):
" automatically switch to 'use'."
" </li></ul>"),
}
@property
def all(self):
return sorted(list(set(self.boolean_srv) | set(self.files) |
set(self.integer_srv) | set(self.multi_srv) |
set(self.string_srv) | set(self.boolean_cli) |
set(self.integer_cli) | set(self.multi_cli) |
set(self.string_cli)))