Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Check telnet port multiple server Post 303035184 by stomp on Thursday 16th of May 2019 07:49:25 AM
Old 05-16-2019
Fun mode: ON

Hey you can even write your portscanner in plain bash ;-)

See here:
TCP Port Scanner in Bash

for short(GNU coreutils(for "timeout") needed or a perl script if coreutils are not available):

Code:
for port in 80 443 12345; do 
  timeout 3 echo >/dev/tcp/google.com/$port &&     
  echo "port $port is open" ||     
  echo "port $port is closed" 
 done

Hmm. Doesn't work as expected :-( ...

This one works :-) ...
Code:
for port in 80 443 12345; do 
  timeout 3 bash -c "echo >/dev/tcp/google.com/$port" &&     
  echo "port $port is open" ||     
  echo "port $port is closed" 
done


Last edited by stomp; 05-17-2019 at 04:14 AM..
 

10 More Discussions You Might Find Interesting

1. Solaris

disabled telnet now need port 23 or port 22

we disabled telnet on solaris 9 via previous a thread. We use CMS (call management system) supervisor which used port 23 (telnet). We cannot use telnet via local directive and it was shut down as stated when we shut down telnet in the inetd file. I cannot now log into the CMS box since port 23 is... (3 Replies)
Discussion started by: panzerkw
3 Replies

2. Shell Programming and Scripting

Telnet IP and Port Script

Hi, I would like to create a simple script that will telnet a number of IP and Ports one after the other to confirm connectivity to those addresses. I don't need to log on, just output to a file what the response is, i.e Escape Character, connectivity refused etc. Complete newbie to... (6 Replies)
Discussion started by: asou
6 Replies

3. AIX

Telnet to port

can some one help me ? what happens when we telnet to a port ? example telnet 192.168.0.xx 1234 where 1234 is a port number Thank you (5 Replies)
Discussion started by: anwesh
5 Replies

4. Windows & DOS: Issues & Discussions

Telnet to a serial port

Hello all. I have an old computer with M$-DOS 7. I want to use it like a dumb terminal, with telnet. I need to connect it to my desktop These are my questions: How can i configure the serial port on dos? How can i telnet form dos to the serial port? How can i set up a telnet server on the... (12 Replies)
Discussion started by: mghis
12 Replies

5. Cybersecurity

Can't telnet to port 25 on the host.

Hi, we have recently setup a new UNIX server with solaris 10 and I am having issue with with SMTP/sendmail. telnet localhost 25 --- works telnet hostname.domain.com 25 -- does not work. # telnet hostname.domain.com 25 Trying 10.122.1.111... telnet: Unable to connect to remote host:... (1 Reply)
Discussion started by: esmgr
1 Replies

6. Red Hat

telnet port 23

My linux version is 2.6.18-194.e14 (Oracle enterprise linux). Could you please tell me how to enable telnet on the server. When I try to connect the server through another pc using telnet it is throwing error. Connecting To <ip address>...Could not open connection to the host, on port 23.... (3 Replies)
Discussion started by: oradba_arun
3 Replies

7. HP-UX

how to check remote server port listening from application.

Hi, I have an application running on HP-UX, from this application I need to findout if the port number. lets say 7890,7891, 7892 are listening on the remote server running on HP-UX. Is there any way of doing it using "system()" function or any other? I noticed that nmap, netcat are not... (0 Replies)
Discussion started by: einsteinBrain
0 Replies

8. IP Networking

telnet for port 5433 is not working while it works for port 22

Hi, I am trying to set up a dev environment and I have Ubuntu server (10.16.1.92) and a CentOS VM (10.16.3.235) on this. On the CentOS I have a program running on port 5433. Now my problem is that I am unable to telnet this port from another Windows server whereas I can telnet port 22 from... (5 Replies)
Discussion started by: rishav
5 Replies

9. Shell Programming and Scripting

*ix script to check port of client server and return output

Hello EveryOne, I am new to *ix. some could help to write a script. Problem :- Have to ssh to so many client and check port or filesystem usage, so thinking to automate using script. What i Need:- when i run script on my Launchpad server, it should Should ask and SSH to user provided... (3 Replies)
Discussion started by: MeFirst
3 Replies

10. Shell Programming and Scripting

Telnet of multiple server and ports

Hi, I do a telnet to a single server using command :telnet tibserver001 9640 The output i get is : Trying 10.19.... Connected to tibserver001 However i need to put all the servers in a single file and get the output to see if the server is connected or not. #! /bin/bash telnet... (3 Replies)
Discussion started by: samrat dutta
3 Replies
TCPCONNECT(1)						      General Commands Manual						     TCPCONNECT(1)

NAME
tcpconnect - general TCP/IP client SYNOPSIS
tcpconnect [-irv] [-l localaddr] host port DESCRIPTION
tcpconnect creates a TCP/IP connection to a server running on the machine host, listening to port port. It then reads standard input and sends to the remote server, and data received from the server is printed to standard output. When end-of-file is reached on both standard input and the TCP/IP connection, tcpconnect terminates. OPTIONS
-i Terminate at end-of-file on standard input; don't wait for the server to close the connection. -r Terminate when the remote server closes the connection; don't wait for end-of-file on standard input. -v Verbose mode. Prints a message to standard error when the connection has been established. -l addr:port Bind the local end-point of the connection to IP address addr, TCP port port. Either the IP address or the port, but not both, may be left out, meaning that the operating system gets to choose that part by itself. SEE ALSO
tcplisten(1), telnet(1), tcpbug(1). BUGS
The names of the options are not yet finalized, and may change at a future release. 1997 April 13 TCPCONNECT(1)
All times are GMT -4. The time now is 03:53 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy