New commands: mkdir, id

git-svn-id: https://kippo.googlecode.com/svn/trunk@11 951d7100-d841-11de-b865-b3884708a8e2
This commit is contained in:
desaster
2009-11-14 06:55:38 +00:00
parent 51cc677153
commit 1e3246c6cd
2 changed files with 19 additions and 0 deletions

View File

@@ -60,6 +60,19 @@ class command_rm(HoneyPotCommand):
else:
dir.remove(i)
class command_mkdir(HoneyPotCommand):
def call(self, args):
for f in args.split(' '):
path = self.honeypot.fs.resolve_path(f, self.honeypot.cwd)
try:
dir = self.honeypot.fs.get_path('/'.join(path.split('/')[:-1]))
except IndexError:
self.honeypot.writeln(
'mkdir: cannot create directory `%s\': ' % f + \
'No such file or directory')
return
dir.append([f, T_DIR, 0, 0, 4096, 16877, time.time(), [], None])
class command_uptime(HoneyPotCommand):
def call(self, args):
self.honeypot.writeln(
@@ -97,6 +110,10 @@ class command_uname(HoneyPotCommand):
else:
self.honeypot.writeln('Linux')
class command_id(HoneyPotCommand):
def call(self, args):
self.honeypot.writeln('uid=0(root) gid=0(root) groups=0(root)')
class command_mount(HoneyPotCommand):
def call(self, args):
if len(args.strip()):