LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 06-22-2006, 05:10 AM   #1
noir911
Member
 
Registered: Apr 2004
Posts: 682

Rep: Reputation: Disabled
netcat slow scan


I am probing a host using OpenBSD's netcat.

nc -v -w 3 -z host.com 80-81

If it finds port 80 open and 81 closed it sits there in an endless loop
and after a long time it gives a connection time-out error.

Code:
 # nc -v -w 3 -z host.com 80-81
   Connection to host.com 80 port [tcp/www] succeeded!
   nc: connect to host.com port 81 (tcp) failed: Connection timed out
How can I make this timeout a bit faster? I am already telling it to
bail out after 3 seconds with ( -w 3 ) but seems like it is not helping.
 
Old 06-23-2006, 06:24 PM   #2
bulliver
Senior Member
 
Registered: Nov 2002
Location: British Columbia, Canada
Distribution: Gentoo x86_64; FreeBSD; OS X
Posts: 3,762
Blog Entries: 4

Rep: Reputation: 78
I just tried your exact command on my server which has port 80 open and 81 closed, and it worked just fine. That is, three seconds after I run the command I get this:

Code:
badcomputer.org [192.168.0.11] 81 (hosts2-ns) : Connection timed out
badcomputer.org [192.168.0.11] 80 (http) open
So?...

Are you familiar with your "host.com"? Might they have some sort of persitant connection TARPIT kind of firewall? Is it hanging for the typical 30sec TCP Socket timeout or is it lasting longer? I have version 1.10 of netcat here...
 
Old 06-25-2006, 02:30 AM   #3
noir911
Member
 
Registered: Apr 2004
Posts: 682

Original Poster
Rep: Reputation: Disabled
I tried it again and there is no firewall blocking in either end. It usually takes 1min 15 seconds before it times out!
 
Old 06-26-2006, 03:45 AM   #4
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 57
Maybe this:
Code:
echo "QUIT" | nc -v -w 3 -z host.com 80-81
 
Old 06-28-2006, 03:04 AM   #5
noir911
Member
 
Registered: Apr 2004
Posts: 682

Original Poster
Rep: Reputation: Disabled
tried that too but doesn't work. However, it works perfectly fine in Fedora. I think the OpenBSD's "-w" is broken.
 
  


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
Netcat s0n|k Linux - Newbie 3 04-16-2006 05:16 PM
To SCAN or not to SCAN? HP750xi Suse 9.2 Pro newtwolinux Linux - Hardware 4 06-22-2005 04:02 PM
netcat question overbored Linux - Software 13 10-30-2004 04:26 PM
Anyone Familiar With Netcat ? Santorres Linux - Software 0 07-10-2003 06:27 PM
m$ clients slow scan for samba servers wlfdgcrkz Linux - Software 0 06-19-2003 05:11 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 12:31 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration