MCPcopy Create free account
hub / github.com/quentinhardy/odat / execOSCommand

Method execOSCommand

Java.py:164–181  ·  view source on GitHub ↗

Run a OS command

(self,cmd, printResponse=True, needCreateClassAndFunction=True, needDeleteClassAndFunction=True)

Source from the content-addressed store, hash-verified

162 return data[0][0]
163
164 def execOSCommand(self,cmd, printResponse=True, needCreateClassAndFunction=True, needDeleteClassAndFunction=True):
165 '''
166 Run a OS command
167 '''
168 if needCreateClassAndFunction == False :
169 data = self.__runOSCmd__ (cmd=cmd, printResponse=printResponse)
170 else :
171 status = self.createClassAndFunctionToExecOsCmd()
172 if status != True:
173 self.args['print'].badNews("Impossible to use the JAVA library to execute a system command: {0}".format(str(status)))
174 return status
175 else:
176 data = self.__runOSCmd__ (cmd=cmd,printResponse=printResponse)
177 if needDeleteClassAndFunction == True :
178 status = self.deleteClassAndFunctionToExecOsCmd()
179 if status != True:
180 self.args['print'].goodNews("Impossible to delete functions created: {0}".format(self.cleanError(status)))
181 if isinstance(data,Exception) == False : return data
182
183 def getInteractiveShell(self):
184 '''

Callers 3

getInteractiveShellMethod · 0.95
giveReverseShellMethod · 0.95
runjavaModuleFunction · 0.95

Calls 6

__runOSCmd__Method · 0.95
badNewsMethod · 0.80
goodNewsMethod · 0.80
cleanErrorMethod · 0.80

Tested by

no test coverage detected