1
0
mirror of https://github.com/nmap/nmap.git synced 2026-01-21 13:49:04 +00:00
Commit Graph

13115 Commits

Author SHA1 Message Date
dmiller
dd4a7906d6 Change Ncat default behavior to avoid TCP half-closed connections 2024-11-25 22:09:10 +00:00
dmiller
b805bcf71d Ncat: correctly handle EOF/error in exec mode. See #2843 2024-11-25 22:09:09 +00:00
dmiller
179786b2ce Add UDP SSL (DTLS) to Ncat tests 2024-11-25 22:09:09 +00:00
dmiller
92d5b6a310 Correctly process satisfied request from pending SSL data 2024-11-25 22:09:08 +00:00
dmiller
1264a6e472 Increment first, then decrement; avoid clearing desired bit 2024-11-25 22:09:07 +00:00
dmiller
a47850b6df Changelog entry for last commit. Fixes #2788. [ci skip] 2024-11-21 21:47:26 +00:00
dmiller
3a0db5dc51 Try an SSL_read() immediately to get the correct ssl_desire 2024-11-21 20:11:38 +00:00
dmiller
38823b5cd1 Handle SSL_read()/SSL_write() returning 0 when not EOF.
OpenSSL docs say, "Old documentation indicated a difference between 0
and -1, and that -1 was retryable. You should instead call
SSL_get_error() to find out if it's retryable."
2024-11-21 20:11:38 +00:00
dmiller
ff1df7a80c Zero IOD in nsock_iod_new2. Was reusing old peer info 2024-11-18 23:02:48 +00:00
dmiller
4efe456e0b Nsock iocp: pass immediate errors on to process_event() 2024-11-18 21:19:46 +00:00
dmiller
4aa83a7fc1 Fix a warning about printf parameter width 2024-11-18 20:26:29 +00:00
dmiller
b1f6f9b088 Track EOF at IOD level also 2024-11-18 20:26:28 +00:00
dmiller
1f6e8d9fe3 Handle EWOULDBLOCK as well as EAGAIN 2024-11-18 20:26:27 +00:00
dmiller
f72c0df772 Docs for -q option. Fixes #2422 2024-11-18 18:13:17 +00:00
dmiller
498e92539f Use usleep in ncat-test.pl. Use 3-arg open 2024-11-18 17:11:43 +00:00
dmiller
1db532209e Add -q option to Ncat 2024-11-16 17:55:50 +00:00
dmiller
6e3d70ff3f dicom.lua: use length-prefixed string packing 2024-11-13 19:15:13 +00:00
dmiller
274ecc0248 simplify a loop 2024-11-13 19:15:13 +00:00
dmiller
d21a4ee4ce Correctly pack TCP payload size for dns.lua 2024-11-13 19:15:12 +00:00
dmiller
cffc94e845 Consolidate event list management to nevent_unref()
Removes duplicate logic for PCAP_BSD_SELECT_HACK. May address accounting
problems that led to issues like #187 (macOS) and #2912 (Windows).
2024-11-13 19:15:12 +00:00
dmiller
222add87a6 Paranoid gh_list check: node is in list before removal 2024-11-13 19:15:11 +00:00
dmiller
3f64103cf0 Move some prototypes to nsock_internal.h 2024-11-13 19:15:10 +00:00
dmiller
82586d6327 Remove unused functions from snmp.lua 2024-11-12 20:05:58 +00:00
dmiller
fdf5a2d7e9 Configurable retries for snmp.lua 2024-11-12 20:05:57 +00:00
dmiller
10321be656 snmp.lua: add configurable timeout 2024-11-12 20:05:57 +00:00
dmiller
379b56b582 Include timeout info in debug output for all nsock reads/connects 2024-11-12 20:05:56 +00:00
dmiller
2d43280b16 NSE libssh2 bindings: allow exec without pty 2024-11-11 21:07:01 +00:00
dmiller
e2ccdb8074 Fix a typo in ssh-run 2024-11-11 21:07:01 +00:00
dmiller
33bfd251b4 Macro for common idiom in nse_libssh2 2024-11-11 21:07:00 +00:00
dmiller
5d14851aaa Fix error in ldap-brute: 'no string output' 2024-11-11 21:06:59 +00:00
dmiller
bfba1352e4 Fix UDP listen on Windows: recvfrom behaves differently. 2024-11-07 23:43:26 +00:00
dmiller
1e8c1ab3cd Let all nsock engines use STDIN on Windows! 2024-11-06 16:48:29 +00:00
dmiller
1c3fc17d2f Ncat: handle overlapped stdin socket from nbase's fselect 2024-11-06 16:47:25 +00:00
dmiller
6b2df74ef2 Nbase: use a static SOCKET for STDIN 2024-11-06 16:46:32 +00:00
dmiller
635cc50011 Nsock iocp: fix IPv6 connect 2024-11-06 16:06:32 +00:00
dmiller
f9b9434044 nbase: win32 build fix 2024-11-06 16:05:03 +00:00
dmiller
411b186576 Simplify nevent_delete for PCAP_BSD_SELECT_HACK mode 2024-11-01 18:40:09 +00:00
dmiller
2ca95ad6b4 Nsock select engine: don't process if sd is -1 (nonselectable) 2024-11-01 18:40:08 +00:00
dmiller
0e3a51c992 Set timeouts for Windows connect scan. Fixes #2113 2024-10-30 19:02:09 +00:00
dmiller
f1559fbc22 Use a socket, not pipe, for STDIN emulation in fselect
Using a TCP connected socket allows us to use a single select call instead of
interrupting it every 125ms to poll the stdin-pipe.
2024-10-30 18:55:39 +00:00
dmiller
fef9f592b0 POSIX usleep() returns an int. 2024-10-28 23:17:05 +00:00
dmiller
f0c022b25f Avoid infinite loop on systems where select doesn't update timeout 2024-10-28 23:11:53 +00:00
dmiller
191aadf142 Record current time for connect probes, not an old time 2024-10-28 23:11:52 +00:00
dmiller
cf718f2071 Avoid a few extra gettimeofday calls 2024-10-28 23:11:52 +00:00
dmiller
df1604ab19 Simplify pcap_select, remove timeval form 2024-10-28 23:11:51 +00:00
dmiller
931c13cd21 Fixes for IOCP engine build 2024-10-15 20:37:11 +00:00
dmiller
7703b045e5 Nsock poll engine: efficient use of pollfds array
Using socket descriptor as an index works okay for UNIX, though it
wastes the first several indices which are assigned to STDIN/STDOUT,
files, etc. However, for Windows it is really bad, since descriptors are
large, nonconsecutive numbers. Using a little overhead to track each
iod's index and the next empty space is worth it.
2024-10-11 20:59:35 +00:00
dmiller
14142ce874 Use nbase's usleep, not select, for delay timer in Ncat 2024-10-11 20:59:34 +00:00
dmiller
b94ae785ba Fix handling of non-select()-able pcap handles
1. pcap_get_selectable_fd() may return -1 for some devices, even if the
   platform as a whole supports select() on these handles. Check for
   this condition throughout.
2. The various backend system calls (kevent, poll, epoll, etc.) do not
   sleep for the timeout period if no valid handles are registered,
   unlike select on UNIX. This leads to busy wait, looping continuously.
   Instead, we call usleep() in those cases.
2024-10-11 20:59:34 +00:00
dmiller
6186767cd1 Move a useful function to nsock_core.c 2024-10-11 20:59:33 +00:00