MCPcopy
hub / github.com/epinna/tplmap / evaluate_blind

Method evaluate_blind

core/plugin.py:701–734  ·  view source on GitHub ↗
(self, code, **kwargs)

Source from the content-addressed store, hash-verified

699
700
701 def evaluate_blind(self, code, **kwargs):
702
703 prefix = kwargs.get('prefix', self.get('prefix', ''))
704 suffix = kwargs.get('suffix', self.get('suffix', ''))
705 blind = kwargs.get('blind', False)
706
707 action = self.actions.get('evaluate_blind', {})
708 payload_action = action.get('evaluate_blind')
709 call_name = action.get('call', 'inject')
710
711 # Skip if something is missing or call function is not set
712 if not action or not payload_action or not call_name or not hasattr(self, call_name):
713 return
714
715 expected_delay = self._get_expected_delay()
716
717 if '%(code_b64)s' in payload_action:
718 log.debug('[b64 encoding] %s' % code)
719 execution_code = payload_action % ({
720 'code_b64' : base64.urlsafe_b64encode(code),
721 'delay' : expected_delay
722 })
723 else:
724 execution_code = payload_action % ({
725 'code' : code,
726 'delay' : expected_delay
727 })
728
729 return getattr(self, call_name)(
730 code = execution_code,
731 prefix = prefix,
732 suffix = suffix,
733 blind=True
734 )
735
736 def execute_blind(self, code, **kwargs):
737

Callers

nothing calls this directly

Calls 2

getMethod · 0.95
_get_expected_delayMethod · 0.95

Tested by

no test coverage detected