dirtyfilthy/metassh — Issue #1: ls no longer works after shell
Author: egypt
Created: 2012-01-08 03:26:11+00:00
State: open

It appears that something the ls command needs is getting closed with the shell.

````
[*] metaSSH session 1 opened (127.0.0.1 -> 192.168.99.1:22) at 2012-01-07 20:17:55 -0700

metaSSH > cd /
metaSSH > ls

Listing: /
==========

Mode Size Type Last modified Name
---- ---- ---- ------------- ----
120777/rwxrwxrwx 30 lin 2011-11-13 11:12:17 -0700 vmlinuz.old
120777/rwxrwxrwx 30 lin 2011-12-27 12:02:08 -0700 vmlinuz
120777/rwxrwxrwx 33 lin 2011-12-27 12:02:08 -0700 initrd.img
120777/rwxrwxrwx 33 lin 2011-11-13 11:12:17 -0700 initrd.img.old
120777/rwxrwxrwx 4 lin 2010-02-06 23:01:41 -0700 lib64
120777/rwxrwxrwx 11 lin 2010-02-06 23:01:17 -0700 cdrom
40555/r-xr-xr-x 0 dir 2012-01-05 08:16:29 -0700 proc
40700/rwx------ 16384 dir 2010-02-06 23:00:57 -0700 lost+found
40700/rwx------ 4096 dir 2011-11-26 21:29:59 -0700 root
40755/rwxr-xr-x 4096 dir 2010-10-23 01:51:25 -0600 man
40755/rwxr-xr-x 12288 dir 2011-12-27 11:57:44 -0700 lib
40755/rwxr-xr-x 12288 dir 2011-04-28 18:12:22 -0600 lib32
40755/rwxr-xr-x 12288 dir 2012-01-07 17:35:53 -0700 etc
40755/rwxr-xr-x 3920 dir 2012-01-07 18:51:33 -0700 dev
40755/rwxr-xr-x 4096 dir 2011-11-19 19:53:00 -0700 home
40755/rwxr-xr-x 4096 dir 2012-01-06 16:43:27 -0700 media
40755/rwxr-xr-x 4096 dir 2009-10-19 19:18:56 -0600 mnt
40755/rwxr-xr-x 4096 dir 2011-11-16 10:24:16 -0700 opt
40755/rwxr-xr-x 4096 dir 2011-12-27 12:02:07 -0700 boot
40755/rwxr-xr-x 4096 dir 2012-01-05 08:17:01 -0700 ..
40755/rwxr-xr-x 4096 dir 2011-11-03 10:49:35 -0600 sbin
40755/rwxr-xr-x 4096 dir 2009-10-19 18:48:56 -0600 selinux
40755/rwxr-xr-x 4096 dir 2010-07-11 14:31:24 -0600 srv
40755/rwxr-xr-x 0 dir 2012-01-05 08:16:29 -0700 sys
40755/rwxr-xr-x 4096 dir 2012-01-05 08:17:01 -0700 .
40755/rwxr-xr-x 4096 dir 2011-11-02 15:10:49 -0600 usr
40755/rwxr-xr-x 4096 dir 2011-11-17 15:07:24 -0700 var
40755/rwxr-xr-x 4096 dir 2011-12-27 11:57:43 -0700 bin
41777/rwxrwxrwx 12288 dir 2012-01-07 20:14:07 -0700 tmp

