Guest User

Untitled

a guest
Jan 16th, 2019
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.60 KB | None | 0 0
  1. -- 1. Create a new password entry in Keychain Access called "ExnessLDAP" with your ldap password
  2. -- 2. Create a new password entry in Keychain Access called "Exness2Factor" with your 2fator token
  3. -- 3. Install oath-toolkit. (brew install oath-toolkit)
  4. -- 4. Open this script in Script Editor (both this and the above are in the Applications->Utilities folder) and "Save as.." an Application (.app) with desired name.
  5. -- 5. Open Security & Privacy System Preferences, go to Privacy, Accessibility.
  6. -- 6. Enable the above .app so it can access Accessibility
  7. -- 7. Add the new .app to /Users/[yourshortname]/Applications with a shortcut to your Dock
  8. -- 8. Enjoy the fast connection with no need to enter password and increased security of not having a sensitive password stored as plain text.
  9.  
  10. set targetApp to "Cisco AnyConnect Secure Mobility Client"
  11. set ExnessLDAPKeyChainKey to "ExnessLDAP"
  12. set Exness2FactorKeyChainKey to "Exness2Factor"
  13.  
  14. tell application targetApp
  15. activate
  16. end tell
  17.  
  18. tell application "System Events"
  19.  
  20. repeat until (window 1 of process targetApp exists)
  21. delay 1
  22. end repeat
  23. repeat until (window 2 of process targetApp exists)
  24. delay 1
  25. end repeat
  26.  
  27. tell process targetApp
  28. set PSWD to do shell script "/usr/bin/security find-generic-password -wl " & quoted form of ExnessLDAPKeyChainKey
  29. set Token to do shell script "/usr/bin/security find-generic-password -wl " & quoted form of Exness2FactorKeyChainKey
  30. set PSWD2 to do shell script "/usr/local/bin/oathtool --totp -b -d 6 " & quoted form of Token
  31. keystroke PSWD as text
  32. keystroke tab
  33. keystroke PSWD2 as text
  34. keystroke return
  35. end tell
  36.  
  37. end tell
Add Comment
Please, Sign In to add comment