|
Title: IP conversion tool Post by: alucian on November 30, 2010, 10:54:00 AM Hello guys,
I need a tool that will transform and IP range to a list of IP's, that I will be able to put in an txt file. As an example I have this range: 10.15.1-30,26,37,44-50.1-20 and I need a text file that will contain all the IPs in this range. I will use this file in Nessus to scan large parts of my network. I cannot put this range in Nessus because it doesn't recognize it. I can put it in Nmap, and I tried to do a ping scan against a range like this, but nmap has crashed. ( Nmap scan report for 172.15.30.1 Host is up (0.0013s latency). Nmap scan report for 172.15.30.2 Host is up (0.0014s latency). Nmap scan report for 172.15.30.3 Host is up (0.00037s latency). pcap_open_live(eth3, 100, 0, 200) FAILED. Reported error: eth3: That device is not up. Will wait 5 seconds then retry. pcap_open_live(eth3, 100, 0, 200) FAILED. Reported error: eth3: That device is not up. Will wait 25 seconds then retry. Call to pcap_open_live(eth3, 100, 0, 200) failed three times. Reported error: eth3: That device is not up There are several possible reasons for this, depending on your operating system: LINUX: If you are getting Socket type not supported, try modprobe af_packet or recompile your kernel with SOCK_PACKET enabled. *BSD: If you are getting device not configured, you need to recompile your kernel with Berkeley Packet Filter support. If you are getting No such file or directory, try creating the device (eg cd /dev; MAKEDEV <device>; or use mknod). *WINDOWS: Nmap only supports ethernet interfaces on Windows for most operations because Microsoft disabled raw sockets as of Windows XP SP2. Depending on the reason for this error, it is possible that the --unprivileged command-line argument will help. SOLARIS: If you are trying to scan localhost or the address of an interface and are getting '/dev/lo0: No such file or directory' or 'lo0: No DLPI device found', complain to Sun. I don't think Solaris can support advanced localhost scans. You can probably use "-PN -sT localhost" though. QUITTING! ) Thanks! Title: Re: IP conversion tool Post by: hayabusa on November 30, 2010, 11:07:44 AM Can't just write a bash script or batch file to do it?
Title: Re: IP conversion tool Post by: ziggy_567 on November 30, 2010, 11:14:08 AM You can use a nested for loop to accomplish this.
Or, since you're really only talking about a few iterations a single for loop can be used and just edit it for each third octet needed. Its not elegant, but it will do the trick... Something along the lines of: #!/bin/bash for i in `seq 1 20` do echo 10.15.1.$i >> iplist done Title: Re: IP conversion tool Post by: hayabusa on November 30, 2010, 11:33:10 AM Assuming I read your first post correctly, for what you want, this'll do it completely:
#!/bin/bash for i in {1..30} 36 37 {44..50} do for p in {1..20} do echo 10.15.$i.$p >>ips.txt done done Title: Re: IP conversion tool Post by: alucian on November 30, 2010, 02:13:15 PM Thank you!
I will use for the moment that example, and I wil try to make it as simple as possible for some coleagues of mine that are not technical at all. Our boss likes that everybody be able to use the tools, so I have to keep it as simple as possible. Title: Re: IP conversion tool Post by: hayabusa on November 30, 2010, 02:38:34 PM Glad it helps. I suppose, you could have it prompt for ranges, etc, with some tweaking, but I figured I'd give you the basics, to accomplish what you asked for, and you can build on it, from there.
Good luck with satisfying your boss(es). ;)
Powered by SMF 1.1.18 |
SMF © 2013, Simple Machines
Joomla Bridge by JoomlaHacks.com |