Visit Our UNIX and Linux User Community


script for unassigned ports


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users script for unassigned ports
# 1  
Old 08-01-2009
script for unassigned ports

Hi Guys,

could you help me with this.

I need a script where if we enter the hostname and range of port numbers, the script must be able to give me the ports that were unassigned to any of the services installed.


Thanks,
Charan
# 2  
Old 08-02-2009
You need to define the problem more clearly.
# 3  
Old 08-02-2009
Hi Guys,


Our company uses IBM's testing servers. IBM has opened only a few ports for us but not all for the security reasons.(if we request a particular port IBM will open that port)

suppose, I enter the following command ( this is in windows)

1. telnet 192.168.1.10 12001
Connecting To 10.249.15.31...Could not open connection to the host, on port 8993 : Connect failed

In this case, it immediately says that it could not open connection to the host

2. telnet 192.168.1.10 43000
Connecting To 10.249.15.31...Could not open connection to the host, on port 8993 : Connect failed

the result is same but it takes more than 5 seconds to give the result

I couldn't get the same result in unix
it says connection refused immediately.


so, using this script, if we found that IBM has not opened a port for us to use, we request them to open that port.
# 4  
Old 08-02-2009
One word: nmap.
# 5  
Old 08-02-2009
could you please help me with the script
# 6  
Old 08-03-2009
Bumping up posts or double posting is not permitted in these forums.

Please read the rules, which you agreed to when you registered, if you have not already done so.

You may receive an infraction for this. If so, don't worry, just try to follow the rules more carefully. The infraction will expire in the near future

Thank You.

The UNIX and Linux Forums.

Previous Thread | Next Thread
Test Your Knowledge in Computers #430
Difficulty: Medium
Variables in JavaScript can be defined using either the var, let, static or const keywords.
True or False?

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script for enable ports error=13

Hi, I am triying to run this script in order to find the pid for each open port and when I run it in one server it give me an error and for another server is not showing the same error. Below I pasted the script and the result. script #!/usr/bin/ksh print "Port PID ... (0 Replies)
Discussion started by: fede_mont
0 Replies

2. Shell Programming and Scripting

Script to check numerous ports / servers (Solaris native)

Hi I'd like to check that a bunch of firewall rules have been applied and, therefore, want to write a script that basically does the following: telnet serverA port1 telnet serverA port2 telnet serverB port1 telnet serverB port2 I would just compile the list in excel and run it as a... (2 Replies)
Discussion started by: jibberish
2 Replies

3. Shell Programming and Scripting

Script to Monitor List of Ports

Hi, I'm in need of a script that can monitor a list of 12 ports.. If one of the ports isn't in listening mode then email me.. The list of ports are 26401 - 26412.. (6 Replies)
Discussion started by: eclipseagent
6 Replies

4. Shell Programming and Scripting

script to display occupied and non occupied ports in unix

I want to extend this script. This must also be able to show me that a port is already assigned to a service but not running now there must be three different messages port 8949 is open but not listening port 8959 is open port 8999 hasn't been assigned to any service. I know that... (1 Reply)
Discussion started by: charan314
1 Replies

5. UNIX for Dummies Questions & Answers

The command for Unassigned Space

Hi, I want to know in windows we will go to disk Fragmentation to see the Unassigned space. In Linux/ Unix which command can we Use. I tried df -h, thats not the right answer. It shows the created partitions & the free space available in those Partitions. Can some one help.... Regards,... (1 Reply)
Discussion started by: shahid khan
1 Replies

6. Shell Programming and Scripting

Script to automatically check ports in shell?

Good day, I'm new to linux environment...Is there any scripts available for me to check ports (lets say port 80 and 21) through shell with just a single commandline? Any response is very much appreciated.. thanks (4 Replies)
Discussion started by: arsonist
4 Replies

7. Solaris

regarding ports

Hi , I need one help... Is there any command on solaris 10 to free the ports. For e.g I used netstat -na| grep 8080 it displays either it is listening or established.. i want to free the ports... Anyone please help me on this... Thanks, Shanmuga (2 Replies)
Discussion started by: shanshine
2 Replies

8. Shell Programming and Scripting

Telnet script to test open ports on mult servers

Hello All, Can somebody help me with this script. I have an output file with a list of servers ips and ports. I need to be able to run this script to list all the server ips in the outfile and find out if the port is open or not. #!/bin/sh IFS=#;for i in $(cat portTest); do # check... (2 Replies)
Discussion started by: liketheshell
2 Replies

9. HP-UX

Ports

Can any one tell the command for which process are running on a perticular port (1 Reply)
Discussion started by: zsujith
1 Replies

10. UNIX for Dummies Questions & Answers

Ports

I know i can look in the /etc/services file to look at referenced port numbers, but is there a command that will list the current ports being used? (i.e. what is the application does not have an entry in the services files :confused: ) (2 Replies)
Discussion started by: Ralf
2 Replies

Featured Tech Videos