Conform to JSONRPC 2.0 spec in external modules

Responses to queries had a `response` field instead of the required
`result` field.
This commit is contained in:
Adam Cammack
2018-04-12 16:55:27 -05:00
parent 2a6acfd1d0
commit e65de2b56f
3 changed files with 6 additions and 6 deletions
+2 -2
View File
@@ -66,11 +66,11 @@ def report_vuln(ip, name, **opts):
def run(metadata, module_callback):
req = json.loads(os.read(0, 10000).decode("utf-8"))
if req['method'] == 'describe':
rpc_send({'jsonrpc': '2.0', 'id': req['id'], 'response': metadata})
rpc_send({'jsonrpc': '2.0', 'id': req['id'], 'result': metadata})
elif req['method'] == 'run':
args = req['params']
module_callback(args)
rpc_send({'jsonrpc': '2.0', 'id': req['id'], 'response': {
rpc_send({'jsonrpc': '2.0', 'id': req['id'], 'result': {
'message': 'Module completed'
}})