Package: netcat-openbsd Version: 1.130-1 Severity: important This is netcat-openbsd 1.105-7 ------------------------------
Command line is: $ echo 'ehlo itsme' | nc.openbsd host.example.com 25 The output is: 220 host.example.com ESMTP Postfix 250-host.example.com 250-PIPELINING 250-SIZE 10240000 250-VRFY 250-ETRN 250-ENHANCEDSTATUSCODES 250-8BITMIME 250 DSN The simple trace is: 1 0.000000000 1.1.1.11 ? 1.1.1.1 TCP 74 47242?smtp(25) [SYN] Seq=0 Win=29200 Len=0 MSS=1460 SACK_PERM=1 TSval=1188714834 TSecr=0 WS=128 2 0.000130857 1.1.1.1 ? 1.1.1.11 TCP 74 smtp(25)?47242 [SYN, ACK] Seq=0 Ack=1 Win=28960 Len=0 MSS=1460 SACK_PERM=1 TSval=1189398612 TSecr=1188714834 WS=128 3 0.000171694 1.1.1.11 ? 1.1.1.1 TCP 66 47242?smtp(25) [ACK] Seq=1 Ack=1 Win=29312 Len=0 TSval=1188714834 TSecr=1189398612 4 0.000539830 1.1.1.11 ? 1.1.1.1 SMTP 77 C: ehlo itsme 5 0.000555726 1.1.1.11 ? 1.1.1.1 TCP 66 47242?smtp(25) [FIN, ACK] Seq=12 Ack=1 Win=29312 Len=0 TSval=1188714834 TSecr=1189398612 6 0.000682959 1.1.1.1 ? 1.1.1.11 TCP 66 smtp(25)?47242 [ACK] Seq=1 Ack=12 Win=29056 Len=0 TSval=1189398612 TSecr=1188714834 7 0.009776682 1.1.1.1 ? 1.1.1.11 SMTP 106 S: 220 host.example.com ESMTP Postfix 8 0.009800662 1.1.1.11 ? 1.1.1.1 TCP 66 47242?smtp(25) [ACK] Seq=13 Ack=41 Win=29312 Len=0 TSval=1188714836 TSecr=1189398615 9 0.009807945 1.1.1.1 ? 1.1.1.11 SMTP 195 S: 250 host.example.com | 250 PIPELINING | 250 SIZE 10240000 | 250 VRFY | 250 ETRN | 250 ENHANCEDSTATUSCODES | 250 8BITMIME | 250 DSN 10 0.009822556 1.1.1.11 ? 1.1.1.1 TCP 66 47242?smtp(25) [ACK] Seq=13 Ack=171 Win=30336 Len=0 TSval=1188714836 TSecr=1189398615 This is netcat-openbsd 1.130-1 ------------------------------ Same command line: $ echo 'ehlo itsme' | nc.openbsd host.example.com 25 There is _no_ output. It seems nc.openbsd is closing the socket before reading/showing whatever host.example.com returns. Note the two resets '[RST]' bellow. 11 25.973506450 1.1.1.11 ? 1.1.1.1 TCP 74 47246?smtp(25) [SYN] Seq=0 Win=29200 Len=0 MSS=1460 SACK_PERM=1 TSval=1188721327 TSecr=0 WS=128 12 25.973662894 1.1.1.1 ? 1.1.1.11 TCP 74 smtp(25)?47246 [SYN, ACK] Seq=0 Ack=1 Win=28960 Len=0 MSS=1460 SACK_PERM=1 TSval=1189405106 TSecr=1188721327 WS=128 13 25.973690712 1.1.1.11 ? 1.1.1.1 TCP 66 47246?smtp(25) [ACK] Seq=1 Ack=1 Win=29312 Len=0 TSval=1188721327 TSecr=1189405106 14 25.973728427 1.1.1.11 ? 1.1.1.1 SMTP 77 C: ehlo itsme 15 25.973747259 1.1.1.11 ? 1.1.1.1 TCP 66 47246?smtp(25) [FIN, ACK] Seq=12 Ack=1 Win=29312 Len=0 TSval=1188721327 TSecr=1189405106 16 25.973845701 1.1.1.1 ? 1.1.1.11 TCP 66 smtp(25)?47246 [ACK] Seq=1 Ack=12 Win=29056 Len=0 TSval=1189405106 TSecr=1188721327 17 25.974788937 1.1.1.1 ? 1.1.1.11 SMTP 106 S: 220 host.example.com ESMTP Postfix 18 25.974817575 1.1.1.11 ? 1.1.1.1 TCP 54 47246?smtp(25) [RST] Seq=13 Win=0 Len=0 ^^^ 19 25.974872212 1.1.1.1 ? 1.1.1.11 SMTP 195 S: 250 host.example.com | 250 PIPELINING | 250 SIZE 10240000 | 250 VRFY | 250 ETRN | 250 ENHANCEDSTATUSCODES | 250 8BITMIME | 250 DSN 20 25.974896332 1.1.1.11 ? 1.1.1.1 TCP 54 47246?smtp(25) [RST] Seq=13 Win=0 Len=0 ^^^ If I add the '-q1' option (wait one second after EOF on stdin) to the command line: $ echo 'ehlo itsme' | nc.openbsd -q1 host.example.com 25 then I get the expected output: 220 host.example.com ESMTP Postfix 250-host.example.com 250-PIPELINING 250-SIZE 10240000 250-VRFY 250-ETRN 250-ENHANCEDSTATUSCODES 250-8BITMIME 250 DSN Note, no '[RST]' in the packet trace. 1 0.000000000 1.1.1.11 ? 1.1.1.1 TCP 74 47742?smtp(25) [SYN] Seq=0 Win=29200 Len=0 MSS=1460 SACK_PERM=1 TSval=1189159653 TSecr=0 WS=128 2 0.000144981 1.1.1.1 ? 1.1.1.11 TCP 74 smtp(25)?47742 [SYN, ACK] Seq=0 Ack=1 Win=28960 Len=0 MSS=1460 SACK_PERM=1 TSval=1189843431 TSecr=1189159653 WS=128 3 0.000173801 1.1.1.11 ? 1.1.1.1 TCP 66 47742?smtp(25) [ACK] Seq=1 Ack=1 Win=29312 Len=0 TSval=1189159653 TSecr=1189843431 4 0.000208860 1.1.1.11 ? 1.1.1.1 SMTP 77 C: ehlo itsme 5 0.000338115 1.1.1.1 ? 1.1.1.11 TCP 66 smtp(25)?47742 [ACK] Seq=1 Ack=12 Win=29056 Len=0 TSval=1189843432 TSecr=1189159653 6 0.001715233 1.1.1.1 ? 1.1.1.11 SMTP 106 S: 220 host.example.com ESMTP Postfix 7 0.001733564 1.1.1.11 ? 1.1.1.1 TCP 66 47742?smtp(25) [ACK] Seq=12 Ack=41 Win=29312 Len=0 TSval=1189159653 TSecr=1189843432 8 0.001875842 1.1.1.1 ? 1.1.1.11 SMTP 195 S: 250 host.example.com | 250 PIPELINING | 250 SIZE 10240000 | 250 VRFY | 250 ETRN | 250 ENHANCEDSTATUSCODES | 250 8BITMIME | 250 DSN 9 0.001895568 1.1.1.11 ? 1.1.1.1 TCP 66 47742?smtp(25) [ACK] Seq=12 Ack=170 Win=30336 Len=0 TSval=1189159653 TSecr=1189843432 10 1.002139332 1.1.1.11 ? 1.1.1.1 TCP 66 47742?smtp(25) [FIN, ACK] Seq=12 Ack=170 Win=30336 Len=0 TSval=1189159903 TSecr=1189843432 11 1.002387350 1.1.1.1 ? 1.1.1.11 TCP 66 smtp(25)?47742 [FIN, ACK] Seq=170 Ack=13 Win=29056 Len=0 TSval=1189843682 TSecr=1189159903 12 1.002412151 1.1.1.11 ? 1.1.1.1 TCP 66 47742?smtp(25) [ACK] Seq=13 Ack=171 Win=30336 Len=0 TSval=1189159903 TSecr=1189843682 -- System Information: Debian Release: stretch/sid APT prefers testing APT policy: (500, 'testing'), (99, 'unstable'), (59, 'experimental') Architecture: amd64 (x86_64) Foreign Architectures: i386 Kernel: Linux 4.4.0-1-amd64 (SMP w/8 CPU cores) Locale: LANG=, LC_CTYPE= (charmap=ANSI_X3.4-1968) Shell: /bin/sh linked to /bin/bash Init: sysvinit (via /sbin/init) Versions of packages netcat-openbsd depends on: ii libbsd0 0.8.3-1 ii libc6 2.24-3 netcat-openbsd recommends no packages. netcat-openbsd suggests no packages. -- no debconf information Cheers, -- Cristian