Re: Collecting IP range

2006-01-31 Thread Heiko Wundram
yawgmoth7 wrote: > Well, since range() won't take a normal IP(Such as 127.0.0.1). and, > you can't take it as 127001(Since socket.connect() won't take that). > What would you suggest as a better way to approach this? Use a recipe for that. Have a look at: http://aspn.activestate.com/ASPN/Cookbook

Re: Collecting IP range

2006-01-30 Thread David Murmann
yawgmoth7 schrieb: > Well, I seem to have a bit of a problem: > >>>import IPy > >>>ip =IP('127.0.0.1/30') > Traceback (Most recent call last): > File "". line `, in ? > NameError: name 'IP' is not defined > >>> to make this work with "import IPy" you need to use "ip = IPy.IP('127.0.0.1/30')". > I

Re: Collecting IP range

2006-01-30 Thread David Murmann
yawgmoth7 schrieb: > Hello, I'm sure that this has been discussed before, but I have a > question. I have written a few port scanners, banner grabbers in the > past and have never found a good way to get a range of IP's. > Obviously, in my opinion the best and simplest way to do somethign > like an

Re: Collecting IP range

2006-01-30 Thread Emile van Sebille
"yawgmoth7" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > for ips in range(startip,endip): > > Here's one way: def iterIPs(startip,endip): import socket, struct sip = struct.unpack('>L',socket.inet_aton(startip))[0] eip = struct.unpack('>L',socket.inet_aton(endi

Collecting IP range

2006-01-30 Thread yawgmoth7
Hello, I'm sure that this has been discussed before, but I have a question. I have written a few port scanners, banner grabbers in the past and have never found a good way to get a range of IP's. Obviously, in my opinion the best and simplest way to do somethign like and simple port scanner is to d