Из Википедии, бесплатной энциклопедии
  (Перенаправлено из сканирования портов )
Перейти к навигации Перейти к поиску

Сканер портов представляет собой приложение , предназначенное для зондирования сервера или хоста для открытых портов . Такое приложение может использоваться администраторами для проверки политик безопасности своих сетей и злоумышленниками для идентификации сетевых служб, работающих на узле, и использования уязвимостей.

Сканирование портов или PortScan представляет собой процесс , который посылает запросы клиента к диапазону портов сервера адресов на хосте, с целью нахождения активного порта; это не гнусный процесс сам по себе. [1] В большинстве случаев сканирование портов - это не атаки, а скорее простые пробы для определения служб, доступных на удаленной машине.

Для portsweep является сканирование нескольких хостов для порта конкретных прослушивания. Последнее , как правило , используется для поиска конкретной услуги, например, SQL -На компьютерный червь может portsweep ищет хозяев прослушивает TCP порт 1433. [2]

Основы TCP / IP [ править ]

Дизайн и работа Интернета основаны на Internet Protocol Suite , обычно также называемом TCP / IP . В этой системе для обращения к сетевым службам используются два компонента: адрес хоста и номер порта. Имеется 65535 различных и используемых номеров портов, пронумерованных 1..65535. (Нулевой порт не является используемым номером порта.) Большинство служб используют один или, самое большее, ограниченный диапазон номеров портов.

Некоторые сканеры портов сканируют только наиболее распространенные номера портов или порты, наиболее часто связанные с уязвимыми службами на данном узле.

Результат сканирования порта обычно делится на одну из трех категорий:

  1. Открыто или принято : хост отправил ответ, указывающий, что служба прослушивает порт.
  2. Закрытый или Denied или не слушают : Хозяин прислал ответ , указывающий , что соединение будет отказано в порт.
  3. Отфильтровано , удалено или заблокировано : от хоста не было ответа.

Открытые порты представляют две уязвимости, с которыми администраторам следует опасаться:

  1. Проблемы безопасности и стабильности, связанные с программой, ответственной за предоставление услуги - Открытые порты.
  2. Проблемы безопасности и стабильности, связанные с операционной системой , работающей на хосте - открытые или закрытые порты.

Отфильтрованные порты обычно не представляют собой уязвимостей.

Предположения [ править ]

Все формы сканирования портов основаны на предположении, что целевой хост соответствует RFC 793 - протокол управления передачей . Хотя это происходит в большинстве случаев, все же существует вероятность того, что хост может отправлять обратно странные пакеты или даже генерировать ложные срабатывания, когда стек TCP / IP хоста не соответствует RFC или был изменен. Это особенно верно для менее распространенных методов сканирования, которые зависят от ОС (например, сканирование FIN). [3] Метод снятия отпечатков стека TCP / IP также полагается на эти типы различных сетевых ответов на конкретный стимул, чтобы угадать тип операционной системы, в которой работает хост.

Типы [ править ]

TCP scanning[edit]

The simplest port scanners use the operating system's network functions and are generally the next option to go to when SYN is not a feasible option (described next). Nmap calls this mode connect scan, named after the Unix connect() system call. If a port is open, the operating system completes the TCP three-way handshake, and the port scanner immediately closes the connection to avoid performing a Denial-of-service attack.[3] Otherwise an error code is returned. This scan mode has the advantage that the user does not require special privileges. However, using the OS network functions prevents low-level control, so this scan type is less common. This method is "noisy", particularly if it is a "portsweep": the services can log the sender IP address and Intrusion detection systems can raise an alarm.

SYN scanning[edit]

SYN scan is another form of TCP scanning. Rather than using the operating system's network functions, the port scanner generates raw IP packets itself, and monitors for responses. This scan type is also known as "half-open scanning", because it never actually opens a full TCP connection. The port scanner generates a SYN packet. If the target port is open, it will respond with a SYN-ACK packet. The scanner host responds with an RST packet, closing the connection before the handshake is completed.[3] If the port is closed but unfiltered, the target will instantly respond with an RST packet.

The use of raw networking has several advantages, giving the scanner full control of the packets sent and the timeout for responses, and allowing detailed reporting of the responses. There is debate over which scan is less intrusive on the target host. SYN scan has the advantage that the individual services never actually receive a connection. However, the RST during the handshake can cause problems for some network stacks, in particular simple devices like printers. There are no conclusive arguments either way.

UDP scanning[edit]

UDP scanning is also possible, although there are technical challenges. UDP is a connectionless protocol so there is no equivalent to a TCP SYN packet. However, if a UDP packet is sent to a port that is not open, the system will respond with an ICMP port unreachable message. Most UDP port scanners use this scanning method, and use the absence of a response to infer that a port is open. However, if a port is blocked by a firewall, this method will falsely report that the port is open. If the port unreachable message is blocked, all ports will appear open. This method is also affected by ICMP rate limiting.[4]

