Unix/Linux Go Back    


UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

Telnet vs netcat behavior

UNIX for Advanced & Expert Users


Closed    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 07-23-2014
ckmehta ckmehta is offline
Registered User
 
Join Date: Feb 2008
Last Activity: 8 August 2016, 3:04 PM EDT
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Telnet vs netcat behavior

Currently I run a number of network tests using netcat that checks for an open port on a remote IP-address, using this syntax:

Code:
netcat -v -w 5 -z 107.249.95.5 4488

For some reason, the netcat command above is hanging (although others work fine), but a telnet is showing a valid connection like below:

Code:
%  telnet 107.249.95.5 4488
Trying 107.249.95.5...
Connected to 107.249.95.5.
Escape character is '^]'.
^]

Normally with my other netcat tests, I see an immediate result like this:
aaaa.XXX.com [102.19.5.62] 22 (ssh) open
aaaa.XXX.com [102.19.5.62] 23 (telnet): Connection timed out

The only thing different/interesting about the 107.249.95.5 address is that it is over a VPN to an MQ server.

Any idea why this network test is failing, even though its obviously connectable over telnet. If it matters, I am running this on a Solaris 10 box.

Last edited by ckmehta; 07-23-2014 at 05:32 PM..
Sponsored Links
    #2  
Old Unix and Linux 07-23-2014
Corona688 Corona688 is offline Forum Staff  
Mead Rotor
 
Join Date: Aug 2005
Last Activity: 19 January 2017, 5:50 PM EST
Location: Saskatchewan
Posts: 21,760
Thanks: 1,027
Thanked 4,032 Times in 3,740 Posts
Well, it wouldn't be hanging if it wasn't connecting.

For what purpose are you brute-force-scanning all these ports?
Sponsored Links
    #3  
Old Unix and Linux 07-24-2014
ckmehta ckmehta is offline
Registered User
 
Join Date: Feb 2008
Last Activity: 8 August 2016, 3:04 PM EDT
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Then why is my telnet connecting (or appearing to)?

Who says I am brute-force-scanning all these ports, I am testing specific IP addresses and ports over a VPN to a real-time application service that I need to ensure 24/5 availability on.
    #4  
Old Unix and Linux 07-24-2014
Yoda's Unix or Linux Image
Yoda Yoda is offline Forum Advisor  
Jedi Master
 
Join Date: Jan 2012
Last Activity: 19 January 2017, 1:05 PM EST
Location: Galactic Empire
Posts: 3,530
Thanks: 250
Thanked 1,282 Times in 1,204 Posts
Is it UDP based? If yes, then use UDP instead of the default option of TCP:-

Code:
nc -zuv 107.249.95.5 4488

Sponsored Links
    #5  
Old Unix and Linux 07-25-2014
ckmehta ckmehta is offline
Registered User
 
Join Date: Feb 2008
Last Activity: 8 August 2016, 3:04 PM EDT
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Pretty sure it was TCP, but just to confirm, here are my failing results:

Code:
> telnet 107.249.95.5 4488
Trying 107.249.95.5...
Connected to 107.249.95.5.
Escape character is '^]'.
^]
telnet> close
Connection to 107.249.95.5 closed.
> nc -zuv 107.249.95.5 4488
^CExiting.

Sponsored Links
Closed

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Help with Netcat MrCrumbs IP Networking 0 09-12-2012 10:30 AM
Post using nc(netcat) ajaypadvi Shell Programming and Scripting 3 07-27-2011 09:04 AM
netcat MartyIX Shell Programming and Scripting 6 08-22-2008 08:29 AM
Netcat with Authentication? pileofrogs UNIX for Advanced & Expert Users 1 12-04-2006 10:48 AM
Telnet behavior piltrafa UNIX for Dummies Questions & Answers 4 10-31-2001 03:49 PM



All times are GMT -4. The time now is 05:48 AM.