You are not logged in.
Pages: 1
I wrote a python script that does exactly what you want!
#!/usr/bin/python
# Quick and dirty script to output hosts ip via nmap by ikex <ikex@orioncode.org>
# change this to change you output! :)
nohost = "(No Hostname)"
output = "%s %s Appears to be up!" # IP, Hostname
nip= "10.1.1.0/24"
import os, socket, types
fp = os.popen("nmap -sP %s" % nip)
dat=fp.read()
dat=dat.split('\n')
for line in dat:
try: dummy = int(line[5:6])
except (ValueError): continue
if line[:4] == "Host":
ip=line.split(' ')[1]
try:
host="("+socket.gethostbyaddr(ip)[0]+")"
except:
host=nohost
print output % (ip, host)And outputs something like
ikex@ikebox ~
$ scanup.py
10.1.1.2 (mpeters-PC) Appears to be up!
10.1.1.3 (No Hostname) Appears to be up!
10.1.1.4 (tnew-PC) Appears to be up!
10.1.1.6 (No Hostname) Appears to be up!
10.1.1.7 (ikebox) Appears to be up!(I only tested this on my desktop(via cygwin) but i can't see why it wouldn't work under #!)
Hey everyone!
After trying more distro's then i can count(including a 4 day Gentoo compile) for my eee I've finally found the one.
I absolutely love #! the speed the look the everything ^-^
Pages: 1
Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.