An alternative approach is to send application-specific UDP packets, hoping to generate an application layer response. For example, sending a DNS query to port 53 will result in a response, if a DNS server is present. This method is much more reliable at identifying open ports. However, it is limited to scanning ports for which an application specific probe packet is available. Some tools (e.g., nmap) generally have probes for less than 20 UDP services, while some commercial tools have as many as 70. In some cases, a service may be listening on the port, but configured not to respond to the particular probe packet.

ACK scanning[edit]

ACK scanning is one of the more unusual scan types, as it does not exactly determine whether the port is open or closed, but whether the port is filtered or unfiltered. This is especially good when attempting to probe for the existence of a firewall and its rulesets. Simple packet filtering will allow established connections (packets with the ACK bit set), whereas a more sophisticated stateful firewall might not.[5]

Window scanning[edit]

Rarely used because of its outdated nature, window scanning is fairly untrustworthy in determining whether a port is opened or closed. It generates the same packet as an ACK scan, but checks whether the window field of the packet has been modified. When the packet reaches its destination, a design flaw attempts to create a window size for the packet if the port is open, flagging the window field of the packet with 1's before it returns to the sender. Using this scanning technique with systems that no longer support this implementation returns 0's for the window field, labeling open ports as closed.[6]

FIN scanning[edit]

Since SYN scans are not surreptitious enough, firewalls are, in general, scanning for and blocking packets in the form of SYN packets.[3] FIN packets can bypass firewalls without modification. Closed ports reply to a FIN packet with the appropriate RST packet, whereas open ports ignore the packet on hand. This is typical behavior due to the nature of TCP, and is in some ways an inescapable downfall.[7]

Other scan types[edit]

Some more unusual scan types exist. These have various limitations and are not widely used. Nmap supports most of these.[5]

  • X-mas and Null Scan - are similar to FIN scanning, but:[3]
    • X-mas sends packets with FIN, URG and PUSH flags turned on like a Christmas tree
    • Null sends a packet with no TCP flags set
  • Protocol scan - determines what IP level protocols (TCP, UDP, GRE, etc.) are enabled.
  • Proxy scan - a proxy (SOCKS or HTTP) is used to perform the scan. The target will see the proxy's IP address as the source. This can also be done using some FTP servers.
  • Idle scan - Another method of scanning without revealing one's IP address, taking advantage of the predictable IP ID flaw.
  • CatSCAN - Checks ports for erroneous packets.
  • ICMP scan - determines if a host responds to ICMP requests, such as echo (ping), netmask, etc.

Port filtering by ISPs[edit]

Many Internet service providers restrict their customers' ability to perform port scans to destinations outside of their home networks. This is usually covered in the terms of service or acceptable use policy to which the customer must agree.[8][9] Some ISPs implement packet filters or transparent proxies that prevent outgoing service requests to certain ports. For example, if an ISP provides a transparent HTTP proxy on port 80, port scans of any address will appear to have port 80 open, regardless of the target host's actual configuration.

Ethics[edit]

The information gathered by a port scan has many legitimate uses including network inventory and the verification of the security of a network. Port scanning can, however, also be used to compromise security. Many exploits rely upon port scans to find open ports and send specific data patterns in an attempt to trigger a condition known as a buffer overflow. Such behavior can compromise the security of a network and the computers therein, resulting in the loss or exposure of sensitive information and the ability to do work.[3]

The threat level caused by a port scan can vary greatly according to the method used to scan, the kind of port scanned, its number, the value of the targeted host and the administrator who monitors the host. But a port scan is often viewed as a first step for an attack, and is therefore taken seriously because it can disclose much sensitive information about the host.[10]Despite this, the probability of a port scan alone followed by a real attack is small. The probability of an attack is much higher when the port scan is associated with a vulnerability scan.[11]

Legal implications[edit]

Because of the inherently open and decentralized architecture of the Internet, lawmakers have struggled since its creation to define legal boundaries that permit effective prosecution of cybercriminals. Cases involving port scanning activities are an example of the difficulties encountered in judging violations. Although these cases are rare, most of the time the legal process involves proving that an intent to commit a break-in or unauthorized access existed, rather than just the performance of a port scan.

In June 2003, an Israeli, Avi Mizrahi, was accused by the Israeli authorities of the offense of attempting the unauthorized access of computer material. He had port scanned the Mossad website. He was acquitted of all charges on February 29, 2004. The judge ruled that these kinds of actions should not be discouraged when they are performed in a positive way.[12]

