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

Method osShell

plugins/generic/takeover.py:68–102  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

66 self.cleanup(web=web)
67
68 def osShell(self):
69 if isStackingAvailable() or conf.direct:
70 web = False
71 elif not isStackingAvailable() and Backend.isDbms(DBMS.MYSQL):
72 infoMsg = "going to use a web backdoor for command prompt"
73 logger.info(infoMsg)
74
75 web = True
76 else:
77 errMsg = "unable to prompt for an interactive operating "
78 errMsg += "system shell via the back-end DBMS because "
79 errMsg += "stacked queries SQL injection is not supported"
80 raise SqlmapNotVulnerableException(errMsg)
81
82 self.getRemoteTempPath()
83
84 try:
85 self.initEnv(web=web)
86 except SqlmapFilePathException:
87 if not web and not conf.direct:
88 infoMsg = "falling back to web backdoor method..."
89 logger.info(infoMsg)
90
91 web = True
92 kb.udfFail = True
93
94 self.initEnv(web=web)
95 else:
96 raise
97
98 if not web or (web and self.webBackdoorUrl is not None):
99 self.shell()
100
101 if not conf.osPwn and not conf.cleanup:
102 self.cleanup(web=web)
103
104 def osPwn(self):
105 goUdf = False

Callers 1

actionFunction · 0.45

Calls 8

isStackingAvailableFunction · 0.90
isDbmsMethod · 0.80
infoMethod · 0.80
getRemoteTempPathMethod · 0.80
initEnvMethod · 0.80
shellMethod · 0.80
cleanupMethod · 0.80

Tested by

no test coverage detected