Last active
November 29, 2021 03:51
-
-
Save Y7n05h/a0e366e95587dbf7e92535e41ceb67e4 to your computer and use it in GitHub Desktop.
Get GNU libc version from file
This file contains hidden or 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
| #!/usr/bin/zsh | |
| # Depends on: strings grep sha1sum curl jq | |
| # Powered by the libc-database search API | |
| # https://github.com/niklasb/libc-database/tree/master/searchengine | |
| strings $1 |grep 'GNU C Library' | |
| sha1str=$(sha1sum $1) | |
| curl -s -X POST -H 'Content-Type: application/json' --data "{\"sha1\": \"${sha1str// */}\"}" 'https://libc.rip/api/find'|jq -r '.[]' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment