Skip to content

Instantly share code, notes, and snippets.

@Y7n05h
Last active November 29, 2021 03:51
Show Gist options
  • Select an option

  • Save Y7n05h/a0e366e95587dbf7e92535e41ceb67e4 to your computer and use it in GitHub Desktop.

Select an option

Save Y7n05h/a0e366e95587dbf7e92535e41ceb67e4 to your computer and use it in GitHub Desktop.
Get GNU libc version from file
#!/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