A 17-year-old Finn was accused of attempted computer break-in by a major Finnish bank. On April 9, 2003, he was convicted of the charge by the Supreme Court of Finland and ordered to pay US$12,000 for the expense of the forensic analysis made by the bank. In 1998, he had port scanned the bank network in an attempt to access the closed network, but failed to do so.[13]

In 2006, the UK Parliament had voted an amendment to the Computer Misuse Act 1990 such that a person is guilty of an offence who "makes, adapts, supplies or offers to supply any article knowing that it is designed or adapted for use in the course of or in connection with an offence under section 1 or 3 [of the CMA]".[14] Nevertheless, the area of effect of this amendment is blurred, and widely criticized by Security experts as such.[15]

Germany, with the Strafgesetzbuch § 202a,b,c also has a similar law, and the Council of the European Union has issued a press release stating they plan to pass a similar one too, albeit more precise.[16]

United States[edit]

Moulton v. VC3[edit]

In December 1999, Scott Moulton was arrested by the FBI and accused of attempted computer trespassing under Georgia's Computer Systems Protection Act and Computer Fraud and Abuse Act of America. At this time, his IT service company had an ongoing contract with Cherokee County of Georgia to maintain and upgrade the 911 center security. He performed several port scans on Cherokee County servers to check their security and eventually port scanned a web server monitored by another IT company, provoking a tiff which ended up in a tribunal. He was acquitted in 2000, with judge Thomas Thrash ruling in Moulton v. VC3 (N.D. Ga. 2000)[17] that there was no damage impairing the integrity and availability of the network.[18]

See also[edit]

  • Content Vectoring Protocol
  • List of TCP and UDP port numbers
  • Service scan

References[edit]

  1. ^ RFC 2828 Internet Security Glossary
  2. ^ http://support.microsoft.com/kb/313418
  3. ^ a b c d e f Erikson, Jon (1977). HACKING the art of exploitation (2nd ed.). San Francisco: NoStarch Press. p. 264. ISBN 1-59327-144-1.
  4. ^ Messer, James (2007). Secrets of Network Cartography: A Comprehensive Guide to Nmap (2nd ed.). Archived from the original on 2016-05-16. Retrieved 2011-12-05.
  5. ^ a b "Port Scanning Techniques". Nmap reference guide. 2001. Retrieved 2009-05-07.
  6. ^ Messer, James (2007). Secrets of Network Cartography: A Comprehensive Guide to Nmap (2nd ed.). Archived from the original on 2006-02-01. Retrieved 2011-12-05.
  7. ^ Maimon, Uriel (1996-11-08). "Port Scanning without the SYN flag". Phrack issue 49. Retrieved 2009-05-08.
  8. ^ "Comcast Acceptable Use Policy". Comcast. 2009-01-01. Archived from the original on 2009-04-23. Retrieved 2009-05-07.
  9. ^ "BigPond Customer Terms" (PDF). Telstra. 2008-11-06. Archived from the original (PDF) on January 26, 2009. Retrieved 2009-05-08.
  10. ^ Jamieson, Shaun (2001-10-08). "The Ethics and Legality of Port Scanning". SANS. Retrieved 2009-05-08.
  11. ^ Cukier, Michel (2005). "Quantifying Computer Security" (PDF). University of Maryland. Archived from the original (PDF) on 2009-08-24. Retrieved 2009-05-08.
  12. ^ Hon. Abraham N. Tennenbaum (2004-02-29). "Verdict in the case Avi Mizrahi vs. Israeli Police Department of Prosecution" (PDF). Archived from the original (PDF) on 2009-10-07. Retrieved 2009-05-08.
  13. ^ Esa Halmari (2003). "First ruling by the Supreme Court of Finland on attempted break-in". Retrieved 2009-05-07.
  14. ^ UK Parliament (2006-01-25). "Police and Justice Bill - Bill 119". UK Parliament. Retrieved 2011-12-05.
  15. ^ Leyden, John (2008-01-02). "UK gov sets rules for hacker tool ban". The Register. Retrieved 2009-05-08.
  16. ^ "3096th Council meeting Press Release" (PDF). Council of the European Union. 2011-06-10. Retrieved 2011-12-05.
  17. ^ Samson, Martin. "Scott Moulton and Network Installation Computer Services, Inc. v. VC3". Internet Library of Law and Court Decisions. Retrieved 29 April 2021.
  18. ^ Poulsen, Kevin (2000-12-18). "Port scans legal, judge says". SecurityFocus. Retrieved 2009-05-08.

External links[edit]

  • Port Scanning Techniques by Kris Katterjohn. Includes examples using Nmap and Hping.
  • Port Scanning Unscanned by Ankit Fadia
  • Teo, Lawrence (December, 2000). Network Probes Explained: Understanding Port Scans and Ping Sweeps. Linux Journal, Retrieved September 5, 2009, from Linuxjournal.com