1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-15 20:29:03 +00:00
Commit Graph

49 Commits

Author SHA1 Message Date
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
d43967bf99 Fix calculation of namelen param to bind in Ncat. Fixes #166 2015-06-18 04:33:58 +00:00
dmiller
68409b2226 Update copyright date to 2015 2015-06-03 13:01:29 +00:00
dmiller
ef878ea895 Notify in -v mode if SSL verification fails, even if --ssl-verify was not requested. Fixes #30 2015-05-31 12:14:04 +00:00
dmiller
9656d30661 Don't print debug messages if not debugging
This was Red Hat bug #1000770, patched downstream in RHBA-2014-0683
https://bugzilla.redhat.com/show_bug.cgi?id=1000770
2014-12-08 23:16:30 +00:00
dmiller
5adfb3b1de Update copyright notice to 2014 2014-08-16 01:52:33 +00:00
jay
8d5ec9e310 Reapply r33420, r33421. Fix a missing right parenthesis. https://xkcd.com/859/ 2014-08-15 12:09:22 +00:00
fyodor
f6f59a7cd7 Auto regeneration with latest template files, etc. 2014-08-13 22:57:43 +00:00
jay
d4cf544df6 Fix a missing bracket at the end of the IMPORTANT NMAP LICENSE TERMS part in each file 2014-08-02 19:29:50 +00:00
dmiller
b822aa9785 Fix Ncat's SOCKS5 password auth
See http://seclists.org/nmap-dev/2014/q3/4
2014-07-25 15:07:44 +00:00
dmiller
1575c63d7d Spellcheck for Ncat, Nping source files 2014-02-20 21:22:22 +00:00
henri
c9fe124e3d Moved variable definitions to the beginning of the block 2014-02-12 19:09:44 +00:00
henri
21b7e3818d [Ncat] Added support for socks5 and corresponding regression tests.
[Marek Lucaszuk, Petr Stodulka]
2014-02-09 14:10:04 +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
dmiller
db6f6ea069 s/tempnam/mkstemp/ in error message to reflect actual usage. 2013-09-27 14:43:26 +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
david
28599f1567 Revert r32301..r32306.
Committed accidentally.
2013-09-12 08:20:13 +00:00
david
08e38545a3 Add connect-mode recv() and send() support. 2013-09-12 08:12:25 +00:00
d33tah
ccd0c02a4c Add a lacking space in the license comment. The command I used to do this is:
for file in `grep "* including the terms and conditions of this license text as well.       \*" * -r --files-with-match `; do sed "s/\* including the terms and conditions of this license text as well.       \*/* including the terms and conditions of this license text as well.        */g" -i $file; done
2013-09-11 19:06:20 +00:00
fyodor
6e01ecd452 Update an email address, fix a typo, and slightly reword a sentence. 2013-07-30 00:02:00 +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
d33tah
e9c6e5b925 revert the previous commit, git-svn pushed it to the wrong directory. 2013-06-13 15:10:07 +00:00
d33tah
3e3e87f462 * create d33tah directory at nmap-exp
* create a branch ncat-lua in nmap-exp/d33tah based on current nmap trunk
* merge in patches from github into ncat-lua branch
2013-06-13 15:04:23 +00:00
david
21a8af6c08 Fix Ncat IPv6 HTTP CONNECT proxy syntax.
Patch by Joachim Henke.
http://seclists.org/nmap-dev/2013/q1/413
2013-05-05 10:21:46 +00:00
david
811d6096e1 Quit on EOF in non-TCP mode.
Apparently SCTP can't have the same kind of half-open sockets that TCP
has. When one direction is closed, we can't do anything further with the
socket.
http://seclists.org/nmap-dev/2013/q1/227
2013-02-23 06:54:29 +00:00
david
84773c74a5 Switch to an o.proto option instead of o.udp and o.sctp.
This eliminates the ambiguity that could exist when, say, both o.udp and
o.sctp were both set. The code would use whichever it happened to test
first. This also makes TCP mode explicit with IPPROTO_TCP.
2013-02-23 05:56:00 +00:00
david
9901c8e7a9 Close stdout on socket EOF. 2013-02-09 08:29:39 +00:00
david
88a35de3b5 Quit on socket EOF only in --recv-only mode.
Suggested by Tomas Hozza.
http://seclists.org/nmap-dev/2013/q1/188
2013-02-09 08:29:38 +00:00
david
81c777abfd Simplify connect-mode stdin EOF handling. 2013-02-09 08:29:37 +00:00
david
a6dd675fd3 Don't do operations with side effects inside asserts.
ncat_assert is safe because it cannot be disabled. <assert.h> assert is
also safe because we make sure that NDEBUG remains defined. Doing this
helps avoid potential bad effects of something changing in the future.
2013-01-04 18:59:56 +00:00
david
63d9e8b5d5 Use ncat_assert in place of assert everywhere. 2013-01-04 18:59:47 +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
9f3fa403ef Automatically create and delete a source Unix domain DGRAM socket.
Patch based on one by Tomas Hozza.
http://seclists.org/nmap-dev/2012/q4/334
2012-11-27 21:47:26 +00:00
henri
9d7c017cf7 Use the fallback nsock engine by default in order to maximize
compatibility between systems and use cases. [Henri Doreau]

