![]() |
General Programming »
Internet / Network »
Security
Advanced
PortScanner : Efficient TCP port scanner based on popular TCP Half Open scanning methodBy NagareshwarA TCP port scanner |
VC6, Windows, MFC, Dev
|
|
Advanced Search |
|
|
|
||||||||||||||||
There are various port scanners which uses simple method of scanning. These applications work at application level and are quite slow. This scanner is faster than normal scanner. It is based on the TCP Half Open Scanning or TCP SYN scanning technique. This method is less detectable than the simple port scanner.
When any two hosts wants to communicate together connection must be established between them. In case of TCP , three way handshake takes place before any communication begins. This is called Full connection and the process is described below.
Once the connection is established- both machines can transmit data packet until one of them ends the connection by sending FIN packet. Some of the simple port scanners use this technique. It can be implemented by creating socket and calling Connect method on each port.This is simple to implement but quite slow and moreover it can be easily detected.
Half scanning is more fast and efficient than full scanning technique. Half open connection is explained below.
Since the host A does not send any additional ACK packet , it is called half open connection. Now the host can easily find out if the target port is open or closed. It it receives TCP packet with SYN+ACK flag set, then it means that target port is open. If it receives RST+ACK packet ,it implies that target port is closed.
In this method full handshake does not take place , hence it is quite faster than full scanning method. Since the implementation has to be done at the protocol level , knowledge of TCP/IP protocol suite is essential.
IP_ADAPTER_INFO adapter[5];
DWORD buflen=sizeof(adapter);
DWORD status=GetAdaptersInfo(adapter,&buflen);
Now the adapter structure contain the source MAC address.
Each time during scanning TCP SYN packet is sent with different port numbers. Then the corresponding reply packet is checked for the flag RST+ACK or SYN+ACK. Based upon this flag target port status is determined.
General
News
Question
Answer
Joke
Rant
Admin
|
PermaLink |
Privacy |
Terms of Use
Last Updated: 17 Jun 2004 Editor: Nishant Sivakumar |
Copyright 2004 by Nagareshwar Everything else Copyright © CodeProject, 1999-2009 Web15 | Advertise on the Code Project |