metaSSH > shell
Channel 1 created.
bash: cannot set terminal process group (-1): Invalid argument
bash: no job control in this shell
tput: No value for $TERM and no -T specified
tput: No value for $TERM and no -T specified
tput: No value for $TERM and no -T specified
tput: No value for $TERM and no -T specified
tput: No value for $TERM and no -T specified
tput: No value for $TERM and no -T specified
tput: No value for $TERM and no -T specified
tput: No value for $TERM and no -T specified
egypt@maat ~ $ exit
exit
exit
metaSSH > ls
[-] Error running command ls: IOError closed stream
/home/egypt/svn/metasploit-framework/plugins/meta_ssh/lib/rex/post/meta_ssh/channel.rb:136:in `close'
/home/egypt/svn/metasploit-framework/plugins/meta_ssh/lib/rex/post/meta_ssh/channel.rb:136:in `close'
/home/egypt/svn/metasploit-framework/plugins/meta_ssh/lib/rex/post/meta_ssh/channel.rb:59:in `block (3 levels) in initialize'
/home/egypt/svn/metasploit-framework/lib/net/ssh/connection/channel.rb:585:in `call'
/home/egypt/svn/metasploit-framework/lib/net/ssh/connection/channel.rb:585:in `do_close'
/home/egypt/svn/metasploit-framework/lib/net/ssh/connection/session.rb:578:in `channel_close'
/home/egypt/svn/metasploit-framework/lib/net/ssh/connection/session.rb:458:in `dispatch_incoming_packets'
/home/egypt/svn/metasploit-framework/lib/net/ssh/connection/session.rb:215:in `preprocess'
/home/egypt/svn/metasploit-framework/lib/net/ssh/connection/session.rb:199:in `process'
/home/egypt/svn/metasploit-framework/lib/net/ssh/connection/session.rb:163:in `block in loop'
/home/egypt/svn/metasploit-framework/lib/net/ssh/connection/session.rb:163:in `loop'
/home/egypt/svn/metasploit-framework/lib/net/ssh/connection/session.rb:163:in `loop'
/home/egypt/svn/metasploit-framework/plugins/meta_ssh/lib/net/sftp/session.rb:802:in `loop'
/home/egypt/svn/metasploit-framework/plugins/meta_ssh/lib/net/sftp/request.rb:72:in `wait'
/home/egypt/svn/metasploit-framework/plugins/meta_ssh/lib/net/sftp/session.rb:842:in `wait_for'
/home/egypt/svn/metasploit-framework/plugins/meta_ssh/lib/net/sftp/session.rb:544:in `realpath!'
/home/egypt/svn/metasploit-framework/plugins/meta_ssh/lib/rex/post/meta_ssh/extensions/stdapi/fs/sftp.rb:78:in `method_missing'
/home/egypt/svn/metasploit-framework/plugins/meta_ssh/lib/rex/post/meta_ssh/extensions/stdapi/fs/sftp.rb:50:in `absolute_path'
/home/egypt/svn/metasploit-framework/plugins/meta_ssh/lib/rex/post/meta_ssh/extensions/stdapi/fs/file.rb:60:in `realpath'
/home/egypt/svn/metasploit-framework/plugins/meta_ssh/lib/rex/post/meta_ssh/extensions/stdapi/fs/dir.rb:66:in `entries_with_info'
/home/egypt/svn/metasploit-framework/plugins/meta_ssh/lib/rex/post/meta_ssh/ui/console/command_dispatcher/stdapi/fs.rb:333:in `cmd_ls'
/home/egypt/svn/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:380:in `run_command'
/home/egypt/svn/metasploit-framework/plugins/meta_ssh/lib/rex/post/meta_ssh/ui/console.rb:99:in `run_command'
/home/egypt/svn/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:342:in `block in run_single'
/home/egypt/svn/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:336:in `each'
/home/egypt/svn/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:336:in `run_single'
/home/egypt/svn/metasploit-framework/plugins/meta_ssh/lib/rex/post/meta_ssh/ui/console.rb:63:in `block in interact'
/home/egypt/svn/metasploit-framework/lib/rex/ui/text/shell.rb:189:in `call'
/home/egypt/svn/metasploit-framework/lib/rex/ui/text/shell.rb:189:in `run'
/home/egypt/svn/metasploit-framework/plugins/meta_ssh/lib/rex/post/meta_ssh/ui/console.rb:61:in `interact'
/home/egypt/svn/metasploit-framework/plugins/meta_ssh/lib/msf/base/sessions/meta_ssh.rb:270:in `_interact'
/home/egypt/svn/metasploit-framework/lib/rex/ui/interactive.rb:48:in `interact'
/home/egypt/svn/metasploit-framework/lib/msf/ui/console/command_dispatcher/core.rb:1553:in `cmd_sessions'
/home/egypt/svn/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:380:in `run_command'
/home/egypt/svn/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:342:in `block in run_single'
/home/egypt/svn/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:336:in `each'
/home/egypt/svn/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:336:in `run_single'
/home/egypt/svn/metasploit-framework/lib/msf/ui/console/command_dispatcher/exploit.rb:178:in `cmd_exploit'
/home/egypt/svn/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:380:in `run_command'
/home/egypt/svn/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:342:in `block in run_single'
/home/egypt/svn/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:336:in `each'
/home/egypt/svn/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:336:in `run_single'
/home/egypt/svn/metasploit-framework/lib/rex/ui/text/shell.rb:199:in `run'
./msfconsole:134:in `

'
````