kevva / wifi-password

Get current wifi password
MIT License
617 stars 54 forks source link

Not able retrivew password. #8

Closed hemanth closed 9 years ago

hemanth commented 9 years ago
○ → wifi-password 
Your network doesn't have a password

On 14.0.0 Darwin Kernel Version am I missing something?

Connected to a n/w with WPA2 secured password.

kevva commented 9 years ago

Can you run security find-generic-password -D "AirPort network password" -ga ssid and paste the output?

hemanth commented 9 years ago
security: SecKeychainSearchCopyNext: The specified item could not be found in the keychain.

@kevva

Update: After adding to keychain

○ → security find-generic-password -D "AirPort network password"
keychain: "/Library/Keychains/System.keychain"
class: "genp"
attributes:
    0x00000007 <blob>="home"
    0x00000008 <blob>=<NULL>
    "acct"<blob>="home"
    "cdat"<timedate>=0x32303134313130343035333232325A00  "20141104053222Z\000"
    "crtr"<uint32>=<NULL>
    "cusi"<sint32>=<NULL>
    "desc"<blob>="AirPort network password"
    "gena"<blob>=<NULL>
    "icmt"<blob>=<NULL>
    "invi"<sint32>=<NULL>
    "mdat"<timedate>=0x32303134313130343035333232325A00  "20141104053222Z\000"
    "nega"<sint32>=<NULL>
    "prot"<blob>=<NULL>
    "scrp"<sint32>=<NULL>
    "svce"<blob>="AirPort"
    "type"<uint32>=<NULL>
kevva commented 9 years ago

So the -ga ssid option doesn't work even after adding it to your keychain?

hemanth commented 9 years ago

Yup.

kevva commented 9 years ago

@sindresorhus, do you have any idea why this happens?

sindresorhus commented 9 years ago

I get the same. The reason this happens is because I have iCloud password syncing on, which means the wifi passwords are in the iCloud keychain, not the System one.

Your current check is also incorrect as it just get's the first password it finds, not the most recently used one.

kevva commented 9 years ago

@hemanth @sindresorhus could you test the new version?

hemanth commented 9 years ago

Works fine! Thanks.

Use-wflag to display password directly alright.

sindresorhus commented 9 years ago

:+1: Works now :)