Page 2 of 2 FirstFirst 12
Results 11 to 15 of 15

Thread: Figure out live hosts on a network

  1. #11
    Senior Member
    Join Date
    Jan 2003
    Posts
    3,915
    I'd have to say that the easiest way is most likely nmap -sP.

    If you are using the 192.168.0.0 Network with a 255.255.255.0 subnet mask then you'd just have to type in nmap -sP 192.168.0.0/24 (then to write to a file you simple need to append > file.name to the end)

    Your other option would be (assuming this is linux) to create a lil script to do it

    Code:
    #!/bin/bash
    i=0
    rm -rf results.txt
    while [ $i -le 255 ]; do
         ping -b -c 1 192.168.0.$1
         i=`expr $i + 1`
    done

  2. #12
    Senior Member
    Join Date
    Nov 2001
    Posts
    4,785
    if you want to use ping here ya go

    pinger.bat
    -----------------------
    for /L %%X in (1,1,254) do ping -n 1 %1.%%X |find /I "reply" >>c:\reply.txt
    for /F "tokens=3" %%Y in (c:\reply.txt) do fscan %%Y >c:\scanned.txt
    notepad c:\scanned.txt
    del reply.txt
    -----------------------

    you could use this on any class network by entering the first three octets without the third "."

    pinger 192.168.1
    pinger 10.0.0
    pinger 67.88.22

    but a scanner like superscan can ping them all and scan all the ports you want only on machines that return a response much faster than a bat can. you can then save the scan to a file by pushing a button
    Bukhari:V3B48N826 “The Prophet said, ‘Isn’t the witness of a woman equal to half of that of a man?’ The women said, ‘Yes.’ He said, ‘This is because of the deficiency of a woman’s mind.’”

  3. #13
    Junior Member
    Join Date
    Feb 2004
    Posts
    10

    Superscan

    Yeah Superscan is really cool, But I'm trying to build the "Lazy Mans Pen/audit CD" for myself!!!

    I think the answer would to do an nmap scan via a script, but I'm trying to get the logic down to determine how it can figure out what IP's are live.

    Thinking something like

    nmap -sP 192.168.0.0/24 > IP.txt

    as HTRegz suggested, however that will only find me the live hosts within the 255.255.255.0 network. If there was some way to ping the subnet mask to determine if it had any live hosts, and if not skip it, that would be exactly what I'm looking for.

    Something like: (sorry I don't know any programming)
    Ping the subnet,
    If no Live hosts next subnet
    If live hosts are present nmap -sP IP ADDRESS > textfile.txt

    Is something like that possible?

  4. #14
    Senior Member
    Join Date
    Nov 2003
    Posts
    247
    Something like that would indeed be very possible, either through batch-file programming or through shell scripting.

    Batch file creation: http://antionline.com/showthread.php?s=&threadid=252001
    Shell programming: http://antionline.com/showthread.php?s=&threadid=252818 (Not as tutorialish, but it should still prove helpful.)
    www.ADigitalPimp.com
    There is a ghost in the machine, and he is my friend.

  5. #15
    Senior Member
    Join Date
    Nov 2001
    Posts
    4,785
    change "fscan" to nmap w/ the args you want and call pinger.bat with start.bat:

    start.bat
    -----------------
    for /L %%W in (0,1,255) do pinger 192.168.%%W
    -----------------
    Bukhari:V3B48N826 “The Prophet said, ‘Isn’t the witness of a woman equal to half of that of a man?’ The women said, ‘Yes.’ He said, ‘This is because of the deficiency of a woman’s mind.’”

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •