1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-20 14:39:02 +00:00
Commit Graph

58 Commits

Author SHA1 Message Date
dmiller
d43df98ab1 Nsock: Use separate SSL_CTX for SSL vs DTLS 2022-08-25 16:29:49 +00:00
dmiller
dd690b3e0b Bump copyright date and update some links [ci skip] 2022-02-18 17:38:46 +00:00
fyodor
3aec3f3a07 Update to latest copyright templates. Main change is that Insecure.Com LLC is now Nmap Software LLC 2021-11-23 16:04:37 +00:00
dmiller
ef8213a36c Reintegrate Nmap 7.90 release branch 2020-10-05 23:00:30 +00:00
dmiller
ee32b56ebb Comment some empty blocks. #1834 2019-12-25 20:01:18 +00:00
dmiller
d639a53088 Bump copyright date in license headers 2019-05-28 21:36:04 +00:00
dmiller
21f51ff822 AF_VSOCK support. Closes #1075 2019-05-20 16:21:41 +00:00
fyodor
ff62300249 Bump copyright dates to 2018 and slightly improve wording (doesn't change meaning) of Nmap license header text 2018-01-28 21:18:17 +00:00
dmiller
fdfc36778b Add DTLS and ALPN support to Ncat. Closes #446 2017-07-29 05:55:30 +00:00
dmiller
9c7ea727a7 Update license terms for 2017 2017-06-07 12:32:38 +00:00
tudor
1e1f744186 Added IOCP integration for Nsock, engine IOCP is the default engine on Windows 2016-08-22 19:15:13 +00:00
tudor
63b31682f4 Reverted the IOCP integration 2016-08-11 18:58:03 +00:00
tudor
1aa7958e23 Added IOCP integration for Nsock 2016-08-09 12:44:55 +00:00
dmiller
6e33d6ac3c Bump date in copyright headers 2016-04-04 15:38:44 +00:00
henri
b55ff2d68f Don't associate nsock logging info to a nspool.
Make current loglevel and current log callback global
to the library. Attaching them to the nsock pool doesn't
bring any benefit and prevents from logging activity in
code sections that don't have access to a pool (such as
proxy chain specification parsing).

Updated external calls and nsock tests accordingly.
2015-06-27 08:21:53 +00:00
henri
b75233ce98 Consistently renamed nsi_XXX calls into nsock_iod_XXX
This is part of the effort to make nsock expose only
nsock_ prefixed symbols and simplify the API.
2015-06-27 08:21:33 +00:00
henri
fd40b8df08 Simplify Nsock SSL init API
Replaced nsock_pool_ssl_init_max_speed() by a NSOCK_SSL_MAX_SPEED
flag to be passed to nsock_pool_ssl_init(). Default (flag=0) means
secure.
2015-06-27 08:21:22 +00:00
henri
0348359f60 Enforce nsock naming scheme.
convert nsp_* calls into nsock_pool_*. Separate words with underscores
where appropriate.
2015-06-27 08:21:16 +00:00
dmiller
68409b2226 Update copyright date to 2015 2015-06-03 13:01:29 +00:00
fyodor
f6f59a7cd7 Auto regeneration with latest template files, etc. 2014-08-13 22:57:43 +00:00
henri
d13dab54c3 Replaced internal opaque types by structs. 2014-05-21 19:59:42 +00:00
david
d05d8acd93 Revert r32397, r32398, r32399 (tempnam to mkstemp).
I had intended the unlink to appy only to unix domain sockets, but it
was being called for every kind of local address.

http://seclists.org/nmap-dev/2013/q3/647
2013-09-27 15:30:18 +00:00
david
e18b25bccd Use tempfile in place of tempnam.
To avoid new GCC warnings about tempnam:
ncat_connect.c:789: warning: the use of `tempnam' is dangerous, better use `mkstemp'

Doing things this way has the same race condition as tempnam did,
because we are unlinking the file before binding it. (The race window is
smaller now.) The file must not exist before binding the Unix socket, or
else you get an "address already in use" error. Unlinking before binding
is the same thing that netcat-openbsd does. See this earlier thread:
http://seclists.org/nmap-dev/2012/q4/336.
2013-09-26 07:17:08 +00:00
henri
853aaff586 Manage expiration times via a heap queue.
This prevents nsock from iterating over the whole list of events at
each runloop, thus improving performance.

It made it necessary to have pointers from the msevents to the event
lists they belong to. The patch therefore also changes gh_list from
autonomous containers to embedded structures.

