I found a binary on a device I've been working on, it's called genrandpass
and the only user input is a public key (which is a .bin file) that's stored locally on the device. It also gathers some other information, possibly from the environment to produce three passwords (there is a reference to the Box ID using strings
). Looking thru the shell scripts pertaining to genrandpass
, it takes the three generated passwords and:
- uses the first password as the root password
- uses the second password is called
$epass
and the third is called$spass
(I only note the names in case it means anything to someone smarter than I.) - it then copies
$epass
and$spass
to the dropbear banner file and these are displayed whenever someone connects to dropbear (prior to even logging in).
This makes me think that the developer had intended on being able to use the $epass
and $spass
variables to generate the actual root password. There are a few certificates and one Private key (decryption.pem) on the box itself. Not sure if it's the right key to decipher the code but I'd like to try because I have a few other models of these boxes that I haven't been able to break into yet. I'm just not sure what the correct commands are to try. Any ideas?
genrandpass file at https://dl.dropboxusercontent.com/u/23091/genrandpass
examples of the last 2 passwords generated:
$epass: SxTV2Z7TFvU0XKP/lYYTDlKAhlRR2jwkDGbWPF68go/oOx6x4Pr5DeyNRlx9oQGF05sHld/vyXXchmxlbzsVzPIwocWIq3OIr3J+ZFJrJYPss9VE7YWrwpyRlGwTVHDvZGIzCKXcaipJd85ldLiWUrNxMl4g+5kzwVA2a3I8LuiuixRFVmc8ji/W2W5ZeU5FTcbaiNjlpoRHjPFUkvHKJ4nHSfXpZuLDRS53hxcSnb8ZmvTmFP4ITAdyj9Yw+C2pvD+gSEWRB/H+1cFPQOTi7wr/FY8266QEWqGZw30ZEsMCUNCC0DgiIX+H68QKcU8QFYUJC5+vui3BtcOfFXKHZl==
$spass: RtcTy7fJ11XAQi1P2HiZM4MAxMZMA2NlD6wZL8jNYdrSL5i8qtkGztKDccmGqRWgjiVKI7TcVNcX3PhUSB3UfQCAF6KpBvH7NNezkExdwdM3W2mSnXJvyRLpDSJEgALs0wurUrqIYClZOjTc+xiJzOIUP0Gxb4d2ADOaKXHQ6n6H2Ss/1smITjrbXJ1K8RentZu26sAy3DW+zRIxtxnktSAGUscdG1oytlOL15aAROSL27NUcPSoA3+4o76zggq5TspIBTSmidVRUccEdXPyAzZggR0yqGNrm99uJXHlhw4zCW+GzKJFsJSTwDHZvCoeLERCLuyXFVrgmIISKf6E2V==
fopen
,fread
,puts
, which could be expected, but also alibjsonsigner.so
that has functions likerun_sha256
,run_rsa_public_decrypt
(one could guess what they do) but alsoget_finder_id_public_key
andmake_password
, which seem to be crucial to understand what's going on. Please upload that library as well.rsa
andpublic_key
, i'm inclined to believespass
and/orepass
are versions of the root password encrypted with a public key that's on the device, but you won't be able to derive the root password from them without the private key, which you don't have. So the vendor can get the password from devices that are "found" and need to be reinitialized, but noone else can (unless you can crack RSA).