Password Algorithms: Cisco Unified Personal Communicator

本文探讨了Cisco Unified Personal Communicator应用中使用的密码保护机制。该应用通过Windows Crypto API使用DPAPI加密用户凭证并将其存储在本地DAT文件中。文章还详细介绍了用于加密和解密过程的代码片段。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Password Algorithms: CiscoUnified Personal Communicator

密码算法:Cisco UnifiedPersonal Communicator应用

原文链接:Password Algorithms: Cisco Unified Personal Communicator

        这个应用(Cisco UnifiedPersonal Communicator)需要你在线花费一些时间才能获取到。因为思科阻止了一些下载,除非你符合几下几点:

·  Direct  Customer

·  Partner-Reseller

·  Service ContractOwners

·  CCIE Professional

·  PICA Customer

即,

1,思科的直接用户

2,  服务合同业主

3,  CCIE专业人员

4,  PICA客户

 

        我已经在我的Windows7工作站上安装了它,因此下面的测试结果可能因为机器不同而有些不同。

默认情况下,用户名与密码字段下面有一个复选框,它可以设置允许自动登录功能。

如果设置了允许自动登录,那么应用会在下面的路径中建立一个DAT文件。

C:\Users\dietrich\AppData\Local\Cisco\Unified Communications\ClientServices Framework\Config\Profile

 

        文件的名字将会由UuidCreate这个函数生成,文件内容采取Base64进行编码。一旦解码,它会转换成和DPAPI相关的二进制大对象(BLOB)。

  00000000 01 00 00 00 d0 8c 9d df 01 15 d1 11 8c 7a 00 c0      ....ð..¯..Ð..z.+
  00000010 4f c2 97 eb 01 00 00 00 57 4a ac d0 b9 66 a5 4b      O-.Ù....WJ¼ð¦fÑK
  00000020 b3 47 a3 ea 37 85 af 43 00 00 00 00 32 00 00 00      ¦GúÛ7.»C....2...
  00000030 61 00 75 00 74 00 68 00 5f 00 73 00 76 00 6e 00      a.u.t.h._.s.v.n.
  00000040 2e 00 73 00 69 00 6d 00 70 00 6c 00 65 00 2e 00      ..s.i.m.p.l.e...
  00000050 77 00 69 00 6e 00 63 00 72 00 79 00 70 00 74 00      w.i.n.c.r.y.p.t.

 

        上面这个BLOB中特别有趣的是,它描叙了一个字符串,“auth_svn.simple.wincrypt”

 

我最初以为这可能是一些库的一部分,并且足够的相信它就是的。更确切来说,就是LibSVN

 

下面,我使用相同的描述(密钥)来加密数据,这是我测试代码的一个片段

点击查看全部代码

/*-----------------------------------------------------------------------*/
/* Windows simple provider, encrypts the password on Win2k and later.    */
/*-----------------------------------------------------------------------*/
 
/* The description string that's combined with unencrypted data by the
   Windows CryptoAPI. Used during decryption to verify that the
   encrypted data were valid. */
   
static const WCHAR description[] = L"auth_svn.simple.wincrypt";
 
/* Implementation of svn_auth__password_set_t that encrypts
   the incoming password using the Windows CryptoAPI. */
static svn_boolean_t
windows_password_encrypter(apr_hash_t *creds,
                           const char *realmstring,
                           const char *username,
                           const char *in,
                           apr_hash_t *parameters,
                           svn_boolean_t non_interactive,
                           apr_pool_t *pool)
{
  DATA_BLOB blobin;
  DATA_BLOB blobout;
  svn_boolean_t crypted;
 
  blobin.cbData = strlen(in);
  blobin.pbData = (BYTE*) in;
  crypted = CryptProtectData(&blobin, description, NULL, NULL, NULL,
                             CRYPTPROTECT_UI_FORBIDDEN, &blobout);
  if (crypted)
    {
      char *coded = apr_palloc(pool, apr_base64_encode_len(blobout.cbData));
      apr_base64_encode(coded, (const char*)blobout.pbData, blobout.cbData);
      crypted = svn_auth__simple_password_set(creds, realmstring, username,
                                              coded, parameters,
                                              non_interactive, pool);
      LocalFree(blobout.pbData);
    }
  return crypted;
}

 

        相比写一个解密工具,我倒倾向于在调试器中输出由CryptUnprotectData返回的内容。

这是一个包含了明文凭据的XML文件,这正是Personal Communicator 如何完成自动登录的。

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
  <UserCredentialDetails><profileName>Profile1</profileName>
    <credentials><username>userid</username>
      <password>password</password>
      <credentialsType>PRESENCE_SERVICE</credentialsType>
      <rememberMe>true</rememberMe>
    </credentials>
  </UserCredentialDetails>

 

当然,这其中可能存在多个配置文件,但是我并没有继续研究下去了。


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值