• Aucun résultat trouvé

Network and Services Discovery A quick theorical introduction to network scanning Alexandre Dulaunoy

N/A
N/A
Protected

Academic year: 2022

Partager "Network and Services Discovery A quick theorical introduction to network scanning Alexandre Dulaunoy"

Copied!
12
0
0

Texte intégral

(1)

Network and Services Discovery

Alexandre Dulaunoy

Introduction Disclaimer/Intro

Active Scanning IP protocol scanning ICMP scanning TCP Port Scanning - Connect scan TCP Port Scanning - Half-open scan TCP Port Scanning - Inversed or stealh TCP scan TCP Port Scanning - ACK TCP scan Hiding your active scanning

Passive scanning TCP passive fingerprint Capture analysis Q and A

Network and Services Discovery

A quick theorical introduction to network scanning

Alexandre Dulaunoy

ASBL CSRRT-LU (Computer Security Research and Response Team Luxembourg)

http://www.csrrt.org/

23rd November 2005

(2)

Network and Services Discovery

Alexandre Dulaunoy

Introduction Disclaimer/Intro

Active Scanning IP protocol scanning ICMP scanning TCP Port Scanning - Connect scan TCP Port Scanning - Half-open scan TCP Port Scanning - Inversed or stealh TCP scan TCP Port Scanning - ACK TCP scan Hiding your active scanning

Passive scanning TCP passive fingerprint Capture analysis Q and A

Disclaimer/Intro

Network scanning is not exact science

I When an information system is able to interact over the network :

I The system is always giving some information about himself

I The system may be used to act as a network scanning tool

I Attackers are always looking for such kind of services

I Network scanning is playing an important role in the process of network discovery for end-user but also for the potential attackers.

(3)

Network and Services Discovery

Alexandre Dulaunoy

Introduction Disclaimer/Intro

Active Scanning IP protocol scanning ICMP scanning TCP Port Scanning - Connect scan TCP Port Scanning - Half-open scan TCP Port Scanning - Inversed or stealh TCP scan TCP Port Scanning - ACK TCP scan Hiding your active scanning

Passive scanning TCP passive fingerprint Capture analysis Q and A

IP protocol scanning

How to know the IP protocol supported by a system. Not only limited to UDP or TCP. The approach used is quite simple :

-

We send a raw IP packet with the protocol defined (RFC3232) and wait for the reply :

I if received an ICMP protocol unreachable, the protocol is not available on the stack

I if we got nothing, the procotol is available or ICMP packets are filtered by a firewall

e.g. : Useful for testing the protocol available on a router. Is IGMP available ?

(4)

Network and Services Discovery

Alexandre Dulaunoy

Introduction Disclaimer/Intro

Active Scanning IP protocol scanning ICMP scanning TCP Port Scanning - Connect scan TCP Port Scanning - Half-open scan TCP Port Scanning - Inversed or stealh TCP scan TCP Port Scanning - ACK TCP scan Hiding your active scanning

Passive scanning TCP passive fingerprint Capture analysis Q and A

ICMP scanning

I Nifty Internet Control Message Protocol : ICMP type 8 - echo request

ICMP type 13 - time stamp request ICMP type 15 - information request ICMP type 17 - netmask request

ICMP can be used as very basic discovery tool. Not always filtered as some of them are required by RFCs and/or for proper operation.

(5)

Network and Services Discovery

Alexandre Dulaunoy

Introduction Disclaimer/Intro

Active Scanning IP protocol scanning ICMP scanning TCP Port Scanning - Connect scan TCP Port Scanning - Half-open scan TCP Port Scanning - Inversed or stealh TCP scan TCP Port Scanning - ACK TCP scan Hiding your active scanning

Passive scanning TCP passive fingerprint Capture analysis Q and A

TCP Port Scanning - Connect Scan

A connect scan is a scan using the vallina connect() approach. The full TCP 3-way handshake is done : -

We send a SYN to the target host and port:

I We wait for the SYN-ACK from the target host

I if yes, we’ll send an ACK to the target. This means that port is open.

I If we got a RST, the target host is not listening on that port.

The connect() scan is very slow, very visible (e.g. TCP Wrappers, netstat) due to the full handshake

(ESTABLISHED state).

(6)

Network and Services Discovery

Alexandre Dulaunoy

Introduction Disclaimer/Intro

Active Scanning IP protocol scanning ICMP scanning TCP Port Scanning - Connect scan TCP Port Scanning - Half-open scan TCP Port Scanning - Inversed or stealh TCP scan TCP Port Scanning - ACK TCP scan Hiding your active scanning

Passive scanning TCP passive fingerprint Capture analysis Q and A

TCP Port Scanning - Half-open scan

A half-open scan is where the full TCP handshake is not done :

-

We send a SYN to the target host and port :

I We wait for the SYN-ACK from the target host

I if yes, we’ll send directly a RST to the target. This means that port is open but we don’t continue the handshake.

I If we got a RST, the target host is not listening on that port.

The half-open scan is less visible than the connect() scan.

This scan is always faster than the connect() scan too. The main issue is the use of the SYN flag...

(7)

Network and Services Discovery

Alexandre Dulaunoy

Introduction Disclaimer/Intro

Active Scanning IP protocol scanning ICMP scanning TCP Port Scanning - Connect scan TCP Port Scanning - Half-open scan TCP Port Scanning - Inversed or stealh TCP scan TCP Port Scanning - ACK TCP scan Hiding your active scanning

