menu arrow_back 湛蓝安全空间 |狂野湛蓝,暴躁每天 chevron_right ... chevron_right hackUtils-master chevron_right GetJapIP.py
  • home 首页
  • brightness_4 暗黑模式
  • cloud
    xLIYhHS7e34ez7Ma
    cloud
    湛蓝安全
    code
    Github
    GetJapIP.py
    605 B / 2021-07-04 19:32:24
        import socket
    import struct
    import sys 
    import os
    #python GetJapIP.py 125.255.0.0 125.255.255.255 >> JapUrls.txt
    start_ip = sys.argv[1]
    end_ip = sys.argv[2]
    
    def Ip2Int(ip):
    	return socket.ntohl(struct.unpack("I",socket.inet_aton(str(ip)))[0])
    Intstart_ip = Ip2Int(start_ip)
    Intend_ip = Ip2Int(end_ip)
    
    '''
    print "start_ip = "+str(Intstart_ip)
    print "end_ip = "+str(Intend_ip)
    print "There are "+str(Intend_ip - Intstart_ip)+" ips!"
    '''
    for i in range(Intstart_ip,Intend_ip):
    	IP = socket.inet_ntoa(struct.pack('I',socket.htonl(i)))
    	print str(IP)
    	
    print "There are "+str(Intend_ip - Intstart_ip)+" ips!"
    
    links
    file_download