News for hackers. Stuff that matters.
Re:Scans of North Korean IP Space by yourad_io on Saturday December 20, 2014 @02:59PM (#8777724)
> Where is he getting the data like: "inetnum: 175.45.176.0 - 175.45.179.255 ..."?

You're missing `whois`[1]. The wikipedia page is very informative.

If you give it an IP, it will give you "ownership" status of that particular IP, and then its containing netblocks ("outwards").

Example: (my favourite IP)

    $ whois 5.9.6.9
    % Information related to '5.9.6.0 - 5.9.6.31'

    inetnum:        5.9.6.0 - 5.9.6.31
    netname:        HETZNER-RZ16
    descr:          Hetzner Online AG
    descr:          Datacenter 16
    country:        DE

    --8<--

    % Information related to '5.9.0.0/16AS24940'

    route:          5.9.0.0/16
    descr:          HETZNER-RZ-FKS-BLK5
    origin:         AS24940
    mnt-by:         HOS-GUN
    source:         RIPE # Filtered
It gives you more things like contact information, abuse contact details, etc.

With a domain, it looks up the domain registration information.

If you ever script around whois, be prepared for loads of surprises, such as:

* Structure & format variations per provider (can be different on a TLD level)

* Some TLDs may not provide that information in a whois format at all:

    $ whois test.gr
    This TLD has no whois server, but you can access the whois database at
    https://grweb.ics.forth.gr/whois_en.jsp
[1] http://en.wikipedia.org/wiki/Whois
Re:Scans of North Korean IP Space by chubot on Saturday December 20, 2014 @03:14PM (#8777770)
OK thanks... I've used whois before, but yeah the output has been a bit confusing to me. I think I usually use it with a host name, and using it with an IP gives different info.

I am interested in how the databases that 'whois' queries are populated... the Wikipedia page looks like it will have some good pointers.

Re:Scans of North Korean IP Space by yourad_io on Saturday December 20, 2014 @03:31PM (#8777822)
You may also be interested to know that this database is open[1]:

> We produce daily snapshots which are available to the public. You can find these files at our FTP site at: ftp://ftp.ripe.net/ripe/dbase/ripe.db.gz

> or split by object type at: ftp://ftp.ripe.net/ripe/dbase/split

> These daily snapshots exclude the object types: person, role, organisation and mntner. For data protection reasons, personal data is not available in bulk format. [1]

To avoid confusion, that isn't just Europe (whose Regional Internet Register is RIPE NCC) but contains other continents/RIR data.

[1] https://www.ripe.net/data-tools/db/faq/faq-db/can-i-download...

Re:Scans of North Korean IP Space by justin_ on Saturday December 20, 2014 @03:40PM (#8777855)
> I am interested in how the databases that 'whois' queries are populated

As rid mentioned in his comment, this information comes from RIRs, who assign IP ranges to companies and other groups that request them. The WHOIS database is simply updated when an IP prefix is created or updated. When you make a WHOIS query, the RIR server is automatically contacted and the server simply returns a plaintext reply containing all the relevant information.

For example, ARIN (the North American registry) has a whois server for looking up data on IP addresses set up here: http://whois.arin.net