Hey everyone,
I have a file that has IP addresses and usernames like so:
1.2.3.4
usera@net.com
5.6.7.8
userb@other.com
7.5.6.3
user2@some.com
there are about 26000 lines.
What i need to do is use the whois server whois.cymru.com and get the ASNumber and Country code for each IP address, and then have a result like this
1.2.3.4
usera@net.com 6799 GR
5.6.7.8
userb@other.com 2056 EU
7.5.6.3
user2@some.com 32557 UK
A normal whois on that server would be like:
whois -h whois.cymru.com " -c -o -f 75.126.162.205"
and the result : 36351 | 75.126.162.205 | US
The server itself provides bulk queries with netcat but for some reason, the results are more than the IPs provided.
I can extract the IP addresses with a "cut -f 1 file". Then I'm stuck.
PLS HELP