8/26/2023 0 Comments Arin ip lookup![]() IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. whois.py stats netblocks License: The MIT License (MIT) Copyright (c) 2014 Mark Litwintschik Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. sleep_min= Least number of seconds to sleep for -sleep_max= Most number of seconds to sleep for -threads= Number of threads Examples. whois.py (-h | -help) Options: -h, -help Show this screen and exit. #!/usr/bin/env python # -*- coding: utf-8 -*- """ IPv4 Whois data collection and analysis tool Usage. But before I query each ip address I check to see if it's defined and if it is, get back the next undefined address: Network ( network_cidr ): return get_next_ip ( get_netrange_end ( network_cidr )) return ip ![]() pack ( '!L', ip2long ( ip_address ) + 1 )) except Exception, error : print 'Unable to get next IP for %s ' % ip_address raise error def get_next_undefined_address ( ip ): """ Get the next non-private IPv4 address if the address sent is private :param str ip: IPv4 address :return: ipv4 address of net non-private address :rtype: str > get_next_undefined_address('0.0.0.0') '1.0.0.0' > get_next_undefined_address('24.24.24.24') '24.24.24.24' > get_next_undefined_address('127.0.0.1') '128.0.0.0' > get_next_undefined_address('255.255.255.256') is None True """ try : # Should weed out many invalid IP addresses ipcalc. 'Must be an IPv4 address in str representation' if ip_address = '255.255.255.255' : return None try : return socket. recv ( 8196 ) if not data : break page = page + data s. send ( "%s \n\n" % domainname ) page = "" while 1 : data = s. error, ( ecode, reason ) : print ecode, reason time. ![]() ![]() close ( ) raise TimedOut, "on connect " s. select (, ,, 30 ) if len ( ret ) = 0 and len ( ret ) = 0 : s. error, ( ecode, reason ) : if ecode in ( 115, 150 ) : pass else : raise socket. connect ( ( whoisserver, 43 ) ) except socket. ![]() write ( page ) return page def _whois ( domainname, whoisserver ) : s = None # try until we are connected read ( ) page = _whois ( domainname, whoisserver ) if cache : open ( fn, "w" ). Import os, sys, string, time, getopt, socket, select, re NoSuchDomain = "NoSuchDomain" def whois ( domainname, whoisserver = None, cache = 0 ) : if whoisserver is None : whoisserver = "" if cache : fn = "%s.dom" % domainname if os. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |