TeslaCoil Software

  • quicksshd
  • teslaled
  • widgetlocker
  • homesmack
  • contact
Home

Dropbear

Dropbear, by Matt Johnston is a small SSH client and server (sshd) commonly used on embedded systems for network command line access or file transfer purposes. TeslaCoil uses a modified version with android specific patches and extra features. These modified sources can be found at github.com/barryk/android_external_dropbear

History

Matt Johnston over at http://matt.ucc.asn.au/dropbear/dropbear.html created the dropbear SSH client and server. It seems the name is to help raise Drop Bear Awareness. Drop Bear Aware Logo
Google forked the code, for the ssh client, that code can be checked out via git clone git://android.git.kernel.org/platform/external/dropbear.git or if you do a full repo checkout of the android source you'll find it in the external/dropbear directory. This version only compiles the SSH client.
Cyanogen modified the Android Dropbear code to include building the SSH Daemon, his work can be found at cyanogen's android_external_dropbear repository.
I then required an SSH Daemon for QuickSSHD. I looked into Cyanogen's, and did use some of their commits, however I decided a fresh fork of Android's dropbear was cleaner as I took a different approach to password handling than Cyanogen. I believe Cyanogen initially attempted to use a hardcoded password, but then switched tactics to allow any password to work without any verification. This is fine if you're firewalled and use is only temporary, but not suitable for full time use. QuickSSHD password authentication includes a user-settable password that will work for any account. The password is stored as a one-way-hash using the crypt_md5 method.

Building

If you wish to build dropbear yourself you will need to start with the Android Source
I used a Ubuntu 9.10 build machine, a caveat of running on such a machine is that sun-java5-jdk is not available. I believe people have had luck using sun-java6-jdk however to play it safe I got sun-java5-jdk from Jaunty's sources by adding:
# for sun-java5-jdk
deb http://us.archive.ubuntu.com/ubuntu/ jaunty multiverse
deb http://us.archive.ubuntu.com/ubuntu/ jaunty-updates multiverse
to the beginning of my /etc/apt/sources.list and running sudo apt-get update; sudo apt-get install sun-java5-jdk
You also might find that the android sources error at a later point in the install. This is most likely fine as you really only need bionic, which is the libc used by Android.

Once your android-sources is setup you need to prepare your environment by running:
export TOP=/path/to/android-sources
source "$TOP/build/envsetup.sh"

This will add a few shell functions to help building Android code. Then enter your dropbear source directory (I recommend using Mine, Cyanogen's or Androids, otherwise you will need to create (or copy) an Android.mk makefile.)
To build simply run:
mm
The binaries will be places in $TOP/out/target/product/generic/, in this case the SSH Daemon is at $TOP/out/target/product/generic/system/xbin/dropbear

Usage


$ ./dropbear -h
Dropbear sshd v0.52
Usage: ./dropbear [options]
Options are:
-b bannerfile Display the contents of bannerfile before user login
(default: none)
-d dsskeyfile Use dsskeyfile for the dss host key
(default: /data/dropbear/dropbear_dss_host_key)
-r rsakeyfile Use rsakeyfile for the rsa host key
(default: /data/dropbear/dropbear_rsa_host_key)
-F Don't fork into background
-E Log to stderr rather than syslog
-m Don't display the motd on login
-w Disallow root logins
-s Disable password logins
-g Disable password logins for root
-Y password Enable master password to any account
-j Disable local port forwarding
-k Disable remote port forwarding
-a Allow connections to forwarded ports from any host
-p [address:]port
Listen on specified tcp port (and optionally address),
up to 10 can be specified
(default port is 22 if none specified)
-P PidFile Create pid file PidFile
(default /var/run/dropbear.pid)
-i Start for inetd
-W <receive_window_buffer> (default 24576, larger may be faster, max 1MB)
-K <keepalive> (0 is never, default 0)
-I <idle_timeout> (0 is never, default 0)

Of note in TeslaCoil's dropbear is the -Y option to allow a master password. Because android doesn't use passwords, password authentication would not normally make sense. Instead we allow the user that started the daemon to also specify a password. This can be specified either as cleartext, or (recommended) a crypt_md5 hash. The crypt_md5 hash is the same format as commonly used on modern *nix systems in the passwd or shadow file and begins with a $ character, for example: "$1$456789$q7LqtAIxNEQl9aqTCi2WI0".

  • dropbear
  • quicksshd
  • ssh
  • sshd
  • quicksshd
  • teslaled
  • widgetlocker
  • homesmack
  • contact