Skip to content

Instantly share code, notes, and snippets.

@sneakymonk3y
Last active November 13, 2023 12:23
Show Gist options
  • Select an option

  • Save sneakymonk3y/29782184a4aff63ca37aa7a9a84ab524 to your computer and use it in GitHub Desktop.

Select an option

Save sneakymonk3y/29782184a4aff63ca37aa7a9a84ab524 to your computer and use it in GitHub Desktop.
IP lookup / greynoise.io / ipinfo.io / shodan.io / otx.alienvault.com
#!/bin/bash
args=("$@")
check_greynoise()
{
echo "GREYNOISE"
curl -s -XPOST -d 'ip='${args[0]} 'http://api.greynoise.io:8888/v1/query/ip' | jq '.'
}
check_ipinfo()
{
echo "IPINFO"
curl -s ipinfo.io/${args[0]} | jq '.'
}
check_shodan()
{
echo "SHODAN"
#curl -s https://api.shodan.io/shodan/host/${args[0]}?key=APIKEYHERE | jq '.'
shodan host ${args[0]}
}
check_alienvault()
{
echo "ALIENVAULT"
curl -s https://otx.alienvault.com:443/api/v1/indicators/IPv4/${args[0]}/url_list -H "X-OTX-API-KEY:APIKEYHERE" | jq
curl -s https://otx.alienvault.com:443/api/v1/indicators/IPv4/${args[0]}/reputation -H "X-OTX-API-KEY:APIKEYHERE" | jq
}
check_greynoise
check_ipinfo
check_shodan
check_alienvault
@sneakymonk3y
Copy link
Author

chmod +x and supply IP as an argument to query

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment