Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # greynoise.io api helper shell function
- # cc0 / kopime: x0 <https://pastebin.com/u/xero
- # _ ___ ______ _ ______ _ _______ _ _______
- # _\\\ \/ /_\\\ _ /_ _\\\_ \_\\\ _ \
- # \ _/ / \_/ \ / __/ / \
- # / \ \__ \ \ \__ / /
- # /_____/\ /__________/____\ /________/
- # \_____/ \____/x0^b7^imp
- # required:
- # export GREY_TOKEN="your_api_token_here"
- # usage:
- # greynoise 104.236.227.188
- # greynoise 0w.nz
- # dig +short xero.nu | greynoise
- function greynoise() {
- IP="${1:-/dev/stdin}"
- [[ "$IP" =~ "stdin" ]] && read IP < "$IP"
- [[ "$IP" =~ "([0-9]{1,3}[\.]){3}[0-9]{1,3}" ]] || IP=`dig +short ${IP}`
- curl -sX GET "https://api.greynoise.io/v2/noise/context/${IP}" -H "Accept: application/json" -H "key: ${GREY_TOKEN}"
- }
Advertisement
Add Comment
Please, Sign In to add comment