Image
 
linkedin_logo.png rss_logo.jpg
twitter_logo.png youtube_logo.jpg
Latest Additions
 
EH-Net Login
Welcome Guest.






Lost Password?
No account yet? Register
Who's Online
We have 35 guests and 1 member online
 
Advertisement

You are here: Home arrow Resourcesarrow Toolsarrow IP conversion tool
EH-Net
May 21, 2013, 02:37:06 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Go back to The Ethical Hacker Network Online Magazine Home Page
 
   Home   Help Calendar Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: IP conversion tool  (Read 5127 times)
0 Members and 1 Guest are viewing this topic.
alucian
Full Member
***
Offline Offline

Posts: 225



View Profile
« 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!
Logged

CISSP ISSAP, CISM/A, GWAPT, GCIH, eCPPT, OSWP
hayabusa
Hero Member
*****
Offline Offline

Posts: 1632



View Profile
« Reply #1 on: November 30, 2010, 11:07:44 AM »

Can't just write a bash script or batch file to do it?
Logged

~ hayabusa ~ 

"All men can see these tactics whereby I conquer, but what none can see is the strategy out of which victory is evolved." - Sun Tzu, 'The Art of War'


OSCE, OSCP , GPEN, C|EH
ziggy_567
Sr. Member
****
Offline Offline

Posts: 361


View Profile
« Reply #2 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
Logged

--
Ziggy


eCPPT - GSEC - GCIH - GCUX - RHCE - SCSecA - Security+ - Network+
hayabusa
Hero Member
*****
Offline Offline

Posts: 1632



View Profile
« Reply #3 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
« Last Edit: November 30, 2010, 11:35:18 AM by hayabusa » Logged

~ hayabusa ~ 

"All men can see these tactics whereby I conquer, but what none can see is the strategy out of which victory is evolved." - Sun Tzu, 'The Art of War'


OSCE, OSCP , GPEN, C|EH
alucian
Full Member
***
Offline Offline

Posts: 225



View Profile
« Reply #4 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.
Logged

CISSP ISSAP, CISM/A, GWAPT, GCIH, eCPPT, OSWP
hayabusa
Hero Member
*****
Offline Offline

Posts: 1632



View Profile
« Reply #5 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).   Wink
Logged

~ hayabusa ~ 

"All men can see these tactics whereby I conquer, but what none can see is the strategy out of which victory is evolved." - Sun Tzu, 'The Art of War'


OSCE, OSCP , GPEN, C|EH
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines
Joomla Bridge by JoomlaHacks.com
Valid XHTML 1.0! Valid CSS!
Page created in 0.115 seconds with 22 queries.
 
Exclusive Deal

sansfire13_245x90_cw90.jpg
SANSFIRE 2013
June 15 - 22

5% Off w/ Code: EHN_5

SANS Deals 4 EH-Netters
5% OFF Any SANS Course in Any Format!
Coupon Code: EHN_5 Including SANS Rocky Mountain 2013 & SANS Boston 2013
Polls
Compared to this year, 2013 will be:
 
Recent Forum Topics
EH-Net News Feeds
Latest Additions
 
         
Advertisement

© 2013 The Ethical Hacker Network
Joomla! is Free Software released under the GNU/GPL License.