Skip to content

Instantly share code, notes, and snippets.

@Red5d
Created January 3, 2014 05:21
Show Gist options
  • Save Red5d/8233212 to your computer and use it in GitHub Desktop.
Save Red5d/8233212 to your computer and use it in GitHub Desktop.
Use this to look up the Country, State, City, ISP, and Hostname of an IP address (given as parameter) from infosniper.net. Usage: ./iplookup <ip address>
#! /bin/bash
info=$(curl -s http://www.infosniper.net/?ip_address=$1 | grep content-td2 | cut -d'>' -f2 | cut -d'<' -f1 | sed 's/&nbsp;//g')
echo -n "Country: "
echo "$info" | sed -n '10p'
echo -n "State: "
echo "$info" | sed -n '6p'
echo -n "City: "
echo "$info" | sed -n '2p'
echo -n "Provider: "
echo "$info" | sed -n '5p'
echo -n "Hostname: "
echo "$info" | sed -n '9p'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment