Saturday, February 28, 2009

Getting Caught with Your Ports Down!!!

What is port scanning? It is like a thief going through your neighborhood and checking every door and window on each house to see which are locked. Port scanning software simply sends out a request to connect to the target computer on each port sequentially and makes a note of which ports responded or seem open to more in-depth probing.

Port scanning can be done with malicious intent, the intruder would generally prefer to go undetected. Network security applications can be configured to alert administrators if they detect connection requests across a broad range of ports from a single host. To get around this the intruder can do the port scan in strobe or stealth mode. Strobing limits the ports to a smaller target set rather than blanket scanning all 65,536 ports. Stealth scanning uses techniques such as slowing the scan.

There are a number of different methods to perform the actual port scans as well as tricks to hide the true source of port scan.

You must find the right balance between network performance and network safety. You could monitor for SYN scans by logging any attempt to send a SYN packet to a port tat isn't open or listening. A SYN scan is a type of TCP scanning that is also known as a "half-open scanning" because it does not open a full TCP connection.

You must ensure you have approval of all the necessary people before port scanning otherwise you may be on the wrong side of the law. Once you find out what ports respond as being open by port scanning your own network you can begin to work on determining whether it is necessary for those ports to be open to outside traffic.

Types of Port Scans Include
  • Vanilla: An attempt to connect to all 65,536 ports
  • Strobe: An attempt to connect to only selected ports (typically under 20)
  • Stealth Scan: Several techniques for scanning that attemp to prevent the request for connection being logged; uses SYN scan FIN scans or other techniques to prevent logging of the scan.
  • FTP Bounce: Scan attempts that are directed through an FTP server to disguise the cracker's location.
  • Fragmented Packets: Scans by sending packet fragments that can get through simple packet filters in a firewall.
  • UDP: Scans for open UDP ports.
  • Sweep: Scans the same port on a number of computers.

Tool Used to Perform Port Scanning

NMap (Network Mapper) is a popular free open source software used to port scan. It is a utility for network exploration or security auditing. You can scan a range of IP addresses and ports and find out what an attacker would see if they were to port scan your network. NMap allows great flexibility and control of almost every aspect of the scan and perform various types of port scans to fit your needs.

NMap was designed to rapidly scan large networks, but works find against a single host NMap is:

  • Flexible: Supports dozens of advanced techniques for mapping out networks filled with IP filters, firewalls, routers, and other obstacles.
  • Powerful: Used to scan huge networks of literally hundreds of thousands of machines.
  • Portable: Most operating systems are supported, including: Linux, Microsoft Windows, FreeBSD, Open BSD, Solaris, IRIX, Mac OS X, HP-UX, NetBSD, Sun OS, Amiga, and more.
  • Easy: You can start out as simply as nmap-v-A targethost. Both traditional command line and graphical (GUI) versions are available to suit your preference.
  • Free: It comes with full source code.
  • Well Documented
  • Supported
  • Popular

Friday, February 27, 2009

Network Modeling

The OSI Model used in discussing and explaining networking concepts at high levels, and also when describing network problems and troubleshooting problems. For a more practical look at the structure a network administrators use the TCP/IP Model.

The OSI Model is a theroritical representation of how a network works.

OSI Model
7-- Application Layer
6-- Presentation Layer
5-- Session Layer
4-- Transport Layer
3-- Network Layer
2-- Data Link Layer
1-- Physical Layer


The TCP/IP Model is more of a realistic and working model representation of how a network works. All of the same information from the OSI Model is within the TCP/IP Model. Some of the layers are condensed and overlap within the TCP/IP Model.

TCP/IP Model
5-- Application Layer
4-- Transport Layer
3-- Network Layer
2-- Data Link Layer
1-- Physical Layer

I will attempt to explain the different layers of both the OSI Model and the TCP/IP Model and compare and contrast the two.