Last active
September 14, 2020 00:04
-
-
Save illuzian/ebc32f154d96476cf623a6bf0c301211 to your computer and use it in GitHub Desktop.
One liner to perform multiple whois or whois and ptr/reverse lookups against multiple targets froma file.
This file contains 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
# One liner. The input file should contain one entry per line. | |
# `grep -i -E '(OrgName|Country)'` can be removed to show all of the whois output or modified to select preferred items. | |
cat lookupips.txt | while read ip; do echo $ip; whois -H $ip | grep -i -E '(OrgName|Country)'; done | |
# Same but includes a ptr lookup - change 1.1.1.1 to whichever server you want to use or remove to use your local server. | |
cat lookupips.txt | while read ip; do echo $ip; nslookup $ip 1.1.1.1 | grep -o -E 'name = .*$'; whois -H $ip | grep -i -E '(OrgName|Country)'; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment