Beispiel #1
0
    def save(self, actionState, cmd):
        if "initial_cmd" in actionState.keys():
            print("Save next_cmd: " + cmd)
            actionState["next_cmd"] = cmd
            dao.getIRasshDao().saveCase(actionState)

        print("Save initial_cmd: " + cmd)
        actionState["initial_cmd"] = cmd
Beispiel #2
0
 def process(self):
     fake_output = dao.getIRasshDao().getFakeOutput(self.command)
     if fake_output is not None:
         self.write(fake_output + "\n")
Beispiel #3
0
 def call(self):
     fakeOuput = dao.getIRasshDao().getFakeOutput(self.protocol.cwd)
     if fakeOuput is not None:
         self.write(fakeOuput + "\n")
Beispiel #4
0
 def process(self):
     location = self.getCountryCode()
     print("Insult Message! IP= %s/location=%s\n" % (self.clientIp, location))
     self.write(dao.getIRasshDao().getInsultMsg(location.lower()) + "\n")
Beispiel #5
0
commands = {}


class ProxyCommand(HoneyPotCommand):
    def call(self):
        cmd = " ".join([self.protocol.cwd] + list(self.args))
        path = "/tmp/root/" + self.protocol.cwd
        output = os.popen("cd %s; %s" % (path, cmd)).read()
        if output and output[-1] != "\n":
            output = output + "\n"
        self.write(output)


class FakeCommand(HoneyPotCommand):
    def call(self):
        fakeOuput = dao.getIRasshDao().getFakeOutput(self.protocol.cwd)
        if fakeOuput is not None:
            self.write(fakeOuput + "\n")


commands['lsp'] = ProxyCommand
commands["cpp"] = ProxyCommand
commands["catp"] = ProxyCommand

supportedCommands = dao.getIRasshDao().getCommands()
for command in supportedCommands:
    if command["impl_type"] == 1:
        commands[command["command"]] = ProxyCommand
    elif command["impl_type"] == 2:
        commands[command["command"]] = FakeCommand