Skip to content

Commit

Permalink
inql.*: stop GraphiQL server on extension unload
Browse files Browse the repository at this point in the history
- inql.actions.sendto: stop server included in this class
- inql.burp_ext.generator_tab: forward a stop message to the http_mutator
included in the tab
- inql.burp_ext.extender: forward a stop message to the generator_tab on
extension unload
  • Loading branch information
thypon committed Jun 15, 2021
1 parent f05bcd3 commit 9c924e9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
6 changes: 5 additions & 1 deletion inql/actions/sendto.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,4 +155,8 @@ def send_to_graphiql(self, host, payload):
URLOpener().open(self.get_graphiql_target(
self._server.server_port, host,
content['query'] if 'query' in content else None,
content['variables'] if 'variables' in content else None))
content['variables'] if 'variables' in content else None))

def stop(self):
self._server.shutdown()
self._server.socket.close()
1 change: 1 addition & 0 deletions inql/burp_ext/extender.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,4 @@ def extensionUnloaded(self):
shutil.rmtree(self._tmpdir, ignore_errors=False, onerror=None)
stop()
self._tab.save()
self._tab.stop()
6 changes: 5 additions & 1 deletion inql/burp_ext/generator_tab.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ def getUiComponent(self):

http_mutator = HTTPMutator(
callbacks=self._callbacks, helpers=self._helpers, overrideheaders=overrideheaders)
self.http_mutator = http_mutator

repeater_sender = SendToAction(omnimenu=repeater_omnimenu, has_host=http_mutator.has_host,
send_to=http_mutator.send_to_repeater)
Expand Down Expand Up @@ -113,4 +114,7 @@ def save(self):
try:
self._callbacks.saveExtensionSetting(self.panel.__class__.__name__, self.panel.state())
except:
print("Cannot save state!")
print("Cannot save state!")

def stop(self):
self.http_mutator.stop()

0 comments on commit 9c924e9

Please sign in to comment.