TryHackMe — NMAP

CrhystamiL
5 min readMar 22, 2020

--

NMAP herramienta para la etapa de reconocimiento de dispositivos y servicios.

En este caso no es un reto, pero hay algunas preguntas que debemos responder sobre las opciones que tiene NMAP, y con la ayuda de nmap puedes responder todas estas preguntas.

#1 First, how do you access the help menu?

# La opción con la que podemos ver el menu de ayuda es con -h$ nmap -h

#2 Often referred to as a stealth scan, what is the first switch listed for a ‘Syn Scan’?

# Con la opción -sS podemos realizar un escaneo de tipo Syn Scan $ nmap -sS xx.xx.xx.xx

#3 Not quite as useful but how about a ‘UDP Scan’?

# Para realizar un escaneo de tipo UDP se usa la opción -sU, con esta opción buscara puertos abiertos que usen el protocolo UDP$ nmap -sU xx.xx.xx.xx

#4 What about operating system detection?

# La opción para detectar el sistema operativo es -O, para realizar este escaneo se debe tener permisos de root.$ nmap -O xx.xx.xx.xx

# 5 How about service version detection?

# La opción para detectar los servicios que corren en los diferentes puertos es -sC$ nmap -sC xx.xx.xx.xx

# 6 Most people like to see some output to know that their scan is actually doing things, what is the verbosity flag?

# En algunas ocaciones es bueno tener la opción activa, verbosity nos ayuda a ver como la herramienta esta realizando el escaneo de una manera mas detallada.$ nmap -v xx.xx.xx.xx

#7 What about ‘very verbose’? (A personal favorite)

#Para tener un mayor detalle de nuestro escaneo se usa la opción -vv$nmap -vv xx.xx.xx.xx

#8 Sometimes saving output in a common document format can be really handy for reporting, how do we save output in xml format?

# Nmap tiene diferentes formatos para guardar la salida de un escaneo. La opcion -oX guarda la salida en formato xml.$ nmap xx.xx.xx.xx -oX nombre_archivo.xml

#9 Aggressive scans can be nice when other scans just aren’t getting the output that you want and you really don’t care how ‘loud’ you are, what is the switch for enabling this?

# La opción -A realiza la detección del SO, versión de los servicios, escaneo con algunos scripts y traceroute.$ nmap -A xx.xx.xx.xx

#10 How do I set the timing to the max level, sometimes called ‘Insane’?

# La opción -T5 es un escaneo agresivo, se reducen los tiempos de envió de paquetes, el máximo de re-intentos se reduce a 2, etc. $nmap -T5 xx.xx.xx.xx

#11 What about if I want to scan a specific port?

# Para escanear un puerto especifico solo se utiliza la opcion -p, y se puede escanear un rango o ciertos puertos

$ nmap -p 80,8080,9090 xx.xx.xx.xx
$ nmap -p 80-1000 xx.xx.xx.xx

# 12 How about if I want to scan every port?

# Para poder escanear todos los puertos de un host se tiene 2 opciones.$ nmap -p- xx.xx.xx.xx
$ nmap -p 0-65535 xx.xx.xx.xx

# 13 What if I want to enable using a script from the nmap scripting engine? For this, just include the first part of the switch without the specification of what script to run.

# Para poder utilizar diferentes script desarrollados para nmap se utiliza la opcion:$ nmap --script nombre_script.nse xx.xx.xx.xx
$ nmap --script smb-os-discovery.nse xx.xx.xx.xx

# 14 What if I want to run all scripts out of the vulnerability category?

# NMAP tiene diferentes categorías y opciones utilizando scripts puedes revisarlos aqui.
$ nmap --script vuln xx.xx.xx.xx

#15 What switch should I include if I don’t want to ping the host?

# Para no hacer ping a un host tenemos 2 opciones:$ nmap -Pn xx.xx.xx.xx
$ nmap -P0 xx.xx.xx.xx

Nmap Scanning

#1 Let’s go ahead and start with the basics and perform a syn scan on the box provided. What will this command be without the host IP address?

# Nos pide realizar un escaneo de tipo syn scan anteriormente ya vimos esta opción y nos dice que introduzcamos el comando sin la IP.$ nmap -sS 

#2 After scanning this, how many ports do we find open under 1000?

Solo nos pregunta cuando puertos hay debajo del puerto 1000, después de escanear solo se encuentran 2 puertos abiertos.

#3 What communication protocol is given for these ports following the port number?

Ahora nos dice que protocolo de comunicacion estan usando estos puertos, y el protocolo utilizado es TCP.

#4 Perform a service version detection scan, what is the version of the software running on port 22?

Nos pide identificar la versión de puerto 22.

nmap -sV -p 22 xx.xx.xx.xx

Una vez haya terminado de ejecutarse podremos ver la version del puerto 22 SSH.

#5 Perform an aggressive scan, what flag isn’t set under the results for port 80?

Nos pide realizar un escaneo agresivo al puerto 80.

# Podemos realizar uno de estas opciones.$ nmap -A -p 80 xx.xx.xx.xx
$ nmap -sC -sV -p 80 xx.xx.xx.xx

En el resultado del escaneo se puede ver muchas opciones pero hay una cabecera que llama la atención, y es que la cabecera httponly no esta habilitado.

#6 Perform a script scan of vulnerabilities associated with this box, what denial of service (DOS) attack is this box susceptible to? Answer with the name for the vulnerability that is given as the section title in the scan output. A vuln scan can take a while to complete. In case you get stuck, the answer for this question has been provided in the hint, however, it’s good to still run this scan and get used to using it as it can be invaluable.

Nos pide encontrar el script que detecte la vulnerabilidad de DOS, por la version del servicio podemos buscar vulnerabilidades en exploit-db, o podemos ejecutar el comando:

nmap --script "http-*" -p 80 xx.xx.xx.xx

Lista de los script disponibles para nmap.

Una vez haya terminado de validar todos los scripts podremos observar los scripts que fueron efectivos en el objetivo, para este caso el host fue vulnerable a http-slowloris-check.

Happy Hacking.

--

--

CrhystamiL
CrhystamiL

Written by CrhystamiL

CEH, CyberSecurity Researcher,Ethical Hacker, GNU/Linux Lover.

No responses yet