LINUX:Mmdblookup
Aller à la navigation
Aller à la recherche
→ retour au menu de la Géolocalisation IP
But
La commande "mmdblookup" permet de retrouver les informations liées à une adresse IP. En base, elle produit une sortie de type JSON mais l'ajout de paramètres permet d'affiner la recherche. Nous allons donner quelques exemples de sorties. Le contenu est suffisamment explicite pour s'abstenir de commentaire.
Table GeoLite2-Country
La commande:
/usr/bin/mmdblookup --ip 80.200.32.15 --file /usr/share/GeoIP/GeoLite2-Country.mmdb
donne:
{ "continent": { "code": "EU" <utf8_string> "geoname_id": 6255148 <uint32> "names": { "de": "Europa" <utf8_string> "en": "Europe" <utf8_string> "es": "Europa" <utf8_string> "fr": "Europe" <utf8_string> "ja": "ヨーロッパ" <utf8_string> "pt-BR": "Europa" <utf8_string> "ru": "Европа" <utf8_string> "zh-CN": "欧洲" <utf8_string> } } "country": { "geoname_id": 2802361 <uint32> "is_in_european_union": true <boolean> "iso_code": "BE" <utf8_string> "names": { "de": "Belgien" <utf8_string> "en": "Belgium" <utf8_string> "es": "Bélgica" <utf8_string> "fr": "Belgique" <utf8_string> "ja": "ベルギー王国" <utf8_string> "pt-BR": "Bélgica" <utf8_string> "ru": "Бельгия" <utf8_string> "zh-CN": "比利时" <utf8_string> } } "registered_country": { "geoname_id": 2802361 <uint32> "is_in_european_union": true <boolean> "iso_code": "BE" <utf8_string> "names": { "de": "Belgien" <utf8_string> "en": "Belgium" <utf8_string> "es": "Bélgica" <utf8_string> "fr": "Belgique" <utf8_string> "ja": "ベルギー王国" <utf8_string> "pt-BR": "Bélgica" <utf8_string> "ru": "Бельгия" <utf8_string> "zh-CN": "比利时" <utf8_string> } } }
Table GeoLite2-City
La commande:
/usr/bin/mmdblookup --ip 80.200.32.15 --file /usr/share/GeoIP/GeoLite2-City.mmdb
donne:
{ "city": { "geoname_id": 7648247 <uint32> "names": { "en": "Rebecq" <utf8_string> "ru": "Ребек" <utf8_string> "zh-CN": "勒贝克" <utf8_string> } } "continent": { "code": "EU" <utf8_string> "geoname_id": 6255148 <uint32> "names": { "de": "Europa" <utf8_string> "en": "Europe" <utf8_string> "es": "Europa" <utf8_string> "fr": "Europe" <utf8_string> "ja": "ヨーロッパ" <utf8_string> "pt-BR": "Europa" <utf8_string> "ru": "Европа" <utf8_string> "zh-CN": "欧洲" <utf8_string> } } "country": { "geoname_id": 2802361 <uint32> "is_in_european_union": true <boolean> "iso_code": "BE" <utf8_string> "names": { "de": "Belgien" <utf8_string> "en": "Belgium" <utf8_string> "es": "Bélgica" <utf8_string> "fr": "Belgique" <utf8_string> "ja": "ベルギー王国" <utf8_string> "pt-BR": "Bélgica" <utf8_string> "ru": "Бельгия" <utf8_string> "zh-CN": "比利时" <utf8_string> } } "location": { "accuracy_radius": 20 <uint16> "latitude": 50.665300 <double> "longitude": 4.127300 <double> "time_zone": "Europe/Brussels" <utf8_string> } "postal": { "code": "1430" <utf8_string> } "registered_country": { "geoname_id": 2802361 <uint32> "is_in_european_union": true <boolean> "iso_code": "BE" <utf8_string> "names": { "de": "Belgien" <utf8_string> "en": "Belgium" <utf8_string> "es": "Bélgica" <utf8_string> "fr": "Belgique" <utf8_string> "ja": "ベルギー王国" <utf8_string> "pt-BR": "Bélgica" <utf8_string> "ru": "Бельгия" <utf8_string> "zh-CN": "比利时" <utf8_string> } } "subdivisions": [ { "geoname_id": 3337387 <uint32> "iso_code": "WAL" <utf8_string> "names": { "de": "Wallonien" <utf8_string> "en": "Wallonia" <utf8_string> "es": "Valonia" <utf8_string> "fr": "Wallonie" <utf8_string> "pt-BR": "Valônia" <utf8_string> } } { "geoname_id": 3333251 <uint32> "iso_code": "WBR" <utf8_string> "names": { "de": "Provinz Wallonisch-Brabant" <utf8_string> "en": "Walloon Brabant Province" <utf8_string> "es": "Brabant Wallonie" <utf8_string> "fr": "Brabant Wallon" <utf8_string> "pt-BR": "Brabante Valão" <utf8_string> } } ] }
Table GeoLite2-ASN
La commande:
/usr/bin/mmdblookup --ip 80.200.32.15 --file /usr/share/GeoIP/GeoLite2-ASN.mmdb
donne l'information sur la société détentrice:
{ "autonomous_system_number": 5432 <uint32> "autonomous_system_organization": "Proximus NV" <utf8_string> }
→ retour au menu de la Géolocalisation IP