error extraño "(22 - 'Argumento no válido')" cuando se usa con IPv4

error extraño "(22 - 'Argumento no válido')" cuando se usa con IPv4

Tengo "(22 - 'Argumento no válido')" usandonmap . Busqué en Google y obtuvehttps://seclists.org/nmap-dev/, pero eso es hablar de IPv6 mientras tengo este error al usar IPv4. No menciona IPv4, entonces, ¿por qué recibo este extraño error?

Entré:

$ nmap --send-eth --release-memory --nsock-engine=epoll --allports --fuzzy \
     --randomize-hosts --log-errors  --max-os-tries=9 -n --reason          \
     --append-output --scanflags=URGACKPSHRSTSYNFIN --max-retries=6        \
     --host-timeout=225s --stats-every=10m --ttl=255 --min-hostgroup=5 .   \
     --max-hostgroup=25 --max-rtt-timeout=60s --scan-delay=250ms .         \
     --max-scan-delay=25s --stats-every=1 -v5 -sT -sV -A -p 80-82          \
     0.18.0.0

Y obtuve este resultado:

Starting Nmap 7.70 ( https://nmap.org ) at 2019-01-17 16:05 CET
NSE: Loaded 148 scripts for scanning.
NSE: Script Pre-scanning.
NSE: Starting runlevel 1 (of 2) scan.
Initiating NSE at 16:05
Completed NSE at 16:05, 0.00s elapsed
NSE: Starting runlevel 2 (of 2) scan.
Initiating NSE at 16:05
Completed NSE at 16:05, 0.00s elapsed
Initiating Ping Scan at 16:05
Scanning 0.18.0.0 [2 ports]
Stats: 0:00:01 elapsed; 0 hosts completed (0 up), 1 undergoing Ping Scan
Ping Scan Timing: About 0.00% done
Strange read error from 0.18.0.0 (22 - 'Invalid argument')
Strange read error from 0.18.0.0 (22 - 'Invalid argument')
Completed Ping Scan at 16:05, 0.50s elapsed (1 total hosts)
NSE: Script Post-scanning.
NSE: Starting runlevel 1 (of 2) scan.
Initiating NSE at 16:05
Completed NSE at 16:05, 0.00s elapsed
NSE: Starting runlevel 2 (of 2) scan.
Initiating NSE at 16:05
Completed NSE at 16:05, 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 1.46 seconds

Al intentar con menos argumentos nmap -p 80-82 0.18.0.0 obtuve:

Starting Nmap 7.70 ( https://nmap.org ) at 2019-01-17 16:24 CET
Strange read error from 0.18.0.0 (22 - 'Invalid argument')
Strange read error from 0.18.0.0 (22 - 'Invalid argument')
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 0.12 seconds

Al intentarlo ncatobtuve:

$ nc -vvv 0.18.0.0 80
0.18.0.0: inverse host lookup failed: Unknown host
(UNKNOWN) [0.18.0.0] 80 (http) : Invalid argument
 sent 0, rcvd 0

$ nc -vvv 0.18.0.0 81
0.18.0.0: inverse host lookup failed: Unknown host
(UNKNOWN) [0.18.0.0] 81 (hosts2-ns) : Invalid argument
 sent 0, rcvd 0

Todavía tengo un "argumento no válido", pero esta vez en lugar de 22 obtuve los números de publicación y el servicio:

80 (http)
81 (hosts2-ns)

Esto plantea algunas preguntas:

  1. ¿El "argumento no válido" de ncaty nmapse relaciona con lo mismo?
  2. ¿Cómo puedo hacer nmappara informativo en lugar de imprimir 22?
  3. ¿Cómo puedo decir que el puerto remoto está realmente CERRADO o está realmente ABIERTO y rechazado debido al firewall?

Respuesta1

DIRECCIÓN0.18.0.0(resp.0.0.0.0/8) no está permitido como dirección IP de destino por estándar™:

DeRFC 6890:

2.2.2. Entradas de registro de direcciones de propósito especial IPv4

Las tablas 1 a 16 a continuación representan las entradas con las que la IANA
llenó inicialmente el Registro de direcciones de propósito especial IPv4.

          +----------------------+----------------------------+
          | Attribute            | Value                      |
          +----------------------+----------------------------+
          | Address Block        | 0.0.0.0/8                  |
          | Name                 | "This host on this network"|
          | RFC                  | [RFC1122], Section 3.2.1.3 |
          | Allocation Date      | September 1981             |
          | Termination Date     | N/A                        |
          | Source               | True                       |
          | Destination          | False                      |
          | Forwardable          | False                      |
          | Global               | False                      |
          | Reserved-by-Protocol | True                       |
          +----------------------+----------------------------+

                Table 1: "This host on this network"

De este modo0.0.0.0/8y por lo tanto0.18.0.0no hay una dirección de destino válida, por lo tanto, el kernel regresa EINVALIDen las operaciones de socket que intentan usarla como destino.

Sugerencia: es posible que desee utilizarRFC 1918direcciones para su red administrada localmente.

información relacionada