mirror of
https://github.com/aljazceru/cowrie.git
synced 2025-12-18 06:24:20 +01:00
Improved chmod - checks to see if file exists
:x
This commit is contained in:
@@ -291,10 +291,23 @@ class command_yes(HoneyPotCommand):
|
||||
self.exit()
|
||||
commands['/usr/bin/yes'] = command_yes
|
||||
|
||||
class command_chmod(HoneyPotCommand):
|
||||
def call(self):
|
||||
if len(self.args) and len(self.args) >= 2:
|
||||
for arg in self.args[1:]:
|
||||
path = self.fs.resolve_path(arg, self.honeypot.cwd)
|
||||
if self.fs.exists(path):
|
||||
continue
|
||||
else:
|
||||
self.writeln('chmod: cannot access %s: No such file or directory' % (arg,))
|
||||
else:
|
||||
self.writeln('chmod: missing operand')
|
||||
self.writeln('Try chmod --help for more information.')
|
||||
commands['/bin/chmod'] = command_chmod
|
||||
|
||||
class command_nop(HoneyPotCommand):
|
||||
def call(self):
|
||||
pass
|
||||
commands['/bin/chmod'] = command_nop
|
||||
commands['umask'] = command_nop
|
||||
commands['set'] = command_nop
|
||||
commands['unset'] = command_nop
|
||||
|
||||
Reference in New Issue
Block a user