-
Notifications
You must be signed in to change notification settings - Fork 0
Home
🇬🇧 English first · 🇪🇸 Español más abajo.
A 128-line Python script that simulates a port scan, turns the open ports into prioritised findings and writes a report a non-technical reader can act on. The value is in the triage and the write-up, not in the scanning.
Repo: mindset-code/project-vulnerability-scanner
- Como funciona el scanner — the three functions, the ports and how a finding is raised
- Reportes generados — what the Markdown report and the JSON actually contain
It does not touch the network. There is no socket, no nmap, no packet. simulate_nmap_scan() walks a dictionary of eight ports and marks each one open with a 40% probability:
if random.random() < 0.4:
open_ports[port] = serviceThat is deliberate and it is stated here rather than implied, because a portfolio project that claims to scan and does not is worth less than one that says what it does. Two consequences follow:
- Every run gives a different result. There is no seed. The same target produces different open ports and a different report each time.
-
The target is fixed at
192.168.1.100, a constant at the top of the file. It takes no argument.
What it does do — and what the exercise is about — is the part that comes after a scan: deciding which open port matters, why, at what severity, and how to write it so somebody who does not read port numbers can act on it.
flowchart LR
A["simulate_nmap_scan()<br/>8 ports, 40% each"] --> B["analyze_vulnerabilities()<br/>rules per port"]
B --> C["generate_report()<br/>Markdown, 4 sections"]
B --> D["raw_scan_data.json<br/>written in __main__"]
python scanner.pyNo dependencies beyond the standard library — random, datetime, json. It
writes two files into the working directory: vulnerability_report.md and
raw_scan_data.json.
The triage criteria — plaintext protocols first, exposed management services next, missing encryption after that — follow the reasoning taught in the ISC2 Certified in Cybersecurity (CC) Security Operations domain. The script does not compute CVSS scores: severities are assigned as fixed labels by rule, and saying otherwise would overstate what the code does.
Un script de Python de 128 líneas que simula un escaneo de puertos, convierte los puertos abiertos en hallazgos priorizados y escribe un informe sobre el que puede actuar alguien que no es técnico. El valor está en el triaje y en la redacción, no en el escaneo.
Repo: mindset-code/project-vulnerability-scanner
- Como funciona el scanner — las tres funciones, los puertos y cómo se levanta un hallazgo
- Reportes generados — qué contienen de verdad el informe Markdown y el JSON
No toca la red. No hay socket, ni nmap, ni un paquete. simulate_nmap_scan()
recorre un diccionario de ocho puertos y marca cada uno como abierto con una
probabilidad del 40 %.
Es deliberado, y se dice aquí en vez de dejarlo intuir, porque un proyecto de portafolio que dice escanear y no escanea vale menos que uno que dice lo que hace. De ahí se siguen dos cosas:
- Cada ejecución da un resultado distinto. No hay semilla. El mismo objetivo produce otros puertos abiertos y otro informe cada vez.
-
El objetivo está fijo en
192.168.1.100, una constante en la cabecera del fichero. No acepta ningún argumento.
Lo que sí hace, y de lo que va el ejercicio, es la parte que viene después de un escaneo: decidir qué puerto abierto importa, por qué, con qué severidad, y redactarlo para que alguien que no lee números de puerto pueda actuar.
Ver el diagrama de arriba: se simulan los puertos, se analizan por reglas, y de ahí salen el informe en Markdown y el JSON.
python scanner.pySin dependencias más allá de la biblioteca estándar — random, datetime y
json. Escribe dos ficheros en el directorio de trabajo:
vulnerability_report.md y raw_scan_data.json.
Los criterios de triaje —primero los protocolos en texto plano, después los servicios de administración expuestos y luego la falta de cifrado— siguen el razonamiento del dominio Security Operations de la certificación ISC2 Certified in Cybersecurity (CC). El script no calcula puntuaciones CVSS: las severidades se asignan como etiquetas fijas por regla, y decir otra cosa sería atribuirle al código más de lo que hace.