OS/Kali Linux kali linux(feat.python) IP SCAN
  • 728x90
    반응형






    Kail Linux IP SCAN

    feat.python



    IP SCAN




    python pyping package 다운로드 명령어


    root@kali:~# pip install netaddr pyping 


    IP SCAN Source :


    import netaddr
    import pyping
    import threading

    iplist = '192.168.0.0/24'
    threadLock = threading.Lock()
    threads = []

    print 'Start Scan'
    def IPScan(ip):
    try:
    if not pyping.ping(str(ip)).ret_code:
    threadLock.acquire()
    print 'Alive Host : ' + str(ip)
    threadLock.release()
    except:
    pass

    for ip in netaddr.IPNetwork(iplist):
    ip = str(ip)
    th = threading.Thread(target=IPScan, args=(ip,))
    th.start()
    threads.append(th)

    for t in threads:
    t.join()

    print 'End Scan.'


    실행 결과 :



    Start Scan

    Alive Host : 192.168.0.1

    Alive Host : 192.168.0.3

    Alive Host : 192.168.0.2

    Alive Host : 192.168.0.0

    Alive Host : 192.168.0.4

    Alive Host : 192.168.0.5

    Alive Host : 192.168.0.7

    Alive Host : 192.168.0.10

    Alive Host : 192.168.0.6

    Alive Host : 192.168.0.8

    Alive Host : 192.168.0.11

    Alive Host : 192.168.0.12

    ....

    End Scan.



    1~255 IP Address에 대해 PING Test를 진행하고, PING Test 결과가 OK인 경우 해당 IP를 쓰레드에서 출력.

    728x90
    반응형

    'OS > Kali Linux' 카테고리의 다른 글

    Custom Payload feat shellter  (0) 2018.04.10
    Veil-evasion 설치 및 사용  (0) 2018.04.10
    kali Linux 명령어 및 기초  (0) 2018.04.04
    Kali Linux 한글 설정  (0) 2018.04.04
    VirtualBox 에 Kali Linux 설치  (0) 2018.04.04
상단으로