MCPcopy Create free account
hub / github.com/ReversecLabs/drozer / execute

Method execute

src/drozer/modules/common/shell_code.py:26–45  ·  view source on GitHub ↗

Implementation of the Module execute() method. Requests that the shell code is generated, before formatting it and printing to stdout.

(self, arguments)

Source from the content-addressed store, hash-verified

24 return "".join(map(lambda bs: "\\u%0.2X%0.2X" % (bs[1], bs[0]), zip(*[iter(shell_code)] * 2)))
25
26 def execute(self, arguments):
27 """
28 Implementation of the Module execute() method. Requests that the shell
29 code is generated, before formatting it and printing to stdout.
30 """
31
32 self.__shell_code = []
33
34 if not isinstance(arguments.server, tuple):
35 arguments.server = util.parse_server(arguments.server)
36
37 self.format = arguments.format
38 self.generate(arguments)
39
40 if self.format == "R":
41 return self.asRaw()
42 elif self.format == "U":
43 return self.asUnicode()
44 elif self.format == "X":
45 return self.asHex()
46
47 def hexifyInetAddr(self, inet_addr):
48 return map(lambda s: int(s), inet_addr.split("."))

Callers

nothing calls this directly

Calls 4

asRawMethod · 0.95
asUnicodeMethod · 0.95
asHexMethod · 0.95
generateMethod · 0.45

Tested by

no test coverage detected