Created
August 1, 2022 23:48
-
-
Save lemontv/62d9ae76981ffde24bd6f1e08bd67293 to your computer and use it in GitHub Desktop.
Get Yubikey OTP from NFC reader
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Get avaialbel reader | |
reader=$(opensc-tool --list-reader | grep 'Yes' | awk '{ print $1 }') | |
# Get Yubikey OTP | |
opensc-tool -c default -r "$reader" -s 00:A4:04:00:07:D2:76:00:00:85:01:01 -s 00:A4:00:0C:02:E1:04 -s 00:B0:00:00:00 | grep -Ev 'Sending|Received' | awk '{ print substr($0, 49) }' | tr -d '\n' | awk '{ print substr($0, 26) }' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment