Пример #1
0
 def call(self):
     fn = '%s/lastlog.txt' % (config().get('honeypot', 'data_path'),)
     if not os.path.exists(fn):
         return
     l = list(self.args)
     numlines = 25
     while len(l):
         arg = l.pop(0)
         if not arg.startswith('-'):
             continue
         elif arg[1:].isdigit():
             numlines = int(arg[1:])
         elif arg == '-n' and len(l) and l[0].isdigit():
             numlines = int(l.pop(0))
     data = utils.tail(file(fn), numlines)
     self.writeln(''.join(data))
Пример #2
0
 def call(self):
     fn = '%s/lastlog.txt' % self.protocol.cfg.get('honeypot', 'log_path')
     if not os.path.exists(fn):
         return
     l = list(self.args)
     numlines = 25
     while len(l):
         arg = l.pop(0)
         if not arg.startswith('-'):
             continue
         elif arg[1:].isdigit():
             numlines = int(arg[1:])
         elif arg == '-n' and len(l) and l[0].isdigit():
             numlines = int(l.pop(0))
     data = utils.tail(file(fn), numlines)
     self.write(''.join(data))
Пример #3
0
 def call(self):
     fn = "%s/lastlog.txt" % self.protocol.cfg.get("honeypot", "data_path")
     if not os.path.exists(fn):
         return
     l = list(self.args)
     numlines = 25
     while len(l):
         arg = l.pop(0)
         if not arg.startswith("-"):
             continue
         elif arg[1:].isdigit():
             numlines = int(arg[1:])
         elif arg == "-n" and len(l) and l[0].isdigit():
             numlines = int(l.pop(0))
     data = utils.tail(file(fn), numlines)
     self.write("".join(data) + "\n")