示例#1
0
文件: proxy.py 项目: adpauna/irassh
    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
示例#2
0
文件: proxy.py 项目: adpauna/irassh
 def process(self):
     fake_output = dao.getIRasshDao().getFakeOutput(self.command)
     if fake_output is not None:
         self.write(fake_output + "\n")
示例#3
0
 def call(self):
     fakeOuput = dao.getIRasshDao().getFakeOutput(self.protocol.cwd)
     if fakeOuput is not None:
         self.write(fakeOuput + "\n")
示例#4
0
文件: proxy.py 项目: adpauna/irassh
 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")
示例#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