Package: pnu-wis
InstallationDepending on if you want only this tool, the full set of PNU tools, or PNU plus a selection of additional third-parties tools, use one of these commands:pip installpnu-wispip installPNUpip installpytnixWIS(1)NAMEwis - Bulk WHOIS SearchSYNOPSISwis[-1|--first]
[-c|--case]
[-d|--dirname DIR]
[-e|--exclude FILE]
[-f|--filename FILE]
[-i|--inet4]
[-I|--inet6]
[-r|--range]
[-s|--summary]
[-S|--summaryonly]
[--debug]
[--help|-?]
[--version]
[--]
KEYWORD
[...]DESCRIPTIONThewisutility searches for keyword(s) within bulk WHOIS database(s).Beside saving multiple WHOIS queries, using pre-downloaded bulk WHOIS databases enables to do plain text searches on all the WHOIS records.You can either select one specific database (in plain text or gzipped format) using the-f|--filename FILEoption, or/and a directory containing all your databases using the-d|--dirname DIRoption.Use the-c|--caseoption to make your searches case sensitive.Use the-e|--exclude FILEoption to provide a one-excluded-case-insensitive-keyword-per-line file to filter out matching records.You'll then obtain a list of records matching at least one of your keywords, and not matching any of the excluded keywords.If you use the-1|--firstoption, you'll instead only obtain the first line of each matching record.If you use the-i|--inet4and/or-I|--inet6option(s), you'll instead obtain only matching inetnum or inet6num records reformatted as a pipe-separated-values of networks:starting IP address|ending IP Address|netname|descr|org|countryIf you add the-r|--rangeoption to the last ones, you'll instead obtain only matching inetnum or inet6num records reformatted as a pipe-separated-values of hosts:IP address|type|subnet|netname|descr|org|countryWhere type is either "Network" for the first address in a subnet, "Broadcast" for the last address in a subnet or "IP address" for the rest.If you use the-s|--summaryoption, you'll get a summary of the record types found (from the first line of each matching record, before the colon).If you use the-S|--summaryonlyoption you'll only get that.OPTIONSOptionsUse-1|--firstShow only the first line of each matching record-c|--caseMake searches case sensitive-d|--dirname DIRUse databases from the DIR directory name-e|--exclude FILEExclude words from the FILE file name-f|--filename FILEUse database from the FILE file name-i|--inet4Show only reformatted inetnum records-I|--inet6Show only reformatted inet6num records-r|--rangeShow expanded inet(6)num ranges-s|--summaryShow a summary of the type of matching records-S|--summaryonlyShow only a summary of the type of matching records--debugEnable debug mode--help|-?Print usage and a short help message and exit--versionPrint version and exit--Options processing terminatorENVIRONMENTThe WIS_DEBUG environment variable can also be set to any value to enable debug mode.FILESThewisutility uses bulk WHOIS databases downloaded from the mainRegional Internet Registries (RIR)andNational Internet Registries (NIR).The provided "fetch-db-WHOIS.sh" script can be used for doing this.You can also use bulk RR (Routing Registries) databases, that you can download with the provided "fetch-db-RR.sh" script.Be sure to read the databases respective terms of use before!EXIT STATUSThewisutility exits 0 on success, and >0 if an error occurs.EXAMPLESAssuming that you have installed the available bulk WHOIS databases (in gzipped format) in a directory named "db", and that you made a one-excluded-keyword-per-line file named "excluded.txt", use the following commands:to extract full WHOIS information about matching blocks:wis-ddb-eexcluded.txtkeyword1keyword2keyword3to extract only the first line of WHOIS information about matching blocks:wis-ddb-eexcluded.txt-1keyword1keyword2keyword3to extract an IPv4 network summary about matching blocks:wis-ddb-eexcluded.txt-ikeyword1keyword2keyword3to extract an IPv4 host summary about matching blocks:wis-ddb-eexcluded.txt-irkeyword1keyword2keyword3to analyze a database record types:wis-fdatabase_name.db.gz-SSEE ALSOwhois(1)STANDARDSThewisutility is not a standard UNIX command.This implementation tries to follow thePEP 8style guide forPythoncode.PORTABILITYTested OK under Windows.HISTORYThis implementation was made for thePNU project.Its first use case was to identify all my company's IP addresses ranges through the world, helping to secure our networks and identify shadow IT...The initial name of the command was "AS Search", but the resulting short form seemed problematic... So I went for awiser name :smiley:LICENSEIt is available under the3-clause BSD license.AUTHORSHubert TournierCAVEATOnly the AFRINIC, RIPE, APNIC, APNIC/JPNIC, APNIC/TWNIC and APNIC/KISA databases have usefuldomain,inetnum,inet6numandorganisationinformation.LACNIC does not provide usefulinetnumandinet6numinformation.ARIN, APNIC/IDNIC, APNIC/CNNIC, APNIC/VNNIC and APNIC/IRINN do not providedomain,inetnum,inet6numandorganisationinformation at all.However you can findrouteinformation from all of them, which can then be used with regular WHOIS queries.