Nmap Übersicht: Unterschied zwischen den Versionen

Aus Xinux Wiki
Zur Navigation springen Zur Suche springen
(Die Seite wurde neu angelegt: „=Absicherung von Webdiensten mit 2FA: Zertifikat + Passwort= ==Voraussetzungen== ;Zertifikate * Eine eigene CA: ca.crt * Ein Server-Zertifikat: server.crt und…“)
 
Zeile 1: Zeile 1:
=Absicherung von Webdiensten mit 2FA: Zertifikat + Passwort=
+
{| class="wikitable"
 
+
! Befehl
==Voraussetzungen==
+
! Beschreibung
;Zertifikate
+
|-
* Eine eigene CA: ca.crt
+
| nmap <host>
* Ein Server-Zertifikat: server.crt und server.key
+
| Simple scan
* Ein Client-Zertifikat: client.crt und client.key
+
|-
 
+
| nmap -v <host>
;Benutzer
+
| Verbose mode
* Ein Benutzerkonto für HTTP-Basic-Auth
+
|-
 
+
| nmap -vv <host>
==Benutzer anlegen==
+
| Increased verbose mode
*htpasswd -c /etc/nginx/.htpasswd xinux
+
|-
 
+
| nmap -sS <host>
==NGINX-Konfiguration==
+
| TCP scan
server {
+
|-
    listen 443 ssl;
+
| nmap -sU <host>
    server_name secure.lab.intern;
+
| UDP scan
 
+
|-
    ssl_certificate /etc/nginx/ssl/server.crt;
+
| nmap sn <network>
    ssl_certificate_key /etc/nginx/ssl/server.key;
+
| Scan without sending packets
 
+
|-
    ssl_client_certificate /etc/nginx/ssl/ca.crt;
+
| nmap sp <network>
    ssl_verify_client on;
+
| Host discovery
 
+
|-
    ssl_protocols TLSv1.2 TLSv1.3;
+
| nmap-open <network>
 
+
| Hosts with open ports
    location / {
+
|-
        auth_basic "Login mit Benutzername und Passwort";
+
| nmap -Pn <host>
        auth_basic_user_file /etc/nginx/.htpasswd;
+
| Ping scan
 
+
|-
        root /var/www/html;
+
| nmap <start_ip>-<end_ip>
        index index.html;
+
| Range of IP addresses
    }
+
|-
}
+
| nmap -p <host>
 
+
| All ports
==Zertifikat im Firefox einbinden==
+
|-
;Import
+
| nmap -p 1-1000 <host>
* Firefox → Einstellungen → Datenschutz & Sicherheit → Zertifikate anzeigen
+
| 1000 most common ports
* Reiter "Ihre Zertifikate" → Importieren → client.p12
+
|-
 
+
| nmap -sC <host>
;Verwendung
+
| Script scan
* Seite aufrufen: https://secure.lab.intern
+
|-
* Firefox fragt nach Zertifikat → dann HTTP-Login
+
| nmap -sV <host>
 
+
| Services and versions
==Test==
+
|-
;Kein Zertifikat
+
| nmap -SCV <host>
* Fehler 400
+
| Complete scan
 
+
|-
;Falsches Passwort
+
| nmap -O <host>
* Fehler 401
+
| Operating systems
 
+
|-
;Zertifikat + Passwort korrekt
+
| nmap -A <host>
* Zugriff erlaubt
+
| Operating system and services
 +
|-
 +
| nmap -T5 -F <host>
 +
| Fast scan of 100 ports
 +
|-
 +
| nmap -T1 <host>
 +
| Slow scan (avoid IDS)
 +
|-
 +
| nmap -script vuln <host>
 +
| Vulnerability scan
 +
|-
 +
| nmap -script <script> <host>
 +
| Use specific scripts
 +
|-
 +
| nmap -stats-every 30s <host>
 +
| Statistics every 30 seconds
 +
|-
 +
| nmap --min-rate 1000 <host>
 +
| Minimum packet rate
 +
|-
 +
| nmap --top-ports 20 <host>
 +
| 20 most common ports
 +
|-
 +
| nmap -oX output.xml <host>
 +
| Export in XML
 +
|-
 +
| nmap -webxml <host>
 +
| Export in Web XML
 +
|}

Version vom 22. März 2025, 07:00 Uhr

Befehl Beschreibung
nmap <host> Simple scan
nmap -v <host> Verbose mode
nmap -vv <host> Increased verbose mode
nmap -sS <host> TCP scan
nmap -sU <host> UDP scan
nmap sn <network> Scan without sending packets
nmap sp <network> Host discovery
nmap-open <network> Hosts with open ports
nmap -Pn <host> Ping scan
nmap <start_ip>-<end_ip> Range of IP addresses
nmap -p <host> All ports
nmap -p 1-1000 <host> 1000 most common ports
nmap -sC <host> Script scan
nmap -sV <host> Services and versions
nmap -SCV <host> Complete scan
nmap -O <host> Operating systems
nmap -A <host> Operating system and services
nmap -T5 -F <host> Fast scan of 100 ports
nmap -T1 <host> Slow scan (avoid IDS)
nmap -script vuln <host> Vulnerability scan
nmap -script <script> <host> Use specific scripts
nmap -stats-every 30s <host> Statistics every 30 seconds
nmap --min-rate 1000 <host> Minimum packet rate
nmap --top-ports 20 <host> 20 most common ports
nmap -oX output.xml <host> Export in XML
nmap -webxml <host> Export in Web XML