**Analizando el ministerio de asuntos exteriores de china**
nslookup www.mfa.gov.cn
Server: 127.0.0.53
Address: 127.0.0.53#53
Non-authoritative answer:
www.mfa.gov.cn canonical name = www.mfa.gov.cn.wswebpic.com.
Name: www.mfa.gov.cn.wswebpic.com
Address: 61.110.222.63
Name: www.mfa.gov.cn.wswebpic.com
Address: 138.113.148.176
El dominio apunta a 2 servidores / 2 ips para distribuir la carga, si falla uno el tráfico se redirige al otro\\
Para saber a qué ip estamos accediendo\\
curl -v www.mfa.gov.cn
* Trying 61.110.222.63:80...
* Connected to www.mfa.gov.cn (61.110.222.63) port 80 (#0)
> GET / HTTP/1.1
> Host: www.mfa.gov.cn
> User-Agent: curl/7.81.0
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 302 Moved Temporarily
< Date: Sun, 23 Feb 2025 20:27:41 GMT
< Content-Type: application/octet-stream
< Content-Length: 0
< Connection: keep-alive
< Server: Cdn Cache Server V2.0
< Location: https://www.mfa.gov.cn/
< X-Via: 1.0 VM-MXP-01JTu31:2 (Cdn Cache Server V2.0)
< x-ws-request-id: 67bb84bd_VM-MXP-01LHX142_17300-17169
< Set-Cookie: HMF_CI=1160b3bae6b803999182d83bac320dfb8cb231e8155c1aa9bfbe1d7304731d34558954a8f28e18fe6e189bc986641345a92e7eb4df3d2480fc5ee5a938e9f902dc; Expires=Tue, 25-Mar-25 20:27:41 GMT; Path=/
<
* Connection #0 to host www.mfa.gov.cn left intact
-sV: Información de servicio, versión\\
-O: Detección de sistema operativo\\
-Pn: No realizamos descubrimiento de host mediante ping porque ya sabemos que está activo, si no ponemos ésta opción y el host no responde a pings, nmap no continuará con el escaneo\\
sudo nmap -sV -O -Pn www.mfa.gov.cn > nmap_cn.txt
cat nmap_cn.txt | grep open
80/tcp open http nginx
81/tcp open http nginx
82/tcp open http nginx
83/tcp open http nginx
84/tcp open http nginx
85/tcp open http nginx
88/tcp open http nginx
89/tcp open http nginx
90/tcp open http nginx
111/tcp open http nginx
443/tcp open ssl/http nginx
444/tcp open ssl/http nginx
800/tcp open http nginx
808/tcp open http nginx
843/tcp open http nginx
888/tcp open http nginx
1000/tcp open http nginx
1024/tcp open http nginx
1058/tcp open http nginx
1066/tcp open http nginx
1080/tcp open http nginx
1085/tcp open http nginx
1086/tcp open http nginx
1090/tcp open http nginx
1111/tcp open http nginx
1433/tcp open http nginx
1443/tcp open ssl/http nginx
1723/tcp open pptp?
1801/tcp open http nginx
1863/tcp open http nginx
1935/tcp open http nginx
2000/tcp open ssl/http nginx
2001/tcp open http nginx
2002/tcp open http nginx
2003/tcp open http nginx
2004/tcp open http nginx
2005/tcp open http nginx
2006/tcp open http nginx
2007/tcp open http nginx
2008/tcp open http nginx
2009/tcp open http nginx
2020/tcp open http nginx
2021/tcp open http nginx
2030/tcp open http nginx
2033/tcp open http nginx
2099/tcp open http nginx
2323/tcp open 3d-nfsd?
3000/tcp open http nginx
3001/tcp open http nginx
3011/tcp open http nginx
3013/tcp open http nginx
3031/tcp open http nginx
3052/tcp open http nginx
4002/tcp open http nginx
4003/tcp open http nginx
4004/tcp open http nginx
4111/tcp open http nginx
4343/tcp open http nginx
4443/tcp open ssl/http nginx
4445/tcp open http nginx
4899/tcp open http nginx
5000/tcp open http nginx
5001/tcp open http nginx
5002/tcp open http nginx
5003/tcp open http nginx
5004/tcp open http nginx
5009/tcp open http nginx
5030/tcp open http nginx
5050/tcp open http nginx
5080/tcp open http nginx
5100/tcp open http nginx
5101/tcp open http nginx
5190/tcp open http nginx
5222/tcp open http nginx
5280/tcp open http nginx
5555/tcp open http nginx
5566/tcp open http nginx
5666/tcp open http nginx
5678/tcp open http nginx
5850/tcp open http nginx
5999/tcp open http nginx
6000/tcp open http nginx
6001/tcp open http nginx
6003/tcp open http nginx
6005/tcp open http nginx
6101/tcp open http nginx
6106/tcp open http nginx
6502/tcp open http nginx
6510/tcp open http nginx
6699/tcp open http nginx
7000/tcp open ssl/http nginx
7001/tcp open http nginx
7002/tcp open http nginx
7004/tcp open http nginx
7007/tcp open http nginx
7070/tcp open http nginx
7100/tcp open http nginx
7200/tcp open http nginx
7443/tcp open ssl/http nginx
7777/tcp open http nginx
7778/tcp open http nginx
7800/tcp open http nginx
7920/tcp open http nginx
7999/tcp open http nginx
8000/tcp open http nginx
8001/tcp open http nginx
8002/tcp open http nginx
8007/tcp open http nginx
8008/tcp open http nginx
8009/tcp open http nginx
8010/tcp open http nginx
8011/tcp open http nginx
8022/tcp open http nginx
8031/tcp open http nginx
8042/tcp open http nginx
8080/tcp open http nginx
8081/tcp open http nginx
8082/tcp open http nginx
8083/tcp open http nginx
8084/tcp open http nginx
8085/tcp open http nginx
8086/tcp open http nginx
8087/tcp open http nginx
8088/tcp open http nginx
8089/tcp open http nginx
8090/tcp open http nginx
8093/tcp open http nginx
8099/tcp open http nginx
8100/tcp open http nginx
8180/tcp open http nginx
8181/tcp open http nginx
8200/tcp open http nginx
8222/tcp open http nginx
8300/tcp open http nginx
8383/tcp open http nginx
8400/tcp open http nginx
8443/tcp open ssl/http nginx
8500/tcp open http nginx
8600/tcp open http nginx
8701/tcp open http nginx
8800/tcp open http nginx
8888/tcp open http nginx
8899/tcp open http nginx
9000/tcp open http nginx
9001/tcp open http nginx
9002/tcp open http nginx
9003/tcp open http nginx
9009/tcp open http nginx
9010/tcp open http nginx
9011/tcp open http nginx
9040/tcp open http nginx
9050/tcp open http nginx
9071/tcp open http nginx
9080/tcp open http nginx
9081/tcp open http nginx
9090/tcp open http nginx
9091/tcp open http nginx
9099/tcp open http nginx
9100/tcp open jetdirect?
9101/tcp open jetdirect?
9102/tcp open jetdirect?
9103/tcp open jetdirect?
9110/tcp open http nginx
9111/tcp open http nginx
9200/tcp open http nginx
9207/tcp open http nginx
9220/tcp open http nginx
9290/tcp open http nginx
9485/tcp open http nginx
9500/tcp open http nginx
9502/tcp open http nginx
9503/tcp open http nginx
9535/tcp open http nginx
9575/tcp open http nginx
9618/tcp open http nginx
9666/tcp open http nginx
9876/tcp open http nginx
9877/tcp open http nginx
9878/tcp open http nginx
9900/tcp open http nginx
9917/tcp open http nginx
9929/tcp open http nginx
9943/tcp open http nginx
9944/tcp open http nginx
9998/tcp open http nginx
9999/tcp open http nginx
10000/tcp open http nginx
10001/tcp open http nginx
10002/tcp open http nginx
10003/tcp open http nginx
10004/tcp open http nginx
10012/tcp open http nginx
10082/tcp open http nginx
10215/tcp open http nginx
10566/tcp open http nginx
10621/tcp open http nginx
12345/tcp open http nginx
14000/tcp open http nginx
14441/tcp open http nginx
14442/tcp open http nginx
15000/tcp open http nginx
15002/tcp open http nginx
15660/tcp open http nginx
15742/tcp open http nginx
16000/tcp open http nginx
16113/tcp open http nginx
17877/tcp open http nginx
18040/tcp open http nginx
18101/tcp open http nginx
20000/tcp open http nginx
20005/tcp open http nginx
20031/tcp open http nginx
31038/tcp open http nginx
50000/tcp open http nginx
50003/tcp open http nginx
55555/tcp open http nginx
58080/tcp open http nginx
60443/tcp open ssl/http nginx
65000/tcp open http nginx
65129/tcp open http nginx
{{ :china:nmap_cn.txt.gz |}}\\
gunzip -c nmap_cn.txt.gz | grep filtered
25/tcp filtered smtp
139/tcp filtered netbios-ssn
Gran cantidad aplicaciones y servicios web asociados a nginx, 25 (SMTP) y 139 (NetBIOS) pueden estar bloqueados por un firewall al estar marcados como filtered\\
Creamos un fichero con los puertos\\
gunzip -c nmap_cn.txt.gz | grep -Eo '^[0-9]+[^\/| $]' > puertos_mfa_cn.txt
Damos la lista de puertos a una ia a ver que dice:
^Puerto/s^Descripción^
|25|SMTP (Simple Mail Transfer Protocol)|
|80|HTTP (HyperText Transfer Protocol)|
|81-85|Servidores web alternativos|
|88|Kerberos (Autenticación)|
|89-90|Servidores web o aplicaciones varias|
|111|RPC (Remote Procedure Call)|
|139|NetBIOS Session Service|
|443|HTTPS (HTTP seguro)|
|444|Simple Network Paging Protocol (SNPP)|
|843|Adobe Flash Policy Server|
|1000|Generalmente usado por aplicaciones personalizadas|
|1024|Puerto asignado dinámicamente|
|1058|nim|
|1066|FPO-FNS|
|1080|SOCKS Proxy|
|1085-1086|WebObjects, diversas aplicaciones|
|1090|Java Remote Method Invocation (RMI)|
|1111|LM Social Server|
|1433|Microsoft SQL Server|
|1443|Secure Database Communication|
|1723|PPTP (Point-to-Point Tunneling Protocol)|
|1801|MSMQ (Microsoft Message Queue)|
|1863|Windows Live Messenger|
|1935|RTMP (Real-Time Messaging Protocol, streaming de video)|
|2000-2009|Cisco SCCP, Troncal VoIP, y otros servicios de red|
|2020|Xinupageserver|
|2021|FTP alternativo|
|2030|Oracle Services|
|2099|Adaptive Security Appliance (ASA)|
|2323|Telnet alternativo|
|3000|Ruby on Rails, Node.js Express, Jupyter Notebook|
|3001-3031|Aplicaciones varias, desarrollo|
|3052|PowerChute Network|
|4002-4004|Aplicaciones varias|
|4111|Xgrid|
|4343|Unused oficialmente, usado para HTTP alternativo|
|4443|HTTPS alternativo|
|4445|Unused oficialmente|
|4899|Radmin (Remote Administration)|
|5000|UPnP, Docker, Synology NAS|
|5001-5004|RTP (Real-time Transport Protocol), Synology NAS|
|5009|Apple Airport Admin Utility|
|5030|Aplicaciones varias|
|5050|Yahoo! Messenger|
|5080|HTTP alternativo|
|5100-5101|Aplicaciones varias|
|5190|AOL Instant Messenger|
|5222|XMPP (Jabber)|
|5280|Ejabberd (XMPP web admin)|
|5555|Android Debug Bridge (ADB)|
|5566|CloudApp Proxy|
|5666|NRPE (Nagios Remote Plugin Executor)|
|5678|Generalmente usado por routers|
|5850|Aplicaciones varias|
|5999|CVSup|
|6000|X11 (servidor gráfico)|
|6001-6005|Variantes X11|
|6101|Backdoor WinCrash|
|6106|MPS|
|6502|Netop Remote Control|
|6510|Versant Object Database|
|6699|Napster|
|7000-7007|Servidores IRC, Viruses, Terminal Services|
|7070|RealServer Streaming|
|7100|X Font Server|
|7200|Oracle WebLogic Server|
|7443|HTTPS alternativo|
|7777-7778|Unreal Tournament Server, servicios varios|
|7800|Crossloop|
|7920|Cisco IP Phones|
|7999|iRDMI|
|8000|Shoutcast, HTTP alternativo|
|8001-8009|Servidores web alternativos, Tomcat|
|8010-8011|Aplicaciones varias|
|8022|SSH alternativo|
|8031, 8042|Aplicaciones varias|
|8080|HTTP alternativo, proxy|
|8081-8089|Servidores web alternativos|
|8090|HTTP alternativo|
|8093, 8099, 8100|Aplicaciones varias|
|8180-8181|HTTP alternativo|
|8200|MiniDLNA|
|8222|VMware Server|
|8300|Servidor de medios|
|8383|HTTPS alternativo|
|8400|Servidores web|
|8443|HTTPS alternativo|
|8500|ColdFusion Server|
|8600|Servidores de red|
|8701|Servicio de autenticación|
|8800|HTTP alternativo|
|8888|HTTP alternativo, Jupyter Notebook|
|8899|Servidores varios|
|9000|SonarQube, Servidores varios|
|9001|Tor Relay|
|9002-9009|Aplicaciones varias|
|9010-9011|Secure Web Server|
|9040|Tor SOCKS Proxy|
|9050|Tor SOCKS Proxy|
|9071|Servidores varios|
|9080|HTTP alternativo|
|9081|Servidores varios|
|9090-9091|HTTP alternativo|
|9099|Servidores varios|
|9100|Impresoras en red (JetDirect)|
|9101-9103|Aplicaciones varias|
|9110-9111|Aplicaciones varias|
|9200|Elasticsearch|
|9207, 9220, 9290|Aplicaciones varias|
|9485|Servidores varios|
|9500-9535|Aplicaciones varias|
|9575, 9618, 9666|Aplicaciones varias|
|9876-9878|Aplicaciones varias|
|9900|Servidores web|
|9917, 9929|Aplicaciones varias|
|9943-9944|Aplicaciones varias|
|9998-9999|Servidores web|
|10000|Webmin|
|10001-10004|Aplicaciones varias|
|10012, 10082|Aplicaciones varias|
|10215|Aplicaciones varias|
|10566, 10621|Aplicaciones varias|
|12345|NetBus (Troyano)|
|14000|Aplicaciones varias|
|14441-14442|Aplicaciones varias|
|15000-15002|Aplicaciones varias|
|15660, 15742|Aplicaciones varias|
|16000, 16113|Aplicaciones varias|
|17877, 18040, 18101|Aplicaciones varias|
|20000, 20005, 20031|Aplicaciones varias|
|31038|Aplicaciones varias|
|50000, 50003|Aplicaciones varias|
|55555|Aplicaciones varias|
|58080|HTTP alternativo|
|60443|HTTPS alternativo|
|65000, 65129|Aplicaciones varias|
Preguntamos a la ia cuales son los más vulnerables\\
**Puertos altamente vulnerables**\\
^Puerto/s^Descripción^
|25 (SMTP)|Vulnerable a ataques de spam, relay abierto y phishing.|
|80 (HTTP)|Expuesto a ataques como inyección SQL, XSS, y exploits de servidores web.|
|443 (HTTPS)|Aunque más seguro que HTTP, puede ser vulnerable a ataques TLS/SSL como POODLE o Heartbleed.|
|139 (NetBIOS) y 445 (SMB, no listado)|Vulnerables a ataques como EternalBlue (usado en WannaCry).|
|1080 (SOCKS Proxy)|Puede ser usado para tunneling malicioso y anonimato en ataques.|
|1433 (Microsoft SQL Server)|Blanco de ataques de fuerza bruta y exploits de inyección SQL.|
|1723 (PPTP VPN)|Tiene vulnerabilidades en el cifrado MPPE (débil).|
|1863 (MSN Messenger)|Descontinuado, potencialmente usado por malware.|
|2000-2002 (Cisco SCCP, Troncal VoIP)|Explotables en ataques VoIP y de intercepción.|
|2323 (Telnet alternativo)|Similar al 23 (Telnet), vulnerable a tráfico en texto plano y ataques de credenciales.|
|3389 (RDP, no listado)|Comúnmente atacado con fuerza bruta y exploits como BlueKeep.|
|4899 (Radmin, Remote Admin)|Objetivo frecuente de ataques de fuerza bruta.|
|5000 (UPnP)|UPnP tiene fallos de seguridad que pueden permitir redirección de puertos o ataques DDoS.|
|5050 (Yahoo Messenger)|Descontinuado, potencialmente vulnerable a exploits.|
|5222 (XMPP/Jabber)|Puede ser explotado para abusar de la mensajería en tiempo real.|
|5555 (ADB, Android Debug Bridge)|Permite acceso remoto a dispositivos Android si está abierto.|
|5900 (VNC, no listado)|Comúnmente atacado por fuerza bruta para acceso remoto.|
|6000 (X11)|Si no está restringido, permite ataques remotos en entornos gráficos Linux.|
|6667 (IRC, no listado)|Usado en botnets para C2 (Command & Control).|
|7777-7778 (Unreal Tournament Server, otros servicios)|A veces usados por malware como troyanos.|
|8000-8080 (HTTP alternativos, proxies)|Usados en ataques proxy abiertos.|
|8443 (HTTPS alternativo)|Similar al 443, pero a veces con menos protección.|
|8888 (Jupyter Notebook, HTTP alternativo)|Si está mal configurado, permite ejecución remota de código.|
|9001 (Tor Relay)|Puede ser usado para tráfico malicioso si se deja abierto.|
|9050 (Tor SOCKS Proxy)|Puede ser explotado para anonimato en ataques.|
|9100 (Impresoras en red, JetDirect)|Vulnerable a ataques de inyección de comandos.|
|9200 (Elasticsearch)|Vulnerable si no tiene autenticación, puede permitir acceso no autorizado a datos.|
|12345 (NetBus, Troyano)|Puerto históricamente usado por malware para control remoto.|
-sV: Información de servicio, versión\\
-O: Detección de sistema operativo\\
-Pn: No realizamos descubrimiento de host mediante ping porque ya sabemos que está activo, si no ponemos ésta opción y el host no responde a pings, nmap no continuará con el escaneo\\
-oA: Da el resultado del escaner en formato nmap, gnmap y xml\\
sed -z 's/\n/,/g': Elimina los saltos de línea y pone los puertos en una línea separados por ,\\
--script "vuln and not intrusive": elegimos los scripts nse que más convengan para escanear, [[https://nmap.org/book/man-nse.html|opciones nse]]
sudo nmap -sV -Pn -O -p $(cat puertos_mfa_cn.txt | sed -z 's/\n/,/g') --script "vuln and not intrusive" www.mfa.gov.cn -oA nmap_vuln_cn
{{ :china:nmap_vuln_cn.tar.gz |}}
probamos:\\
sudo nmap -Pn -p $(cat puertos_mfa_cn.txt | sed -z 's/\n/,/g') -sV --version-all www.mfa.gov.cn -oN detalles_servicios_cn
pero no da ningún detalle que no hayamos visto anteriormente\\
Probamos pero con scripts vuln aunque sean intrusivos, y sólo los puertos más vulnerables de la lista anterior\\
sudo nmap -sV -Pn -O -p $(cat puertos_vuln_cn.txt | sed -z 's/\n/,/g') --script "vuln" www.mfa.gov.cn -oA nmap_puertos_vuln_mfa_cn
{{ :china:nmap_puertos_vuln_mfa_cn.tar.gz |}}
su contenido\\
tar -tf nmap_puertos_vuln_mfa_cn.tar.gz
nmap_puertos_vuln_mfa_cn.gnmap
nmap_puertos_vuln_mfa_cn.nmap
nmap_puertos_vuln_mfa_cn.xml
puertos_vuln_cn.txt
**Vulnerabilidades encontradas en diversos puertos / servicios**\\
cat nmap_puertos_vuln_mfa_cn.nmap | sed -n '/VULNERABLE:/{n;p};/CVE:/p' | sort | uniq
| IDs: CVE:CVE-2007-6750
| Cross-domain and Client Access policies.
| Slowloris DOS attack
**Había un puerto del troyano netbus y nmap tiene scripts para eso**\\
ls -1 /usr/share/nmap/scripts/ | grep -i netbus
netbus-auth-bypass.nse
netbus-brute.nse
netbus-info.nse
netbus-version.nse
sudo nmap -sV --version-all -Pn -O -p 12345 --script "netbus-*" www.mfa.gov.cn
Starting Nmap 7.80 ( https://nmap.org ) at 2025-02-24 21:59 CET
Nmap scan report for www.mfa.gov.cn (61.110.222.63)
Host is up (0.061s latency).
Other addresses for www.mfa.gov.cn (not scanned): 138.113.148.176
PORT STATE SERVICE VERSION
12345/tcp open http nginx
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose
Running: Linux 2.6.X
OS CPE: cpe:/o:linux:linux_kernel:2.6
OS details: Linux 2.6.18 - 2.6.22
Network Distance: 14 hops
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 80.01 seconds
No encontramos ninguna vulnerabilidad en ese puerto, pero extraemos que Linux 2.6.18 - 2.6.22 es una versión muy antigua del kernel, 2006-2007\\
searchsploit Linux | grep -Ei '.*kernel.*2\.6.*remote.*'
Linux Kernel 2.6.17.7 - NFS and EXT3 Combination Remote Denial of Service | linux/dos/28358.txt
Linux Kernel 2.6.20/2.6.24/2.6.27_7-10 (Ubuntu 7.04/8.04/8.10 / Fedora Core 10 / OpenSuse 1 | linux/remote/8556.c
Linux Kernel 2.6.21.1 - IPv6 Jumbo Bug Remote Denial of Service | linux/dos/4893.c
Linux Kernel 2.6.22 - IPv6 Hop-By-Hop Header Remote Denial of Service | linux/dos/30902.c
Linux Kernel 2.6.33.3 - SCTP INIT Remote Denial of Service | linux/dos/14594.py
Linux Kernel 2.6.35 - Network Namespace Remote Denial of Service | linux/dos/36425.txt
Linux Kernel 2.6.36 IGMP - Remote Denial of Service | linux/dos/18378.c
Linux Kernel 2.6.x - IPTables Logging Rules Integer Underflow Remote (PoC) | linux/dos/24696.c
Linux Kernel < 2.6.16.18 - Netfilter NAT SNMP Module Remote Denial of Service | linux/dos/1880.c
Linux Kernel < 2.6.30.5 - 'cfg80211' Remote Denial of Service | linux/dos/9442.c
Linux/MIPS Kernel 2.6.36 - 'NetUSB' Remote Code Execution
**Basándonos en la versión puede interesar:**\\
Linux Kernel < 2.6.30.5 - 'cfg80211' Remote Denial of Service\\
Linux Kernel 2.6.x - IPTables Logging Rules Integer Underflow Remote (PoC)\\