3º nmap -oA nmap_medios_af -iL medios.txt -A -T4 (tarda una media hora)
Se obtienen datos interesantes, como versiones muy antiguas, etc, aquí sólo voy a poner los puertos abiertos, el scan completo con todos los detalles se puede descargar del .tar.gz adjunto. Hay un scan aún más interesante con las vulnerabilidades en el otro fichero adjunto. El objetivo es debilitar dictaduras, no interesa que arreglen sus fallos pero sí que la gente aprenda y se interese en atacarles. Mejor intentar que el fallo no lo llegue a conocer el totalitario. Por eso mejor tener que registrarse para saberlo
cat nmap_medios_af.nmap | grep open
80/tcp open http cloudflare
443/tcp open ssl/https cloudflare
8080/tcp open http-proxy cloudflare
8443/tcp open ssl/https-alt cloudflare
21/tcp open ftp Pure-FTPd
22/tcp open ssh OpenSSH 7.4 (protocol 2.0)
25/tcp open smtp Exim smtpd 4.96.2
26/tcp open smtp Exim smtpd 4.96.2
53/tcp open domain ISC BIND 9.11.4-P2 (RedHat Enterprise Linux 7)
80/tcp open http Apache httpd
110/tcp open pop3 Dovecot pop3d
143/tcp open imap Dovecot imapd
443/tcp open ssl/http Apache httpd
587/tcp open smtp Exim smtpd 4.96.2
993/tcp open ssl/imap Dovecot imapd
995/tcp open ssl/pop3 Dovecot pop3d
3306/tcp open mysql MySQL 5.7.23-23
80/tcp open http Apache httpd 2.4.57 ((Unix) OpenSSL/1.0.2k-fips)
110/tcp open pop3 Dovecot pop3d
143/tcp open imap Dovecot imapd
443/tcp open ssl/ssl Apache httpd (SSL-only mode)
465/tcp open ssl/smtp Postfix smtpd
587/tcp open smtp Postfix smtpd
993/tcp open ssl/imaps?
995/tcp open ssl/pop3s?
2030/tcp open device2?
25/tcp open smtp Postfix smtpd
80/tcp open http Apache httpd 2.4.57 ((Unix) OpenSSL/1.0.2k-fips)
110/tcp open pop3 Dovecot pop3d
143/tcp open imap Dovecot imapd
443/tcp open ssl/ssl Apache httpd (SSL-only mode)
587/tcp open smtp Postfix smtpd
993/tcp open ssl/imaps?
2030/tcp open device2?
80/tcp open http hcdn
25/tcp open smtp Postfix smtpd
80/tcp open http Apache httpd 2.4.57 ((Unix) OpenSSL/1.0.2k-fips)
110/tcp open pop3 Dovecot pop3d
143/tcp open imap Dovecot imapd
465/tcp open ssl/smtp Postfix smtpd
587/tcp open smtp Postfix smtpd
993/tcp open ssl/imaps?
995/tcp open ssl/pop3s?
2030/tcp open tcpwrapped
25/tcp open tcpwrapped
80/tcp open http Apache httpd 2.4.57 ((Unix) OpenSSL/1.0.2k-fips)
110/tcp open tcpwrapped
143/tcp open tcpwrapped
443/tcp open ssl/ssl Apache httpd (SSL-only mode)
587/tcp open smtp Postfix smtpd
993/tcp open ssl/imaps?
995/tcp open ssl/pop3s?
2030/tcp open device2?
25/tcp open smtp Postfix smtpd
80/tcp open http Apache httpd 2.4.57 ((Unix) OpenSSL/1.0.2k-fips)
110/tcp open pop3 Dovecot pop3d
143/tcp open imap Dovecot imapd
443/tcp open ssl/ssl Apache httpd (SSL-only mode)
587/tcp open smtp Postfix smtpd
993/tcp open ssl/imaps?
21/tcp open ftp Pure-FTPd
22/tcp open ssh OpenSSH 7.4 (protocol 2.0)
25/tcp open smtp Exim smtpd 4.96.2
26/tcp open smtp Exim smtpd 4.96.2
53/tcp open domain ISC BIND 9.11.4-P2 (RedHat Enterprise Linux 7)
80/tcp open http Apache httpd
110/tcp open pop3 Dovecot pop3d
143/tcp open imap Dovecot imapd
443/tcp open ssl/http Apache httpd
465/tcp open ssl/smtp Exim smtpd 4.96.2
587/tcp open smtp Exim smtpd 4.96.2
993/tcp open ssl/imap Dovecot imapd
995/tcp open ssl/pop3 Dovecot pop3d
2222/tcp open ssh OpenSSH 7.4 (protocol 2.0)
3306/tcp open mysql MySQL 5.7.23-23
21/tcp open ftp ProFTPD or KnFTPD
80/tcp open http LiteSpeed
443/tcp open ssl/https LiteSpeed
3306/tcp open mysql MySQL 5.5.5-10.11.9-MariaDB
80/tcp open http Apache httpd 2.4.57 ((Unix) OpenSSL/1.0.2k-fips)
110/tcp open pop3 Dovecot pop3d
143/tcp open imap Dovecot imapd
465/tcp open ssl/smtp Postfix smtpd
587/tcp open smtp Postfix smtpd
993/tcp open tcpwrapped
2030/tcp open tcpwrapped
En el post anterior, Ips de zonas militares, se extrajeron de toda Rusia las ips asociadas a las ubicaciones geográficas de las 5500 zonas militares encontradas en osm, se hizo uso de la base de datos https://git.io/GeoLite2-City.mmdb y de los bloques ips asignados a Rusia de https://www.ipdeny.com/ipblocks/data/agg...gated.zone, después de procesar todos los datos se encontraron 6 áreas militares de las 5500 con miles de ips asignadas a cada 1, el resto no tiene ninguna asignada.
Esas 6 áreas suman un total de unas 20000 ips
1º Hacemos un masscan rápido (un ping) a esas 20000 ips que están en el fichero areas_con_ips.txt (del post anterior)
¿qué quiere decir ésto? que hemos encontrado 3 hosts activos en 1 de las 6 zonas militares y se puede empezar a jugar un poco, ésto no quiere decir que en las otras 5 zonas no haya ninguno, simplemente que no tienen esos puertos activos, tal vez tengan algún firewall, o quizás no haya hosts
4º si hacemos lo mismo con las 3 ips vemos que pertenecen a la misma zona militar
nmap -oA nmap_ips_militares -iL hosts.txt
Starting Nmap 7.80 ( https://nmap.org ) at 2024-12-04 21:06 CET
Nmap scan report for 79.174.46.10
Host is up (0.12s latency).
Not shown: 997 filtered ports
PORT STATE SERVICE
80/tcp open http
443/tcp open https
1723/tcp closed pptp
Nmap scan report for mx.e8company.ru (79.174.42.41)
Host is up (0.10s latency).
Not shown: 986 filtered ports
PORT STATE SERVICE
25/tcp open smtp
80/tcp open http
81/tcp open hosts2-ns
110/tcp open pop3
143/tcp open imap
443/tcp open https
444/tcp open snpp
445/tcp open microsoft-ds
465/tcp open smtps
587/tcp open submission
993/tcp open imaps
995/tcp open pop3s
1556/tcp closed veritas_pbx
50001/tcp open unknown
Nmap scan report for 79.174.46.22
Host is up (0.13s latency).
Not shown: 998 filtered ports
PORT STATE SERVICE
80/tcp open http
443/tcp open https
Nmap done: 3 IP addresses (3 hosts up) scanned in 490.28 seconds
y ahora a seguir jugando. ¿Y tu, encontraste algo más o tienes una idea mejor?
- Si se abre con josm zonas_militares_ru.osm se puede ver el mapa
Code:
"""
MIT License
Copyright (c) 2024 foro.acosadores.net
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
"""
import osmium
class WayHandler(osmium.SimpleHandler):
def __init__(self):
super().__init__()
self.nodes = {} # Para almacenar nodos (id -> (lat, lon))
self.results = [] # Para almacenar resultados por polígono
def node(self, n):
"""Guarda las coordenadas de los nodos"""
self.nodes[n.id] = (n.location.lat, n.location.lon)
def way(self, w):
"""Procesa cada 'way' y calcula coordenadas mínimas/máximas"""
latitudes = []
longitudes = []
for node_ref in w.nodes:
node_id = node_ref.ref
if node_id in self.nodes:
lat, lon = self.nodes[node_id]
latitudes.append(lat)
longitudes.append(lon)
# Si se han encontrado coordenadas, calcular los límites y el punto central
if latitudes and longitudes:
min_lat = min(latitudes)
max_lat = max(latitudes)
min_lon = min(longitudes)
max_lon = max(longitudes)
central_lat = (min_lat + max_lat) / 2
central_lon = (min_lon + max_lon) / 2
"""
for i, result in enumerate(handler.results, start=1):
print(f"Polígono {i}:")
print(f" Latitud mínima: {result['min_lat']}")
print(f" Latitud máxima: {result['max_lat']}")
print(f" Longitud mínima: {result['min_lon']}")
print(f" Longitud máxima: {result['max_lon']}")
print(f" Punto central (Lat, Lon): {result['central']}")
print()
"""
# Mostrar coordenadas de todos los polígonos
for i, result in enumerate(handler.results, start=1):
print(f"{result['min_lat']},{result['max_lat']},{result['min_lon']},{result['max_lon']}")
# Procesar archivo OSM
input_file = "zonas_militares_ru.osm"
process_osm_file(input_file)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
"""
import ipaddress
import geoip2.database
def load_areas(file_path):
"""Carga las áreas desde un archivo en formato lat_min,lat_max,lon_min,lon_max"""
areas = []
with open(file_path, 'r') as f:
for i, line in enumerate(f):
coords = line.strip().split(',')
if len(coords) == 4:
areas.append({
"lat_min": float(coords[0]),
"lat_max": float(coords[1]),
"lon_min": float(coords[2]),
"lon_max": float(coords[3]),
"output_file": f"area_{i+1}.txt" # Genera un nombre de archivo único
})
return areas
# Cargar las áreas desde el archivo
areas = load_areas("areas_ru.txt")
# Ruta a la base de datos GeoLite2
geoip_db_path = 'GeoLite2-City.mmdb'
def get_coordinates(ip):
"""Obtiene las coordenadas de una IP usando GeoLite2"""
try:
reader = geoip2.database.Reader(geoip_db_path)
response = reader.city(ip)
lat = response.location.latitude
lon = response.location.longitude
return lat, lon
except geoip2.errors.AddressNotFoundError:
print(f"IP {ip} no encontrada en la base de datos GeoLite2.")
return None, None
except Exception as e:
print(f"Error al obtener coordenadas para IP {ip}: {e}")
return None, None
def check_area(lat, lon, areas):
"""
Verifica si las coordenadas están dentro de alguna de las áreas definidas.
"""
for area in areas:
if (area["lat_min"] <= lat <= area["lat_max"] and
area["lon_min"] <= lon <= area["lon_max"]):
return True, area # Devuelve True y el área si coincide
return False, None # Devuelve False si no coincide con ninguna área
def process_cidr_blocks(ip_blocks_file):
"""Procesa el archivo con bloques CIDR"""
with open(ip_blocks_file, 'r') as file:
for line in file:
cidr = line.strip()
print(f"Procesando bloque: {cidr}")
# Procesar cada IP en el bloque CIDR
network = ipaddress.IPv4Network(cidr)
for ip in network.hosts():
lat, lon = get_coordinates(str(ip))
if lat is not None and lon is not None:
is_in_area, area = check_area(lat, lon,areas)
if is_in_area:
print(f"IP {ip} está dentro del área {area}.")
# Ejecutar el procesamiento de bloques CIDR
process_cidr_blocks('ru-aggregated.zone')
Una vez terminado el proceso, que tardará varios días o una semana (adjunto abajo el fichero en el tar.gz) obtenemos el fichero, sabemos que de las 5 mil y pico zonas militares sólo ha encontrado ips de 6 zonas militares mediante éste comando
En el post anterior conseguimos obtener las ip del Kremlin, una cantidad irracional para apenas 1 kilómetro cuadrado, es de suponer que no van a utilizar ni la centésima parte, probablemente ni la milésima, lo que nos interesa es saber cuales utilizan, los host activos. Para ello utilizamos la forma más rápida de escaneo que permite, según, cuanto mayor tengamos la banda ancha terminar antes.
Paso 1:
Descomprimir el fichero del post anterior:
Obtener de dónde es una dirección ip es fácil, también qué ips pertenecen a un país a través de https://www.ipdeny.com/ipblocks/, pero si lo que se quiere son las de una zona concreta es bastante más difícil, a pesar de estar en la base de datos GeoLite2-City la obtención es más compleja y mucho más lenta. Existen otras opciones, como shodan maps, RIPEstat o IP2Location Geolocator, pero no lo he conseguido así porque hay que registrarse, son servicios de pago o demo
wget https://git.io/GeoLite2-City.mmdb
instalar mmdblookup
mmdblookup --file GeoLite2-City.mmdb --ip 8.8.8.8
Esto devuelve una salida en formato .json con detalles como ciudad, región, país, latitud y longitud
Para poder hacer uso de ésta herramienta lo más fácil es crear un script en python y así poder extraer qué ips pertenecen a una zona:
Instalamos el módulo geoip2 para python
pip3 install geoip2.
Para poder obtener latitudes y longitudes, seleccionar bien y de manera fácil una zona geográfica, recomiendo utilizar josm, crear una capa en archivo/nueva capa, añadir un nodo en herramientas/añadir nodo, poner latitud y longitud y dar a descargar mapas (en el icono de la flecha verde hacia abajo) desde un servidor y ahí seleccionar la zona. Al mover el puntero por el cuadro seleccionado aparece latitud y longitud en la parte inferior
Code:
"""
MIT License
Copyright (c) 2024 foro.acosadores.net
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
"""
import geoip2.database
import ipaddress
# Archivo de la base de datos GeoLite2
MMDB_FILE = "GeoLite2-City.mmdb"
# Áreas de interés: define los límites de latitud y longitud para cada área
AREAS = [
{"lat_min": 55.7180, "lat_max": 55.7415, "lon_min": 37.1821, "lon_max": 37.2261, "output_file": "ips_obo_oropeso.txt"},
{"lat_min": 55.7477, "lat_max": 55.7560, "lon_min": 37.6106, "lon_max": 37.6255, "output_file": "ips_kremlin.txt"},
{"lat_min": 44.4158, "lat_max": 44.4306, "lon_min": 38.1968, "lon_max": 38.2066, "output_file": "ips_palacio.txt"}
]
# Archivo de entrada: bloques de IP en formato CIDR
IP_BLOCKS_FILE = "ru-aggregated.zone"
# Limpiar archivos de salida
for area in AREAS:
with open(area["output_file"], "w") as f:
pass
# Cargar la base de datos
reader = geoip2.database.Reader(MMDB_FILE)
def is_within_area(lat, lon, area):
"""Verifica si una coordenada está dentro del área definida."""
return area["lat_min"] <= lat <= area["lat_max"] and area["lon_min"] <= lon <= area["lon_max"]
def process_ip_block(block, areas):
"""Procesa un rango de IP y encuentra las IPs dentro de las áreas."""
results = {area["output_file"]: [] for area in areas}
for ip in ipaddress.IPv4Network(block, strict=False):
try:
# Consultar la base de datos para la IP
response = reader.city(str(ip))
lat = response.location.latitude
lon = response.location.longitude
# Verificar si lat o lon es None
if lat is None or lon is None:
print(f"IP {ip}: Latitud o longitud no disponibles.")
continue
# Verificar si la IP está dentro de alguna área
for area in areas:
if is_within_area(lat, lon, area):
print(f"IP {ip} está dentro del área: {area['output_file']}")
results[area["output_file"]].append(str(ip))
else:
print(f"IP {ip} está fuera del área: {area['output_file']}")
except geoip2.errors.AddressNotFoundError:
# Debug: IP no encontrada en la base de datos
print(f"IP {ip} no encontrada en la base de datos.")
continue
return results
# Leer los bloques de IP y procesar cada uno
with open(IP_BLOCKS_FILE, "r") as blocks:
for block in blocks:
block = block.strip()
if not block:
continue
print(f"Procesando bloque: {block}")
area_results = process_ip_block(block, AREAS)
# Escribir resultados en los archivos correspondientes
for output_file, ips in area_results.items():
with open(output_file, "a") as output:
for ip in ips:
output.write(ip + "\n")
print("IPs dentro de las áreas guardadas en los archivos correspondientes.")
Cosas curiosas:
No existen ips para las 2 zonas de las mansiones de Putin.
Sólo para la zona del Kremlin hay 3 millones y medio de ips, y para todo Moscú (contando el Kremlin) hay unas 25 millones de ip
git clone https://github.com/sherlock-project/sherlock.git
cd sherlock
Instalar Dependencias usando pyproject.toml, pip lo detectará, así:
python3 -m pip install .
ejecutar con sherlock usuario (el que se quiera rastrear)
o, si no funciona:
python3 sherlock_project/sherlock.py usuario
Buscarles por todas las redes sociales sería perder mucho tiempo, el siguiente comando creará un fichero con los resultados de sherlock:
sherlock $(cat mediosRusos.txt | sed -e '1,15d' | sed -e ':a;N;$!ba;s/\n/ /g') > sherlock_propagandistas.txt
El siguiente comando mapeará uno a uno, hasta 1tv.ru y generará 3 ficheros (scanMedios.gnmap,scanMedios.nmap y scanMedios.xml)
nmap -iL <(cat mediosRusos.txt | sed '15,$d') -oA scanMedios
Éste otro comando permite saber los distintos servicios que están operativos:
cat scanMedios.nmap | grep open | grep -v unknown | awk '{print $3}' | sort | uniq
........... así hasta unos 739, fácil suponer que con tantos se pueda sacar algo
Por suerte encontré una vulnerabilidad, pero eso lo dejo para otro post para usuarios registrados
Y esos últimos 4? Son nombres de usuario de propagandistas rusos que operan en twitter y se pueden usar para buscarles en más sitios con la herramienta Sherlock
sudo nmap -A -v 194.85.30.210
Starting Nmap 7.80 ( https://nmap.org ) at 2024-11-10 19:06 CET
NSE: Loaded 151 scripts for scanning.
NSE: Script Pre-scanning.
Initiating NSE at 19:06
Completed NSE at 19:06, 0.00s elapsed
Initiating NSE at 19:06
Completed NSE at 19:06, 0.00s elapsed
Initiating NSE at 19:06
Completed NSE at 19:06, 0.00s elapsed
Initiating Ping Scan at 19:06
Scanning 194.85.30.210 [4 ports]
Completed Ping Scan at 19:06, 0.20s elapsed (1 total hosts)
Initiating Parallel DNS resolution of 1 host. at 19:06
Completed Parallel DNS resolution of 1 host. at 19:06, 0.14s elapsed
Initiating SYN Stealth Scan at 19:06
Scanning web2.mid.ru (194.85.30.210) [1000 ports]
Discovered open port 443/tcp on 194.85.30.210
SYN Stealth Scan Timing: About 11.35% done; ETC: 19:11 (0:04:02 remaining)
Increasing send delay for 194.85.30.210 from 0 to 5 due to 11 out of 16 dropped probes since last increase.
SYN Stealth Scan Timing: About 33.85% done; ETC: 19:09 (0:01:59 remaining)
Increasing send delay for 194.85.30.210 from 5 to 10 due to 11 out of 17 dropped probes since last increase.
Increasing send delay for 194.85.30.210 from 10 to 20 due to 11 out of 13 dropped probes since last increase.
Increasing send delay for 194.85.30.210 from 20 to 40 due to 11 out of 11 dropped probes since last increase.
Completed SYN Stealth Scan at 19:09, 173.52s elapsed (1000 total ports)
Initiating Service scan at 19:09
Scanning 1 service on web2.mid.ru (194.85.30.210)
Completed Service scan at 19:09, 5.01s elapsed (1 service on 1 host)
Initiating OS detection (try #1) against web2.mid.ru (194.85.30.210)
Initiating Traceroute at 19:09
Completed Traceroute at 19:09, 9.07s elapsed
Initiating Parallel DNS resolution of 7 hosts. at 19:09
Completed Parallel DNS resolution of 7 hosts. at 19:10, 13.00s elapsed
NSE: Script scanning 194.85.30.210.
Initiating NSE at 19:10
Completed NSE at 19:10, 32.16s elapsed
Initiating NSE at 19:10
Completed NSE at 19:11, 60.87s elapsed
Initiating NSE at 19:11
Completed NSE at 19:11, 0.00s elapsed
Nmap scan report for web2.mid.ru (194.85.30.210)
Host is up (0.16s latency).
Not shown: 999 filtered ports
PORT STATE SERVICE VERSION
443/tcp open tcpwrapped
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: specialized|WAP|phone
Running: iPXE 1.X, Linux 2.4.X|2.6.X, Sony Ericsson embedded
OS CPE: cpe:/o:ipxe:ipxe:1.0.0%2b cpe:/o:linux:linux_kernel:2.4.20 cpe:/o:linux:linux_kernel:2.6.22 cpe:/honyericsson:u8i_vivaz
OS details: iPXE 1.0.0+, Tomato 1.28 (Linux 2.4.20), Tomato firmware (Linux 2.6.22), Sony Ericsson U8i Vivaz mobile phone
9 ...
10 150.06 ms equant.inet2.ru (85.112.122.71)
11 150.24 ms Moscow-GIN-PE04-et-5-0-0-0.rosprint.net (195.151.240.221)
12 ... 30
NSE: Script Post-scanning.
Initiating NSE at 19:11
Completed NSE at 19:11, 0.00s elapsed
Initiating NSE at 19:11
Completed NSE at 19:11, 0.00s elapsed
Initiating NSE at 19:11
Completed NSE at 19:11, 0.00s elapsed
Read data files from: /usr/bin/../share/nmap
OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 299.79 seconds
Raw packets sent: 2214 (100.400KB) | Rcvd: 72 (9.922KB)
Debido a la advertencia sobre la falta de puertos abiertos y cerrados, nmap no puede garantizar que esta identificación sea completamente precisa.
se muestran 3 ips asociadas al dominio, , lo que permite distribuir el tráfico entre múltiples servidores o proporcionar redundancia en caso de que uno falle.
Non-authoritative answer en la salida de nslookup significa que el servidor DNS que proporcionó la información no tiene control directo sobre el dominio consultado.
host kremlin.ru
kremlin.ru has address 95.173.136.72
kremlin.ru has address 95.173.136.70
kremlin.ru has address 95.173.136.71
kremlin.ru mail is handled by 10 mx4.gov.ru.
kremlin.ru mail is handled by 5 mx3.gov.ru.
el dominio kremlin.ru tiene 2 registros mx que indican los servidores que gestionan el correo para kremlin.ru, el número indica la prioridad, mx3.gov.ru la tiene más baja por lo que será utilizado antes que mx4.gov.ru
sudo nmap -A -v 95.173.136.70
Starting Nmap 7.80 ( https://nmap.org ) at 2024-11-10 20:38 CET
NSE: Loaded 151 scripts for scanning.
NSE: Script Pre-scanning.
Initiating NSE at 20:38
Completed NSE at 20:38, 0.00s elapsed
Initiating NSE at 20:38
Completed NSE at 20:38, 0.00s elapsed
Initiating NSE at 20:38
Completed NSE at 20:38, 0.00s elapsed
Initiating Ping Scan at 20:38
Scanning 95.173.136.70 [4 ports]
Completed Ping Scan at 20:38, 3.02s elapsed (1 total hosts)
Nmap scan report for 95.173.136.70 [host down]
NSE: Script Post-scanning.
Initiating NSE at 20:38
Completed NSE at 20:38, 0.00s elapsed
Initiating NSE at 20:38
Completed NSE at 20:38, 0.00s elapsed
Initiating NSE at 20:38
Completed NSE at 20:38, 0.00s elapsed
Read data files from: /usr/bin/../share/nmap
Note: Host seems down. If it is really up, but blocking our ping probes, try -Pn
Nmap done: 1 IP address (0 hosts up) scanned in 4.69 seconds
Raw packets sent: 8 (304B) | Rcvd: 0 (0B)
si hacemos lo mismo con los otros 2 sale lo mismo, sin embargo, la página web está accesible, luego está bloqueando el escaner. Esto es porque los paquetes pings enviados no recibieron respuesta pues bloquea ICMP. Así que usamos la opción -Pn que dice que no haga la comprobación de ping y pase directamente a escanear
sudo nmap -A -v -Pn 95.173.136.71
Starting Nmap 7.80 ( https://nmap.org ) at 2024-11-10 20:43 CET
NSE: Loaded 151 scripts for scanning.
NSE: Script Pre-scanning.
Initiating NSE at 20:43
Completed NSE at 20:43, 0.00s elapsed
Initiating NSE at 20:43
Completed NSE at 20:43, 0.00s elapsed
Initiating NSE at 20:43
Completed NSE at 20:43, 0.00s elapsed
Initiating Parallel DNS resolution of 1 host. at 20:43
Completed Parallel DNS resolution of 1 host. at 20:43, 0.04s elapsed
Initiating SYN Stealth Scan at 20:43
Scanning 95.173.136.71 [1000 ports]
Discovered open port 80/tcp on 95.173.136.71
Increasing send delay for 95.173.136.71 from 0 to 5 due to 11 out of 16 dropped probes since last increase.
SYN Stealth Scan Timing: About 53.80% done; ETC: 20:44 (0:00:30 remaining)
Increasing send delay for 95.173.136.71 from 5 to 10 due to 11 out of 13 dropped probes since last increase.
Completed SYN Stealth Scan at 20:45, 88.89s elapsed (1000 total ports)
Initiating Service scan at 20:45
Scanning 1 service on 95.173.136.71
Completed Service scan at 20:45, 6.23s elapsed (1 service on 1 host)
Initiating OS detection (try #1) against 95.173.136.71
Initiating Traceroute at 20:45
Completed Traceroute at 20:45, 3.17s elapsed
Initiating Parallel DNS resolution of 4 hosts. at 20:45
Completed Parallel DNS resolution of 4 hosts. at 20:45, 13.00s elapsed
NSE: Script scanning 95.173.136.71.
Initiating NSE at 20:45
Completed NSE at 20:45, 14.43s elapsed
Initiating NSE at 20:45
Completed NSE at 20:45, 0.41s elapsed
Initiating NSE at 20:45
Completed NSE at 20:45, 0.00s elapsed
Nmap scan report for 95.173.136.71
Host is up (0.097s latency).
Not shown: 998 filtered ports
PORT STATE SERVICE VERSION
80/tcp open http nginx
| http-methods:
|_ Supported Methods: HEAD
113/tcp closed ident
Device type: firewall
Running: Fortinet embedded
OS details: Fortinet FortiGate-50B or 310B firewall, Fortinet FortiGate-60B or -100A firewall
Network Distance: 14 hops
TRACEROUTE (using port 113/tcp)
HOP RTT ADDRESS
1 ...
14 117.64 ms 95.173.136.71
NSE: Script Post-scanning.
Initiating NSE at 20:45
Completed NSE at 20:45, 0.00s elapsed
Initiating NSE at 20:45
Completed NSE at 20:45, 0.00s elapsed
Initiating NSE at 20:45
Completed NSE at 20:45, 0.00s elapsed
Read data files from: /usr/bin/../share/nmap
OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 131.37 seconds
Raw packets sent: 2139 (96.852KB) | Rcvd: 28 (1.404KB)
El servidor web es nginx y la respuesta es limitada ya que sólo soporta el método HEAD, el firewall fortined fortigate está en uso, lo que podría hacer que algunos puertos estén filtrados o bloqueados durante el escaneo.
Nota es recomendable guardar la salida en un fichero de texto porque se pierde en el buffer de la terminal si es muy larga
nmap -A -v 192.168.1.0/24 > resultado.txt
Para guardar la salida y verla al mismo tiempo:
nmap -A -v 192.168.1.0/24 | tee resultado.txt
Opciones de guardado de nmap:
-oN: Guarda la salida en formato de texto
-oX: En formato XML
-oG: En formato grep
-oA: En todos los formatos
nmap -oX resultado.txt 192.168.0.1/24 (guarda la salida en formato xml)
nmap -oA res 192.168.0.1/24 (guarda la salida en texto, xml y grep, generando 3 archivos, res.nmap, res.gnmap,res.xml)
Escaneo completo y detallado de un rango de ips:
nmap -A -v 192.168.1.0/24 (2^8 = 256 ips que escanea hasta la 192.168.1.255)
Escaneo de puertos específicos:
nmap -p 22,80 192.168.1.0-50
Ping scan en un rango
nmap -sn 192.168.1.0/24
Descubrir ip asociada a dominio (poner sólo el nombre del dominio sin el prefijo https://
host foro.acosadores.net
nslookup foro.acosadores.net
dig +short foro.acosadores.net
ping -c 1 foro.acosadores.net
dnsenum foro.acosadores.net (registros A, MX (servidores de email), NS (servidores de nombre) y subdominios)
dnsenum -enum acosadores.net
host, nslookup y dig permiten relizar búsquedas inversas si la ip tiene un registro ptr configurado
Muchas veces el escaneo no detecta correctamente porque los isp o los firewall los detectan, sin embargo, a herramientas menos intrusivas como ping si que responden y que sólo usan ICMP Echo Request.
Para hacer que nmap envíe el mismo paquete que ping:
sudo nmap -sn -PE 192.168.1.1 > hosts_activos.txt
Para eliminar la línea 1 y última del archivo que pone nmap: