Inhalt 📚 In diesem Video erkläre ich dir die verschiedenen Scan-Techniken, die der Netzwerkscanner Nmap zur Verfügung stellt. Du bekommst den SYN-Scan (-sS), den TCP Connect-Scan (-sT), den UDP-Scan (-sU), den Version-Scan (-sV), den Null-Scan (-sN), den FIN-Scan (-sF) und den XMAS-Scan (-sX) einfach erklärt. Dabei schauen wir uns genau an, was bei den jeweiligen Scan-Techniken passiert und wieso sie funktionieren. #Nmap#Netzwerktechnik#Pentesting
Bitte setze dieses Wissen nur für legale Zwecke ein. Scanne keine Systeme oder Netzwerke, die dir nicht selbst gehören oder für die du die schriftliche Erlaubnis vom Betreiber hast, diese zu scannen. Dieses Video ist nur zu Bildungszwecken gedacht (for educational purposes only)!
(*) Bei den Amazon-Links (https.//amzn.to/???????) handelt es sich um Affiliate-Links. Wenn du etwas über diesen Link kaufst, bekomme ich eine kleine Provision. Der Preis ändert sich nicht, wenn du über diesen Link einkaufst. Vielen Dank für deine Unterstützung.
In this video, we will take a closer look at the different scanning techniques of the NMAP network scanner.
Because depending on the target system to be scanned and the existing defense or recognition mechanisms there,
different scanning types are useful.
Please watch my video about the TCP 3-Way Handshake for understanding.
In a SYN scan, NMAP sends SYN packages to the different ports of the server one after the other,
and when the corresponding port is open, a SYN ECG package returns.
You already know this from the already mentioned 3-Way Handshake.
Then NMAP knows that the port is open.
In this case, NMAP sends a so-called reset package to signal that there is no interest in a connection setup,
but the port remains open and can possibly be attacked.
But how does NMAP know when the port is closed?
Quite simply, if instead of a SYN ECG package, a reset package comes as an answer from the server,
then the port is closed and no further communication is required.
If no answer comes from the server, then NMAP leaves a filtered port.
If you can't start with the terms open, closed and filtered port yet,
no problem, watch my video about ports.
A SYN scan can be performed with the option "-ss".
However, root rights are required for this, because a so-called raw socket access is required for this.
This means that these are functions of needs that are deeply buried in the operating system and can therefore only be executed as a sudo.
With a TCP connect scan, NMAP tries to build a completely normal TCP connection using the 3-Way Handshake.
And with every port that is to be scanned.
While already built-up TCP connections are usually ended with a FIN package,
NMAP uses the already known reset package from the SYN scan to end the connection directly.
If the server sends a reset package, then the port is closed and if there is no answer, probably filtered.
A TCP connect scan can be performed with the option "-ss",
and does not require root rights, but usually takes longer than a SYN scan.
This quickly becomes clear when you look at how many messages the two communication partners have to exchange in the case of a TCP connect scan compared to a SYN scan.
With a UDP scan, NMAP sends a UDP package to every port on the server to be examined.
The difference between UDP and TCP is that UDP is a wireless protocol and TCP is a connection-oriented protocol.
You can find more about this in my video on the comparison of UDP and TCP.
NMAP feeds the UDP packages with a small payload to ensure that an answer comes from the server when the port is open,
since if there is no answer, there is no payload.
Payloads are simply usage data, so not only the header is sent, but also some small text, for example.
If the server sends a UDP answer, then the NMAP port is interpreted as open.
If there is no answer from the server, then the port is either seen as open or filtered.
Unfortunately, we cannot say what exactly applies in this case.
It is recommended to send the UDP package to the port again if there is no answer,
because it could have been lost on the way, since UDP is a wireless protocol.
If a so-called ICMP port-unreachable answer returns, then the port is definitely closed.
All other ICMP port-unreachable errors that return from the server mean that the corresponding port is filtered for NMAP.
A UDP scan can be performed with the option "-s U", and does not require root rights.
However, the scan results are not as reliable as with a SYN scan or a TCP connect scan,
because NMAP does not distinguish whether the port is closed or filtered when there is no answer.
In addition, the UDP package must be sent several times, because it can be lost on the way to the server.
With the help of a version scan, information about the version of the services on the server should be collected.
First, NMAP identifies the open ports on the server.
Then an attempt is made to identify the service itself that is offered on the respective port.
A version scan takes a lot of time compared to other scan techniques,
but no root rights are required here as with the SYN scan.
If you also use the switch "-O", you can also identify the operating system of the port.
This makes it possible for the specific behavior of different operating systems.
For the following scan techniques, we will recall the construction of the TCP header.
There are six flags that can be set, namely urge, acknowledge, push, reset, SYN and finish.
Set means that there is a 1 and otherwise a 0.
With a null scan, NMAP sends a package to the server,
in which the SYN, RESET, ACKNOWLEDGE, FINISH, PUSH and the URGE flag are all set to 0.
In RFC 793 it says that if the SYN, the ACK and the RESET flag are set to 0,
the communication looks like this.
It is answered with a RESET flag when the port is closed.
It is not answered when the port is open.
With a null scan, all flags are simply set to 0.
A null scan can be done with the option "-s N".
The purpose behind this scan technique is, as with the FIN scan and the XMIS scan,
which we will look at later, to trick package filter firewalls.
This is a type of firewall that monitors data traffic in a network
and, based on predefined rules, decides whether data packages are allowed or blocked.
No information is taken into account about the state of the network connections.
These firewalls block incoming packages whose SYN flag is set to 1 and the ACK flag to 0.
However, this is not the case for all operating systems,
which is why null scans, FIN scans and XMIS scans do not always work.
However, if they work, they are not as conspicuous and time-consuming as other scan techniques.
With a FIN scan, Nmap sends a package to the server where only the FIN flag is set to 1.
A FIN scan can be done with the option "-s F".
With an XMIS scan, Nmap sends a package to the server where only the URGENT, PUSH and FIN flags are set to 1.
An XMIS scan can be done with the option "-s X".
These were the common scan techniques of Nmap in detail.
As you have seen, there are different scan techniques that are also suitable for different purposes.
If you want to be inconspicuous, it would not make sense to constantly work with a SYN scan
and cause connection interruptions, because they are of course logged in.
On the other hand, you have such options as the XMIS scan, the FIN scan or the NULLScan,
where you use a specific implementation in the RFC 793.
However, it can also happen that this scan is not always successful,
because operating systems may handle it differently.
If you have any further questions, feel free to post them in the comments below.
See you in the next video.