欢迎各位兄弟 发布技术文章

这里的技术是共享的

You are here

钥匙串 find-generic-password find-internet-password delete-generic-password delete-internet-password 自己亲自做的 有大用 有大大用 有大大大用 有大大大大用 有大大大大大用

1) aaaaaaa@localhost ~ % security find-generic-password -l "MetadataKeychain" -w      #查看 MetadataKeychain 的密码

qdF4l3h1cQ}C*;lS4ooG

# 显示元数据钥匙串密码 -l 英文字母, Match "label" string ,,,,,  -w   Display only the password on stdout

#如下图,只有钥匙串中是  登录 或 系统  的,用  -l 才行  ( exchange反正属于 登录 项,也是可以的   ),,,,,,,是 本地项目 的不行

./Library/Keychains/login.keychain-db       #有关登录的钥匙串文件

/Library/Keychains/System.keychain          #有关系统的钥匙串文件



image.png

2) aaaaaaa@localhost ~ % security find-generic-password -l "MetadataKeychain"   #查看 MetadataKeychain 的信息

keychain: "/Users/bbbb-admin/Library/Keychains/login.keychain-db"

version: 512

class: "genp"

attributes:

    0x00000007 <blob>="MetadataKeychain"

    0x00000008 <blob>=<NULL>

    "acct"<blob>=<NULL>

    "cdat"<timedate>=0x32303234303730373035343232305A00  "20240707054220Z\000"

    "crtr"<uint32>="aapl"

    "cusi"<sint32>=<NULL>

    "desc"<blob>=<NULL>

    "gena"<blob>=<NULL>

    "icmt"<blob>=<NULL>

    "invi"<sint32>=<NULL>

    "mdat"<timedate>=0x32303234303730373035343232305A00  "20240707054220Z\000"

    "nega"<sint32>=<NULL>

    "prot"<blob>=<NULL>

    "scrp"<sint32>=<NULL>

    "svce"<blob>="MetadataKeychain"

    "type"<uint32>=<NULL>



1) security find-generic-password -l "Exchange"      #查看 Exchange的信息

2) security find-generic-password -l "Exchange" -w   #查看 Exchange的密码

3) security delete-generic-password -l "Exchange"   #删除 Exchange的条目



#清理公共盘钥匙串

#如下图,公共盘是  登录 的,用的是 find-internet-password  而不是 find-generic-password

1) aaaaaaa@localhost ~ %  security find-internet-password -l "192.168.2.6"    #查看 192.168.2.6的信息

keychain: "/Users/bbbb-admin/Library/Keychains/login.keychain-db"

version: 512

class: "inet"

attributes:

    0x00000007 <blob>="192.168.2.6"

    0x00000008 <blob>=<NULL>

    "acct"<blob>="123456789"

    "atyp"<blob>=<NULL>

    "cdat"<timedate>=0x32303234303731353233343534335A00  "20240715234543Z\000"

    "crtr"<uint32>=<NULL>

    "cusi"<sint32>=<NULL>

    "desc"<blob>=0xE7BD91E7BB9CE5AF86E7A081 

    "icmt"<blob>=<NULL>

    "invi"<sint32>=<NULL>

    "mdat"<timedate>=0x32303234303732323030333430365A00  "20240722003406Z\000"

    "nega"<sint32>=<NULL>

    "path"<blob>=<NULL>

    "port"<uint32>=0x00000000 

    "prot"<blob>=<NULL>

    "ptcl"<uint32>="smb "

    "scrp"<sint32>=<NULL>

    "sdmn"<blob>=<NULL>

    "srvr"<blob>="192.168.2.6"

    "type"<uint32>=<NULL>

 




image.png


  security find-internet-password -l "192.168.2.6" -w   #查看 192.168.2.6的密码

  security delete-internet-password -l "192.168.2.6"   #删除 192.168.2.6的条目


普通分类: