mirror of https://github.com/desaster/kippo.git
Merge branch 'bash' of https://github.com/g0tmi1k/kippo into g0tmi1k-bash
This commit is contained in:
commit
e4d4ea4b2e
|
@ -78,7 +78,7 @@ commands['/bin/hostname'] = command_hostname
|
|||
|
||||
class command_uname(HoneyPotCommand):
|
||||
def call(self):
|
||||
if len(self.args) and self.args[0].strip() == '-a':
|
||||
if len(self.args) and (self.args[0].strip() == '-a' or self.args[0].strip() == '--all'):
|
||||
self.writeln(
|
||||
'Linux %s 2.6.26-2-686 #1 SMP Wed Nov 4 20:45:37 UTC 2009 i686 GNU/Linux' % \
|
||||
self.honeypot.hostname)
|
||||
|
|
|
@ -25,7 +25,7 @@ commands['/bin/cat'] = command_cat
|
|||
|
||||
class command_cd(HoneyPotCommand):
|
||||
def call(self):
|
||||
if not self.args:
|
||||
if not self.args or self.args[0] == "~":
|
||||
path = self.honeypot.user.home
|
||||
else:
|
||||
path = self.args[0]
|
||||
|
@ -34,11 +34,14 @@ class command_cd(HoneyPotCommand):
|
|||
newdir = self.fs.get_path(newpath)
|
||||
except IndexError:
|
||||
newdir = None
|
||||
if path == "-":
|
||||
self.writeln('bash: cd: OLDPWD not set')
|
||||
return
|
||||
if newdir is None:
|
||||
self.writeln('bash: cd: %s: No such file or directory' % path)
|
||||
return
|
||||
if not self.fs.is_dir(newpath):
|
||||
self.writeln('-bash: cd: %s: Not a directory' % path)
|
||||
self.writeln('bash: cd: %s: Not a directory' % path)
|
||||
return
|
||||
self.honeypot.cwd = newpath
|
||||
commands['cd'] = command_cd
|
||||
|
|
|
@ -90,7 +90,7 @@ class HoneyPotShell(object):
|
|||
cmdAndArgs = shlex.split(line)
|
||||
except:
|
||||
self.honeypot.writeln(
|
||||
'-bash: syntax error: unexpected end of file')
|
||||
'bash: syntax error: unexpected end of file')
|
||||
# could run runCommand here, but i'll just clear the list instead
|
||||
self.cmdpending = []
|
||||
self.showPrompt()
|
||||
|
|
Loading…
Reference in New Issue