Wednesday, November 16, 2011

QEMU - VNC - Stupid keyboard issue

So, I ran across an issue that was rather frustrating. Here is the background.

I had installed a plain-vanilla debian machine and then installed libvirt, kvm/qemu and virt-manager (with some other packages but those aren't important).

I had tried to do X11 forwarding on the machine but ran into an issue when trying to use virt-manager to install a guest machine. When ever I would type it would print something other than what I pressed. asdf = abfh.

This wasn't just an issue with X11 forwarding. I also installed tightvncserver and found the same issue. When I would vnc to the Host machine everything would be fine, but when I tried to do an installation through virt-manager I would run into the issue as previously stated.

After looking at everything else I finally took a look at the default keyboard for debian (/etc/default/keyboard) and found that it was "pc105" rather than the plain PC keyboard "pc104" (or pc101).

I know, you are all think "well duh...!" but I didn't know that. After changing the keyboard and rebooting everything started to work fine.

Stupid keyboard layouts.


---UPDATE---
So, I was right but I was wrong. It looks like in Virt-Manager they removed the default keymap for the new guest machines. If you go and delete the current display and add a new one you can uncheck "Keymap [] same as host" and input "en-us". This should fix the issue. (I hope)

Sunday, October 30, 2011

AUTH TLS + FEAT

I ran across a vulnerability a little while ago that was rather interesting. FTP/FTPS has a "FEAT" or Features command that can be passed to the server in order to find out what features are available. But with FTPS this should only work "After" you are authenticated.

Nessus reported the issue but gave the following output for steps to duplicate:
Nessus sent the following two commands in a single packet :

AUTH TLS\r\nFEAT\r\n

And the server sent the following two responses :

234 AUTH command ok. Expecting TLS Negotiation.
211-Extended features supported:
LANG EN*
UTF8
AUTH TLS;TLS-C;SSL;TLS-P;
PBSZ
PROT C;P;
CCC
HOST
SIZE
MDTM
211 END
Now, I may not be the smartest person when it comes to telnet but I am pretty sure you are not able to pass '\r\n' into a telnet session. After making a few attempts my suspicions were confirmed and I was left wondering what it was I needed to do to get the command to execute properly.

I turned to google for help and found a forum that answered my question: control character for 'return'/'enter' = ^J. By using ^J I was able to insert a 'return' but not have the return executed until after I physically hit the return button when I was done with the commands I wanted to execute.

testing:~ hyrum$ telnet www.testsite.com 21
Trying 1.2.3.4...
Connected to www.testsite.com.
Escape character is '^]'.
220 Microsoft FTP Service
AUTH TLS^JFEAT
234 AUTH command ok. Expecting TLS Negotiation.
211-Extended features supported:
 LANG EN*
 UTF8
 AUTH TLS;TLS-C;SSL;TLS-P;
 PBSZ
 PROT C;P;
 CCC
 HOST
 SIZE
 MDTM
211 END
By inserting ^J after the 'AUTH TLS' it was possible to add the FEAT command which according to the rftc (rfc4217) if you pass the FEAT command to the server the server must respond with the available features:

"If a server supports the FEAT command, then it MUST advertise supported AUTH, PBSZ, and PROT commands in the reply, as described in section 3.2 of [RFC-2389]."


It ended up being that simple. Control Characters really do come in handy sometimes. So, the next time you want to pass two commands while in a telnet session don't forget about ^J.

Monday, October 17, 2011

Debian - Openbox Install

This last week I was trying to install openbox on a fresh install of Debian but ran into issues after running
$ apt-get install openbox
Doing a google search gave me several links of people suggesting that I compile openbox from source and that it is the only way to get it installed. After a little more research and help from Mike (thanks mike) I ended up doing the following:
$ apt-get install slim
$ apt-get install openbox menu
Did I really need to do two apt-get's? No, but I wanted to make sure that slim really was installed before moving on.

So, the first apt-get is to install slim which is a "graphical login manager for X11" (aptitude show slim).

The second apt-get is to install openbox itself and menu which is a "Debian menu [that] keeps transparently the menus in the different window-managers in sync with the list of installed programs." (aptitude show menu)

That is all you should have to install. Once you have installed these three items reboot the system and you should be presented with a login window. When you go to log in you will want to click on session and choose openbox, you should only have to do this once.

If you thought this was at all helpful please post a comment and let me know.