Image
 
linkedin_logo.png rss_logo.jpg
twitter_logo.png youtube_logo.jpg
Latest Additions
 
EH-Net Login
Welcome Guest.






Lost Password?
No account yet? Register
Who's Online
We have 29 guests online
 
Advertisement

You are here:
EH-Net
May 24, 2013, 02:32:50 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Go back to The Ethical Hacker Network Online Magazine Home Page
 
   Home   Help Calendar Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: Nmap null scans - help needed  (Read 1645 times)
0 Members and 1 Guest are viewing this topic.
Dalobo
Newbie
*
Offline Offline

Posts: 27


View Profile
« on: January 26, 2013, 07:24:04 PM »

I have just finished the AIO CEH book and am working with some of the tools and scans mentioned in the book.

In the book, it is mentioned that an Nmap Null scan (-sN) does not work on Windows, because it does not conform to an RFC. Yet it says that Linux does conform to this RFC and therefor a Null scan will work on Linux.

To test this I fired up a Windows XP and 2003 VM, and metasploitable. I then started Wireshark and did a Null scan on each one.

A Null scan is not supposed to return a reset packet when the port is open, and it will return one when a port is closed.  This should tell you what ports are open. The book says this scan will not work with Windows and that it was designed for Linux boxes.  No matter what OS I scan, RST packets ARE returned. Also, no ports are shown as open on any box, even when there ARE open ports.

Here is an output sample of a Linux box:
All 1000 scanned ports on Dalobo's-PC (192.168.56.41) are open|filtered

Am I misunderstanding something here? Shouldn't the Windows box not return any RST packets thus showing all ports as open?  Why does the linux box not show any open ports? Why is Windows sending RST packets?

Any help would be greatly appreciated.
Logged
Dark_Knight
Sr. Member
****
Offline Offline

Posts: 292


View Profile WWW
« Reply #1 on: January 26, 2013, 07:58:32 PM »

Not all systems follow RFC 793 to the letter. A number of them send RST regardless of whether the port is open or not. The result is all ports are labeled as being closed. Some OS that do this are Windows, Cisco devices and IBM OS/400.

For further details check here:http://nmap.org/book/man-port-scanning-techniques.html
Logged

CEH, OSCP, GPEN, GWAPT, GCIA
http://sector876.blogspot.com
Dalobo
Newbie
*
Offline Offline

Posts: 27


View Profile
« Reply #2 on: January 26, 2013, 08:02:01 PM »

But Windows is sending RST packets and listing all ports as open.  That is where I am confused.

I am reading that link now...

Thanks,

Dalobo
Logged
Dalobo
Newbie
*
Offline Offline

Posts: 27


View Profile
« Reply #3 on: January 26, 2013, 08:05:13 PM »

These three scan types are exactly the same in behavior except for the TCP flags set in probe packets. If a RST packet is received, the port is considered closed, while no response means it is open|filtered. The port is marked filtered if an ICMP unreachable error (type 3, code 1, 2, 3, 9, 10, or 13) is received.

I am getting an open | filtered while getting RST packets. Hence the confusion.

This scan does work against most Unix-based systems though. Another downside of these scans is that they can't distinguish open ports from certain filtered ones, leaving you with the response open|filtered. <-- is this what I am seeing? But some of the ports are open...

Thank you,

Dalobo
Logged
Dark_Knight
Sr. Member
****
Offline Offline

Posts: 292


View Profile WWW
« Reply #4 on: January 26, 2013, 08:08:15 PM »

Initially you said they were all closed and that you were receiving RST packets not so?
Logged

CEH, OSCP, GPEN, GWAPT, GCIA
http://sector876.blogspot.com
Dalobo
Newbie
*
Offline Offline

Posts: 27


View Profile
« Reply #5 on: January 26, 2013, 08:14:14 PM »

Quote
No matter what OS I scan, RST packets ARE returned. Also, no ports are shown as open on any box, even when there ARE open ports.
/quote]

Windows:
I have all the normal Windows ports open as well as 80 on the server.
When I do the Null scan, Windows sends RST packets, but I get the open | filtered output, but no ports listed as open.

Linux:
I have a ton of ports open (metasploitable) but I get a  al 100 ports open | filtered response and no ports listed as open individually.

Here is an output sample of a Linux box:
All 1000 scanned ports on Dalobo's-PC (192.168.56.41) are open|filtered

I was using this page as reference:
http://www.networkuptime.com/nmap/page3-6.shtml
Logged
Dark_Knight
Sr. Member
****
Offline Offline

Posts: 292


View Profile WWW
« Reply #6 on: January 26, 2013, 08:21:48 PM »

Keep in mind that open|filtered means no response received(even after retransmissions)

I just scanned(NULL scan) my XP SP3 machine I receive all ports closed. How are you running nmap?
« Last Edit: January 26, 2013, 08:26:43 PM by Dark_Knight » Logged

CEH, OSCP, GPEN, GWAPT, GCIA
http://sector876.blogspot.com
Dalobo
Newbie
*
Offline Offline

Posts: 27


View Profile
« Reply #7 on: January 26, 2013, 08:30:36 PM »

When I scan my router, it works correctly.  Turning telnet on and then doing a Null scan illicit no RST packet. That means it is open, and it does show up as open.

PORT     STATE SERVICE
23/tcp   open  telnet

So Windows should always show open | filtered or "All open" -> Hence the does not work with Windows

The Linux that is running in Metasploitable is Ubuntu i think. Ubuntu must do the same thing as Windows.  The Linux on my router must work the "normal way" and that is why telnet shows up. (Along with a few others.)

Am I thinking correctly now?

Thank you,

Dalobo
Logged
Dark_Knight
Sr. Member
****
Offline Offline

Posts: 292


View Profile WWW
« Reply #8 on: January 26, 2013, 08:45:56 PM »

The behavior I see on my end is consistent with the RFC. I have ports 139,135,445 open. When I perform a NULL scan against XP SP 3, nmap labels all ports as closed and does send back an RST.

 I am receiving open|filtered.
Logged

CEH, OSCP, GPEN, GWAPT, GCIA
http://sector876.blogspot.com
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines
Joomla Bridge by JoomlaHacks.com
Valid XHTML 1.0! Valid CSS!
Page created in 0.071 seconds with 23 queries.
 
Exclusive Deal

sansfire13_245x90_cw90.jpg
SANSFIRE 2013
June 15 - 22

5% Off w/ Code: EHN_5

SANS Deals 4 EH-Netters
5% OFF Any SANS Course in Any Format!
Coupon Code: EHN_5 Including SANS Rocky Mountain 2013 & SANS Boston 2013
Polls
Compared to this year, 2013 will be:
 
Recent Forum Topics
EH-Net News Feeds
Latest Additions
 
         
Advertisement

© 2013 The Ethical Hacker Network
Joomla! is Free Software released under the GNU/GPL License.