Coloreado en 0.000 segundos, usando GeSHi 1.0.8.4
Using perl Syntax Highlighting
- #!usr/bin/perl
- #https://developer.shodan.io/api
- #http://www.eekboek.nl/dl/ppms/Crypt-SSLeay.ppd
- #http://www.bribes.org/perl/ppm/JSON.ppd
- use LWP::UserAgent;
- my $nave = LWP::UserAgent->new(ssl_opts => { verify_hostname => 1 });
- $nave->agent(
- "Mozilla/5.0 (Windows; U; Windows NT 5.1; nl; rv:1.8.1.12) Gecko/20080201Firefox/2.0.0.12"
- );
- $nave->timeout(5);
- my $api_key = "test";
- my $code = toma("https://api.shodan.io/shodan/host/5.135.178.142?key=".$api_key);
- print $code;
- sub toma {
- return $nave->get( $_[0] )->content;
- }
Coloreado en 0.005 segundos, usando GeSHi 1.0.8.4
El gran tema es cómo leer esto con json porque no encuentro información sobre cómo leer los datos que me devuelve que son algo así:
Using javascript Syntax Highlighting
- {
- "region_name": null,
- "ip": "41.21.249.170",
- "area_code": null,
- "country_name": "South Africa", "hostnames": [],
- "postal_code": null,
- "dma_code": null,
- "country_code": "ZA",
- "data": [
- {
- "product": "Siemens HiPath 3000 telnetd",
- "os": null,
- "timestamp": "2014-01-12T18:25:41.370550",
- "isp": "Vodacom",
- "asn": "AS36994",
- "banner": "\r************************\n\r* HiPath 3000 Telnet *\n\r* ------------------ *\n\r* *\n\r* Adjust the Telnet *\n\r* window to the *\n\r* visible frame *\n\r* *\n\r************************\n\r",
- "hostnames": [],
- "devicetype": "firewall",
- "location": {
- "city": null,
- "region_name": null,
- "area_code": null,
- "longitude": 24.0,
- "country_code3": "ZAF",
- "country_name": "South Africa",
- "postal_code": null,
- "dma_code": null,
- "country_code": "ZA",
- "latitude": -29.0
- },
- "ip": "41.21.249.170",
- "domains": [],
- "org": "Vodacom",
- "port": 23,
- "opts": {}
- },
- {
- "os": null,
- "timestamp": "2014-01-01T01:28:55.903352",
- "isp": "Vodacom",
- "asn": "AS36994",
- "banner": "SNMP agent for HiPath 3000/5000 V5.x",
- "hostnames": [],
- "location": {
- "city": null,
- "region_name": null,
- "area_code": null,
- "longitude": 24.0,
- "country_code3": "ZAF",
- "country_name": "South Africa",
- "postal_code": null,
- "dma_code": null,
- "country_code": "ZA",
- "latitude": -29.0
- },
- "ip": "41.21.249.170",
- "domains": [],
- "org": "Vodacom",
- "port": 161,
- "opts": {}
- }
- ],
- "city": null,
- "longitude": 24.0,
- "country_code3": "ZAF",
- "latitude": -29.0,
- "os": null,
- "ports": [23, 161]
- }
Coloreado en 0.003 segundos, usando GeSHi 1.0.8.4
¿ Alguien me puede ayudar ?