Added unit tests accordingly and cosmetic changes to make things look
more consistent.
2013-08-10 23:59:30 +00:00
henri
822d3e1da2 Fixed non-portable perror() statement.
Replaced perror() by printf + socket_strerror(socket_errno()).
Reported by Gisle Vanem.
2013-08-10 20:19:09 +00:00
fyodor
83fb10ec56 Update the Nmap copyright/license files. This isn't the new Nmap Public Source License we've been discussing on the list, but rather just a 'quick patch' to hopefully prevent some of the abuse we've been seeing from companies lately. More details on the changes will be posted to the dev list. Also, the copyright year was updated to 2013 (which is the only change to Nsock license statements). 2013-07-28 22:05:05 +00:00
henri
192cd3657d Don't set SO_BROADCAST on SOCK_STREAM sockets.
This doesn't make sense and raise verbose errors, at least on Windows.
See: http://seclists.org/nmap-dev/2013/q2/313
2013-05-18 13:24:03 +00:00
henri
3534dfa3b8 Display actual error codes in the nsock messages.
Refactored the code a bit too.
2013-05-18 13:23:55 +00:00
henri
e108771faa Use the portable socket_errno() & socket_strerror() functions. 2013-05-12 17:48:33 +00:00
david
3b14d188cb Add a debug message when binding a socket. 2013-04-27 16:22:11 +00:00
david
67bc0819b4 Use get_localaddr_string in the connect bind log message.
This includes the port number, not just the address.
2013-04-27 16:22:09 +00:00
henri
b867fa4721 Fixed ID type in format string. 2013-04-22 19:36:55 +00:00
henri
5cf3780a93 Added a nsock log message to nsock_connect_internal.
Explicitely indicates that a connection is about to be
redirected through the proxy chain.
2013-04-22 19:35:50 +00:00
henri
11fdeed8fb Restrict proxying to TCP operations. 2013-04-22 19:34:18 +00:00
henri
af59333757 Perform the proxy connexion hook in connect_internal().
This allows to generically handle all kinds of connexions instead of manually
providing a handler for tcp connect, ssl connect...

The drawback is that would it makes it harder to implement support of SSL
proxies. Not sure whether there's a need though, looks like regular clients
don't handle them at least.
2013-04-22 19:33:53 +00:00
henri
da1559b237 Replaced a couple macros by corresponding static inline functions.
Removed unused PROXY_CTX_NODES() macro.
2013-04-22 19:32:20 +00:00
henri
ba27c10458 Removed the proxy-specific tcp_connect hook.
This simplifies the interface that proxies export to the library but also relies
upon the assumption that a proxy chain starts with a TCP connection from the
scanner to the next hop proxy. That will be enough ATM.
2013-04-22 19:31:40 +00:00
henri
f1a04abd6b Removed the global ProxyOps list.
Each proxy node now provides a pointer to its operations struct.
2013-04-22 19:30:49 +00:00
henri
3451220630 Refactored proxy code to use a "strategy" design pattern.
Proxy backends are selected at runtime. Each proxy exports a list of operations
to the rest of the library. This is similar to the way IO engines are
implemented within nsock.
2013-04-22 19:30:40 +00:00
henri
48354754a8 Renamed proxy actions into proxy op, which seems to be rather more meaningful. 2013-04-22 19:30:23 +00:00
henri
2b3a3ca5df Fixed ProxyAction extern declaration. 2013-04-22 19:29:58 +00:00
henri
28604b63e3 Design improvements.
Externally:
  The calling application can build a proxychain object and assign it to one (or
  more) NSP. Once a NSP get assigned a proxychain it's not possible to remove
  it so that consistency is (should be...) ensured.

Internally:
  An IOD comes with a proxychain context structure storing the whole tunnel
  state. Also each proxy type now has a table of associated functions to use
  as hooks for TCP connects(), read() and write() requests. As a result, adding
  support of new proxy type should be easier. Code also gains readability in
  comparison to large switch/cases that redirect the execution flow according to
  the given proxy type.
2013-04-22 19:29:18 +00:00
henri
06219414a6 Initial version with a _very_ raw support for HTTP proxy chains (using the
CONNECT method). This is mostly intended to validate the concepts, data models
and programming approach.
2013-04-22 19:28:53 +00:00
henri
0d58167dcf fixed format string! 2013-01-10 19:19:15 +00:00
henri
941b73ac8a Minor style fixes. 2012-12-29 15:59:59 +00:00
henri
f2757be055 Proper error reporting during socket creation and initialization. 2012-12-20 18:10:54 +00:00
henri
809f1eda68 Merged nsock-logging from nmap-exp/henri/nsock-logging/
Reworked the logging infrastructure to make it more flexible
and consistent.

Updated nmap, nping and ncat accordingly.  Nsock log level can
now be adjusted at runtime by pressing d/D in nmap.
2012-12-15 10:59:30 +00:00
fyodor
6a42ef47c0 Update the Nmap and Nsock source code headers to note new Nmap dev mailing list email address and a better URL for Nmap license. 2012-12-06 01:21:42 +00:00
david
2bfeace798 Make it an error in nsock_make_socket if AF_UNIX can't bind.
http://seclists.org/nmap-dev/2012/q4/345
2012-11-29 03:31:50 +00:00
david
d52a6fd23c Straighten out port computation in nsock_connect_internal.
There was a bug here where AF_INET6 was used instead of AF_UNIX in the
HAVE_SYS_UN_H section. This masked another bug, which was that the
HAVE_SYS_UN_H section inadvertently extended into what was supposed to
be the HAVE_IPV6 section.
2012-11-27 21:47:25 +00:00