mirror of
https://github.com/aljazceru/cowrie.git
synced 2025-12-17 22:14:19 +01:00
New commands: mkdir, id
git-svn-id: https://kippo.googlecode.com/svn/trunk@11 951d7100-d841-11de-b865-b3884708a8e2
This commit is contained in:
@@ -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()):
|
||||
|
||||
Reference in New Issue
Block a user