There were known issues with the following cases:
  * epoll and regular files
  * kqueue and regular files
  * WSAPoll and stdin

The --nsock-engine=<ENGINE> can still be used to bypass this
default choice.

See: http://seclists.org/nmap-dev/2012/q4/173
2012-11-13 08:40:49 +00:00
david
cc4eb9f381 Disable automatic generation of datagram Unix domain source socket.
This code was not always properly cleaning up automatically generated
sockets; for example in the case of "Connection refused". It would
delete sockets even if you gave one manually with --source; it's not
clear that's the right behavior.
2012-11-12 20:44:45 +00:00
david
6531a19892 Implementation of UNIX-domain sockets for Ncat
Implementation of UNIX sockets for Ncat using
also UNIX-domain sockets functionality from
Nsock library. Added new argument "-U".
2012-11-12 20:44:40 +00:00
henri
71963537cb Proper indentation. 2012-11-08 13:11:23 +00:00
henri
84c80a7b34 Make ncat unconditionally use the select engine on windows. WSAPoll()
can't handle read events on stdin. This is a workaround intended to
mitigate the issue until we implement a fpoll function in nbase.
2012-10-26 09:40:14 +00:00
henri
7dc93e0935 Close connection endpoint when receiving EOF on stdin. Patch by Michal Hlavinka. 2012-09-10 20:41:46 +00:00
david
f9867163da Use bye in place of fatal. 2012-08-28 14:29:37 +00:00
henri
af2f0960ab Automatically enforce the use of the nsock select engine if we detect that stdin
is a regular file.

Under linux, that provides epoll(7), this allows proper behavior when
redirecting a regular file to stdin (e.g.: 'ncat localhost < file.txt').

Bug was reported by Michal Hlavinka. See
http://seclists.org/nmap-dev/2012/q3/490 for more details.
2012-08-18 16:25:50 +00:00
david
607b209fd4 Whitespace.
indent -kr -i4 -nut -l0 -ss -T size_t *.c
with manual adjustments.
2012-06-19 00:21:27 +00:00
fyodor
684f42c4ad One more adjustment to the license text. Notes that Zenmap, Ncat, and Nping use this license. Note that contributions made directly in the src repository are treated the same as those in the mailing list. 2012-03-01 06:53:35 +00:00
fyodor
e96a7b7b24 Update the headers for each code file. This updates code copyright dates to 2012, notes the awesome NSE in the list of technology, and slightly rewords the derivative works clarification 2012-03-01 06:32:23 +00:00
david
ed2ba4e168 Copy nping, nsock, nbase, zenmap, ncat from their homes in /.
If you have trouble updating after this revision you need to follow
these instructions. You have probably just seen an error like this:

svn: URL 'svn://svn.insecure.org/nping' of existing directory 'nping'
does not match expected URL 'svn://svn.insecure.org/nmap/nping'

This is caused by the replacement of SVN externals.

Here's what you need to do. First, save any local changes you might have
in the nping, nsock, nbase, ncat, and zenmap directories. (For example
by running "cd nping; svn diff > ../nping.diff".) If you don't have any
local changes you can skip this step.

Then run these commands:

rm -rf nping/ nsock/ nbase/ ncat/ zenmap/
svn update
svn cleanup

If all else fails, you can just delete your whole working directory and
check out anew:

svn co --username guest --password "" svn://svn.insecure.org/nmap

There may be further discussion in the mailing list thread at
http://seclists.org/nmap-dev/2011/q4/303.
2011-11-16 21:49:44 +00:00