Ein paar scripte gefunden im Netz.
#!/bin/bash plainip="$(host $1 | grep address|grep -v IPv6| awk 'NR == 1{print $4}')" #echo $plainip ip=$plainip reverse_ip=$(echo $ip | awk -F "." '{print $4"."$3"."$2"."$1}') asn_info=$(dig +short $reverse_ip.origin.asn.cymru.com TXT) peer_info=$(dig +short $reverse_ip.peer.asn.cymru.com TXT) number=$(echo $asn_info | cut -d'|' -f 1 | cut -d'"' -f 2 | cut -d' ' -f 1) asn="as$number" asn_report=$(dig +short $asn.asn.cymru.com TXT) subnet=$(echo $asn_info | cut -d'|' -f 2) country=$(echo $asn_info | cut -d'|' -f 3) issuer=$(echo $asn_info | cut -d'|' -f 4) peers=$(echo $peer_info | cut -d'|' -f 1 | cut -d'"' -f 2) registry_date=$(echo $asn_report | cut -d'|' -f 4) registrant=$(echo $asn_report | cut -d'|' -f 5 | cut -d'"' -f 1) echo -e " Query:\t $ip" echo -e " Subnet:\t $subnet" echo -e " Registrant:\t $registrant" echo -e " AS Number:\t $asn" echo -e " Country:\t $country" echo -e " Issuer:\t $issuer" echo -e "Registry Date:\t $registry_date" echo -e " Peer ASNs:\t $peers" |
$ /sbin/host2ip2asn heise.de | Link | |