LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 07-06-2009, 04:43 AM   #1
tirengarfio
Member
 
Registered: Nov 2006
Posts: 45

Rep: Reputation: 15
A script to check ports of a long range of IPs


Hi,

i want to create a script that will check the ports of a range of IPs.

I could write all the IPs, but i have thought there is maybe a way to write the rage instead of all the IPs.

Is that true?

Do you advice any language to write this kind of scripts?

ăiao
 
Old 07-06-2009, 04:58 AM   #2
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Linux Mint
Posts: 8,496

Rep: Reputation: 883Reputation: 883Reputation: 883Reputation: 883Reputation: 883Reputation: 883Reputation: 883
Hi,

You could use nmap
Code:
nmap -p 80,22 10.0.0.0/24
 
Old 07-06-2009, 05:11 AM   #3
tirengarfio
Member
 
Registered: Nov 2006
Posts: 45

Original Poster
Rep: Reputation: 15
Thanks!,

the next question im wondering is:

If i get this result,

Starting Nmap 4.76 ( http://nmap.org ) at 2009-07-06 11:57 CEST
Interesting ports on localhost (127.0.0.1):
PORT STATE SERVICE
80/tcp closed http


then, I would like to write in a log file:

127.0.0.1: 80 CLOSED

How would you do that?

Ciao
 
Old 07-06-2009, 10:48 AM   #4
nowonmai
Member
 
Registered: Jun 2003
Posts: 481

Rep: Reputation: 47
nmap A.B.C.D/X -oN <logfile>

or

nmap A.B.C.D/X -oG <logfile>
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] What are short range link and long range links in routing? mq15 Linux - Networking 6 06-26-2009 11:16 PM
i want to block a range of ips using iptables... Vasili Linux - Security 18 09-19-2006 06:31 AM
Squid: acl'ing range of IPs ivanatora Linux - Software 4 05-05-2005 02:43 AM
how to define a specific range of IPs and/or multiple IPs in an iptables rule?... TheHellsMaster Linux - Security 9 09-20-2004 10:06 AM
Using IPCHAINS to allow only a range of IPs ganninu Linux - Security 1 01-13-2004 11:18 AM


All times are GMT -5. The time now is 09:20 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration