Full Disclosure: opensshd - user enumeration
When SSHD tries to authenticate a non-existing user, it will pick up a fake password structure hardcoded in the SSHD
source code. On this hard coded password structure the password hash is based on BLOWFISH ($2) algorithm.
If real users passwords are hashed using SHA256/SHA512, then sending large passwords (10KB) will result in shorter
response time from the server for non-existing users.
opensshã¯åå¨ããªãã¦ã¼ã¶ã§ãã°ã¤ã³ãããã¨ããã¨ãã¼ãã³ã¼ããããå½ã®ãã¹ã¯ã¼ãã®ããã·ã¥å¤ã«å¯¾ãã¦èªè¨¼ãããã¨ãããã§ãããã·ã¥å¤ã®ãã¹ã¯ã¼ããåå¨ããã¦ã¼ã¶ãªãã°é常SHA256($5)ãSHA512($6)ã§ããã·ã¥ãè¨ç®ãã¦ããã¯ãããå½ã®ã¦ã¼ã¶ã®å ´åã¯ãã¼ãã³ã¼ãããã¦ããããã·ã¥å¤ãBlowfish($2)ã§ãããããåå¨ããã¦ã¼ã¶ã¨æ¯ã¹ã¦è¨ç®ãæ©ãçµäºããã®ã§ãã¦ã¼ã¶ã®åå¨ããã§ãã¯ãããã¨ãã§ããã¨ãã話ã®ããã ã
auth.cã®fakepwã§ç¢ºãã«ãã¼ãã³ã¼ããã¦ãããªã
struct passwd * fakepw(void) { static struct passwd fake; memset(&fake, 0, sizeof(fake)); fake.pw_name = "NOUSER"; fake.pw_passwd = "$2a$06$r3.juUaHZDlIbQaO2dS9FuYxL1W9M81R1Tc92PoSNmzvpEqLkLGrK"; #ifdef HAVE_STRUCT_PASSWD_PW_GECOS fake.pw_gecos = "NOUSER"; #endif fake.pw_uid = privsep_pw == NULL ? (uid_t)-1 : privsep_pw->pw_uid; fake.pw_gid = privsep_pw == NULL ? (gid_t)-1 : privsep_pw->pw_gid; #ifdef HAVE_STRUCT_PASSWD_PW_CLASS fake.pw_class = ""; #endif fake.pw_dir = "/nonexist"; fake.pw_shell = "/nonexist"; return (&fake);