1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-10 17:59:04 +00:00
Commit Graph

78 Commits

Author SHA1 Message Date
sven
801e537697 Fix a bug in --script-trace hex dump output resulting in bytes with highest bit set to be prefixed by ffffff. 2008-09-03 22:09:15 +00:00
batrick
ce9d484281 Made nsock functions get the proper environment. (bad use of setfenv earlier).
nsock:connect function gets the global environment.
2008-08-09 23:12:52 +00:00
batrick
cd674d4f6d Cleaned up the nsock:connect function's source to be
passed its upvalues rather than having them given globally.
2008-08-09 22:55:57 +00:00
batrick
35553f80bd [NSE] Added fix for deadlocks on sockets. Now, 10 or max.parallelism threads
can have as many sockets open as they need. Previously, only 10 sockets could
be open.

See: http://seclists.org/nmap-dev/2008/q3/0130.html
2008-07-31 07:35:19 +00:00
kris
ffb3d8202d Documenting an earlier change and adding a new, related one:
o Nsock now supports binding to a local address and setting IPv4 options
  with nsi_set_localaddr() and nsi_set_ipoptions(), respectively. [Kris]

o Nmap's Nsock-utilizing subsystems (DNS, NSE, version detection) have been
  updated to support the -S and --ip-options flags. [Kris]
2008-07-14 19:52:31 +00:00
batrick
3ae4bcfa9e Removed nse_string. Equivalent procedures are placed in
nse_main and nse_nsock. nse_main now uses Lua to create printable output
while a cleaner hexify procedure has been placed in nsock.
nse_string is removed as a result.
2008-07-07 17:31:38 +00:00
bmenrigh
dea5974643 Migrated remaining *alloc() calls to safe_*alloc() 2008-06-22 04:56:02 +00:00
batrick
d0bc640db8 Large recode of nse_init.cc
Now does most of it's work through Lua:

From Nmap-dev: "Many of the changes consist of changing how Nmap interfaces
with Lua that were sometimes awkward or inflexible. Most of the functions 
have been made to be callable directly by Lua which offers many technical
advantages: stack management is alleviated, errors are handled cleanly and
are more descriptive, and there is increased reusability."

Additionally:
   -- Moved all lua_State * symbols from "l" to "L". This is to maintain
      consistency with other Lua libraries (convention) and to make our macros portable.
   -- Moved file system manipulation over to nse_fs.cc (from nse_init.cc)
2008-05-31 02:39:27 +00:00
batrick
742ff67100 Removed nse_auxiliar. Updated Script Argument parsing. Fixed typos in
documentation. Improved MySQLinfo.nse. Nsock/dnet metatabels are now
protected.
2008-05-31 02:19:24 +00:00
fyodor
5551c5a311 o Fixed a bunch of code to avoid compilation warning messages (at
least on some Linux machines) [Andrew J. Bennieston]
2008-04-09 02:11:20 +00:00
kris
8dc6b8d978 changing a couple log_write()s to use the SCRIPT_ENGINE macro rather than "SCRIPT ENGINE" literals 2008-01-21 17:18:51 +00:00
stoiko
1b143f2c36 move the check, wheter a socket is open, before connecting it again to l_nsock_queued() - otherwise there are problems with the returned values.. 2007-12-12 18:23:19 +00:00
stoiko
24cca96f14 if nse's connect is issued on an open socket, close the old connection before
connecting - this should prevent starvation, in case a single script opens many
connections
2007-12-12 14:00:40 +00:00
majek04
4ed4ffa219 Added promiscuous.nse for detecting local NIC in promisc mode. First script using pcap for nse. 2007-11-27 18:59:53 +00:00
david
1c59946d7a Throw an exception instead of calling luaL_argerror in l_nsock_connect when an SSL connection is requested but OpenSSL isn't available. 2007-11-21 02:31:07 +00:00
fyodor
57070b12a5 canonicalize capitalization 2007-09-08 05:56:15 +00:00
fyodor
082ee50244 trivial capitalization tweak 2007-09-08 04:52:00 +00:00
fyodor
8c87b5f34b remove excess debugging messages 2007-08-30 22:27:51 +00:00
fyodor
72948b35a5 Integrate a patch from Marek which sets a cap on the number of sockets opened by NSE scripts. I made some changes to use a value derived from o.max_parallelism rather than a static define 2007-08-30 21:31:01 +00:00
stoiko
e765af4103 added --script-args to the usage-text (nmap.cc)
fixed to typos in error messages (nse_nsock.cc)
added a short description of --script-args to refguide.xml
2007-08-16 10:51:27 +00:00
kris
0b50c16b38 Adding Snprintf() and Vsnprintf() to nbase/nbase_str.c. This is because of Windows' stupid implementation where it doesn't write a NULL byte at the end of the buffer if the result is truncated. I would've just #defined snprintf and vsnprintf to some wrapper function for Windows, but this doesn't work as libdnet and libpcap (and libpcap includes under mswin32) define snprintf to _snprintf and vsnprintf to _vsnprintf like we do, and through the many defines they end up being available in the Nmap sources. Vsnprintf() uses vsnprintf() (and writes a NULL byte at the end if truncated), and Snprintf uses Vsnprintf(). 2007-08-14 06:46:54 +00:00
fyodor
c124e918b7 merge soc07 r5360:5367 - Merge Majek's raw packet NSE patch 2007-08-11 06:13:25 +00:00
fyodor
62d7e3ed87 merge soc07 r5317:5322 - NSE buffered receives and script arguments 2007-08-11 06:09:50 +00:00
fyodor
8dc9673928 merge soc07 r5085 - Changing bare printf()s to log_write(LOG_PLAIN,)s because these were always printed even when things like XML and greppable output were sent to stdout (e.g. -oX -). This also adds o.scriptTrace() to make --script-trace behave more like --packet-trace and --version-trace. Nsock tracing was done unconditionally in NSE, and that has been changed to only be done when o.scriptTrace() is true. 2007-08-11 05:13:16 +00:00
fyodor
83ec445bcf merge soc07 r5005:5013 - URL manipulation lib from LuaSocket with a couple funcs added; added garbage collection for nsock-objects in lua 2007-08-11 04:46:43 +00:00
fyodor
58522c59f6 merge soc07 r4822 - Reduce the number of build dependencies. 2007-08-11 03:35:46 +00:00
fyodor
cb8101dbcc merge soc07 r4821 - fix nse build system issues 2007-08-11 03:35:12 +00:00
fyodor
b361685be8 NSE committed 2006-12-11 00:34:26 +00:00