Passive scanning TCP passive fingerprint Capture analysis Q and A

TCP Port Scanning - Inversed or stealh TCP scan

By default a TCP stack must respond (RFC793) to non-SYN flag on a closed port with a RST. For open port, the datagram must be discarded. But various systems are still sending RST on open ports too...

-

We send an FIN or FIN/URG/PUSH or no flag to the target host and port :

I We wait for the RST from the target host

I if yes, this means that port is closed.

I If we got nothing, this is probably an open port.

Results are not always reliable but can be used in

conjunction with other scan. The main advantage is not to use SYN flag (e.g. packet filter only checking for SYN).

(8)

Network and Services Discovery

Alexandre Dulaunoy

Introduction Disclaimer/Intro

Active Scanning IP protocol scanning ICMP scanning TCP Port Scanning - Connect scan TCP Port Scanning - Half-open scan TCP Port Scanning - Inversed or stealh TCP scan TCP Port Scanning - ACK TCP scan Hiding your active scanning

Passive scanning TCP passive fingerprint Capture analysis Q and A

TCP Port Scanning - ACK TCP scan

An ACK scan is often used to check the kind of packet filter between you and the target host.

-

We send an ACK (random ack/seq) to the target host and port :

I We wait for the RST from the target host

I Variation of the TTL and Window field is also interesting.

I if yes, this means that port is unfiltered.

I If we got nothing, this is probably a filtered port.

(9)

Network and Services Discovery

Alexandre Dulaunoy

Introduction Disclaimer/Intro

Active Scanning IP protocol scanning ICMP scanning TCP Port Scanning - Connect scan TCP Port Scanning - Half-open scan TCP Port Scanning - Inversed or stealh TCP scan TCP Port Scanning - ACK TCP scan Hiding your active scanning

Passive scanning TCP passive fingerprint Capture analysis Q and A

Hiding your active scanning

If you are an attacker, it’s always better to find ways to

’somewhat’ hide your various activities :

I using FTP relay (old ftp server) - RFC959

I using open proxies (e.g. CONNECT method)

I Idle scan approach

I Using a zombie host to receive your request

I Cover channel using IPID (IP identification) to receive the reply on open port from the zombie

(10)

Network and Services Discovery

Alexandre Dulaunoy

Introduction Disclaimer/Intro

Active Scanning IP protocol scanning ICMP scanning TCP Port Scanning - Connect scan TCP Port Scanning - Half-open scan TCP Port Scanning - Inversed or stealh TCP scan TCP Port Scanning - ACK TCP scan Hiding your active scanning

Passive scanning TCP passive fingerprint Capture analysis Q and A

TCP passive fingerprint

Signatures are built on various TCP/IP parameters :

I TTL (max. ttl is different following the OS/version)

I Window Size

I DF bit set (some OS are sending it or not)

I ToS

I ECN, Selective Acknowledgement, ...

You can build database of remote services including Operating System version, revision...(check tools presentation)

(11)

Network and Services Discovery

Alexandre Dulaunoy

Introduction Disclaimer/Intro

Active Scanning IP protocol scanning ICMP scanning TCP Port Scanning - Connect scan TCP Port Scanning - Half-open scan TCP Port Scanning - Inversed or stealh TCP scan TCP Port Scanning - ACK TCP scan Hiding your active scanning

Passive scanning TCP passive fingerprint Capture analysis Q and A

Capture analysis

I Is there any network scanning in the honeynet network capture ?

I If yes, what are the methods used to scan the honeynet

?

I Can you make a passive fingerprint on the capture itself

?

I If yes, how will you proceed ?

I What are the open ports (only with the capture) on the honeynet target host ?

(12)

Network and Services Discovery

Alexandre Dulaunoy

Introduction Disclaimer/Intro

Active Scanning IP protocol scanning ICMP scanning TCP Port Scanning - Connect scan TCP Port Scanning - Half-open scan TCP Port Scanning - Inversed or stealh TCP scan TCP Port Scanning - ACK TCP scan Hiding your active scanning

Passive scanning TCP passive fingerprint Capture analysis Q and A

Q and A

I Thanks for listening.

I http://www.csrrt.org.lu/

I adulau@foo.be

Références

Documents relatifs

Multiscale probing is not limited to atomic-force microscopy and can be extended to any type of scanning probe technique in nanotechnology, including piezoforce

The piezo motor in our STM head has a step size of about 2000 Å at room temperature and about 300 Å at temperatures below 4 K, when driven with a peak voltage of 300 V!. One can

The tunneling conductance within the vortex core shows zero bias peaks in 2H-NbSe 1.8 S 0.2 and in 2H-NbS 2 due to Caroli-deGennes-Matricon core states..

RFC 792 describes the process of creating an ICMP Echo request: The sending side initializes the identifier (used to identify Echo requests aimed at different destination hosts)

La ventaja 2.3 implica que SWScanner será de utilidad en un elevado número de situaciones, aunque el controlador de la tarjeta de red inalámbrica que esté siendo utilizada no

Ainsi, seuls les protocoles de niveau supérieur sont responsables des données contenues dans les paquets IP (et de leur ordre de réception).. Le protocole IP travaille en mode

L’archive ouverte pluridisciplinaire HAL, est destinée au dépôt et à la diffusion de documents scientifiques de niveau recherche, publiés ou non, émanant des

L’archive ouverte pluridisciplinaire HAL, est destinée au dépôt et à la diffusion de documents scientifiques de niveau recherche, publiés ou non, émanant des