Skip to content

--noninteractive or no /dev/tty disables --stats-every #3175

Description

@Librazy

Describe the bug
--stats-every not working when --noninteractive specified or with /dev/tty detached.

To Reproduce

  1. Run a normal scan with 1s interval for status messages

nmap --stats-every 1 $SCAN_CIDR

It should output stat messages every seconds, as expected.

  1. Run a --noninteractive scan

nmap --stats-every 1 --noninteractive $SCAN_CIDR

It now render no output for stat messages.

  1. Run a scan with detached tty and stdio

(setsid nmap --stats-every 1 $SCAN_CIDR) < /dev/null |& cat

None of stat messages shows for nmap built after (suspectly) 10862c4

Expected behavior

--stats-every should always work regardless of --noninteractive and /dev/tty.

Version info (please complete the following information):

Works on without /dev/tty

  • OS: [Ubuntu 22.04]
  • Output of nmap --version:
Nmap version 7.80 ( https://nmap.org )
Platform: x86_64-pc-linux-gnu
Compiled with: liblua-5.3.6 openssl-3.0.2 nmap-libssh2-1.8.2 libz-1.2.11 libpcre-8.39 libpcap-1.10.1 nmap-libdnet-1.12 ipv6
Compiled without:
Available nsock engines: epoll poll select

Fails both case

  • OS: [Ubuntu 24.04]
  • Output of nmap --version:
Nmap version 7.94SVN ( https://nmap.org )
Platform: x86_64-pc-linux-gnu
Compiled with: liblua-5.4.6 openssl-3.0.13 libssh2-1.11.0 libz-1.3 libpcre2-10.42 libpcap-1.10.4 nmap-libdnet-1.12 ipv6
Compiled without:
Available nsock engines: epoll poll select

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions