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

Method udfInjectCore

lib/takeover/udf.py:137–178  ·  view source on GitHub ↗
(self, udfDict)

Source from the content-addressed store, hash-verified

135 raise SqlmapUnsupportedFeatureException(errMsg)
136
137 def udfInjectCore(self, udfDict):
138 written = False
139
140 for udf in udfDict.keys():
141 if udf in self.createdUdf:
142 continue
143
144 self.udfCheckAndOverwrite(udf)
145
146 if len(self.udfToCreate) > 0:
147 self.udfSetRemotePath()
148 checkFile(self.udfLocalFile)
149 written = self.writeFile(self.udfLocalFile, self.udfRemoteFile, "binary", forceCheck=True)
150
151 if written is not True:
152 errMsg = "there has been a problem uploading the shared library, "
153 errMsg += "it looks like the binary file has not been written "
154 errMsg += "on the database underlying file system"
155 logger.error(errMsg)
156
157 message = "do you want to proceed anyway? Beware that the "
158 message += "operating system takeover will fail [y/N] "
159
160 if readInput(message, default='N', boolean=True):
161 written = True
162 else:
163 return False
164 else:
165 return True
166
167 for udf, inpRet in udfDict.items():
168 if udf in self.udfToCreate and udf not in self.createdUdf:
169 self.udfCreateFromSharedLib(udf, inpRet)
170
171 if Backend.isDbms(DBMS.MYSQL):
172 supportTblType = "longtext"
173 elif Backend.isDbms(DBMS.PGSQL):
174 supportTblType = "text"
175
176 self.udfCreateSupportTbl(supportTblType)
177
178 return written
179
180 def udfInjectSys(self):
181 self.udfSetLocalPaths()

Callers 2

udfInjectSysMethod · 0.95
udfInjectCustomMethod · 0.95

Calls 11

udfCheckAndOverwriteMethod · 0.95
udfSetRemotePathMethod · 0.95
udfCreateSupportTblMethod · 0.95
checkFileFunction · 0.90
readInputFunction · 0.90
itemsMethod · 0.80
isDbmsMethod · 0.80
keysMethod · 0.45
writeFileMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected