1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-21 23:19:03 +00:00
Commit Graph

4571 Commits

Author SHA1 Message Date
ron
5136ad0668 Fixed a NSEDoc comment on http-header.nse 2009-08-29 14:46:57 +00:00
david
32db650a4b Add some more comments to substvar in service_scan.cc. 2009-08-29 14:35:50 +00:00
batrick
325a5231a5 Fixed a compiler error I introduced in 15357. 2009-08-29 06:03:04 +00:00
batrick
d788c5e3be Added function comments for the C NSE API. The comments include changes made on
the stack similar to Lua's C API.
2009-08-29 05:42:09 +00:00
david
8605f18da4 Normalize indentation and whitespace in tcpip.cc with
indent -kr -i2 -nut -brf tcpip.cc
followed by manual adjustment.
2009-08-29 02:44:00 +00:00
david
cd5010893e Adapt part of the code I missed in r15354; the code for an address mask
request did take into the account the size of the u32 in pointer
arithmetic, so it had to be changed with the change to u8.
2009-08-29 01:50:31 +00:00
david
02c9cf42f7 Fix some pointer arithmetic in build_icmp_raw. There were two bugs. The
first is a pointer was kept to the beginning of the packet payload, and
it was increased based on the varying size of the ICMP header. But its
type was pointer to u32 instead of pointer to u8, so the expression
datastart += 12 actually increased the pointer by 48 bytes, leaving
garbage in the first 36 bytes of the payload and making it possible for
the buffer to overflow. The second was that the remaining space left in
the buffer was not decreased when the datastart was increased, again
making it possible to overflow. I got a reliable segmentation fault with
the command
nmap -PP 1.2.3.4 --data-length 1480
2009-08-29 01:45:28 +00:00
batrick
3c14c0d7b1 [NSE] Added
nse_gettarget (lua_State *L, int index);
to replace the current_hosts static variable shared between nse_main.cc
and nse_nmaplib.cc. This improves locality and offers a clearer interface.
2009-08-29 01:24:29 +00:00
batrick
9044a42c6b Fixed a format specifier warning (expected "long unsigned int"). 2009-08-29 01:14:33 +00:00
david
c7fccb4d0c Implement the proposed changes from docs/device-types.txt to being the
device types in nmap-os-db and nmap-service-probes in line with that
document.
2009-08-28 23:52:41 +00:00
joao
6375cf3759 Added argument related comments 2009-08-28 22:46:09 +00:00
joao
ec6be741b4 Added extra description to some invalid favicons 2009-08-28 22:40:03 +00:00
joao
5457ecf54e Fixing some indentation. 2009-08-28 22:26:56 +00:00
joao
9789a1c6a4 Adding http-favicon script. Also adding the script database with the 50 very common favicons.
Updated script.db
2009-08-28 22:22:14 +00:00
batrick
e807b92459 [NSE] Scripts are able to access hosts from a previous host group which were scanned
and freed. This is unintended and may cause a segfault. We fix this by replacing
the current_hosts table with a new empty table when scanning a new host group.
See [1] for more information.

[1] http://seclists.org/nmap-dev/2009/q3/0782.html
2009-08-28 21:01:29 +00:00
fyodor
5fdea68d09 Add DNS-based service discovery script idea 2009-08-28 07:49:58 +00:00
batrick
b61ed83e14 [NSE] Patch to allow virtual hosts (specified by name on the command line)
which resolve to the same IP to have script output placed under the correct
(virtual) host.  Previously, all script output would be "randomly but
deterministically" placed under one of these hosts.  Other problems include
having port information changed for only one of the virtual hosts.
2009-08-28 02:48:56 +00:00
fyodor
f54bb442c4 fix a typo in a comment 2009-08-27 21:45:05 +00:00
ron
37507349a3 Changed 'pairs' to 'ipairs' when looping through the header (thanks to Patrick for pointing this out) 2009-08-27 21:35:52 +00:00
david
ceb10ffe29 Add an extra blank line to nmap-service-probes for uniformity. 2009-08-27 20:43:09 +00:00
david
f6d8d8b290 Add an HP Printer Job Language version probe from Brandon Enright. It is
inactive at the moment because its ports 9100-9107 are in the default
Exclude list. (In fact, they are the default exclude list.) Users will
have to comment out the Exclude line to test these.
2009-08-27 20:37:15 +00:00
ron
7da313e8ac Added the status code to the rawheaders as well (so it's displayed in http-headers.nse). Also updated the @output in the nsedoc. 2009-08-27 15:47:10 +00:00
ron
62dedb9dc1 Added a 'path' script-arg to http-headers.nse. Changed it to use 'HEAD' by default, and fail to using 'GET' the same way other scripts do (also added a 'useget' script-arg to turn it off). Also fixed some print_debugs in http.lua that were prefixed with 'http-enum.nse:'. 2009-08-27 15:39:17 +00:00
ron
fc2b575fba Added 'rawheader' when parsing http requests. It saves the header fields, in order, preserving the case. Change http-headers.nse to read this instead of the processed headers. 2009-08-27 15:24:09 +00:00
david
d254c85b42 Fix XML traceroute output. I accidentally left in one part of the old
stateful TraceProbes design, which was otherwise removed in r15197.
2009-08-26 23:49:20 +00:00
ron
8a8ae22532 Fixing a fingerprint 2009-08-26 22:10:21 +00:00
ron
1ac3ea773b Adding a new fingerprint after finding a /backup.sql file in a test 2009-08-26 21:10:02 +00:00
david
7d6d5ada0b o [Zenmap] If you have any hosts or services selected, they will
remain selected after aggregating another scan or running a filter
  (as long as they are still up and visible). Before the selection was
  lost whenever the scan inventory was changed.
2009-08-26 20:10:14 +00:00
ron
46711fa004 Fixed a big in the http library that cropped up while scanning multiple hosts at the same ip address. The reason this occurred is because the result would be cached based on the ip address, not the target name, so different vhosts on the same ip address would be considered the same by the cache. 2009-08-26 16:01:00 +00:00
fyodor
48035974b0 2009-08-26 07:01:46 +00:00
ron
5da8f8199e Added http-headers.nse script to database 2009-08-26 00:23:26 +00:00
ron
91518a5222 Added a script-arg to http-enum.nse allowing the user to give a custom fingerprint file. Also changed script to use straight nmap.fetchfile(filename) then to use nmap.fetchfile('nselib/data/' .. filename) to find the fingerprints file, which lets a user give his fingerprints file in the current folder.
It might be better to give priority the other way, though, I'm not really sure.
2009-08-25 23:55:05 +00:00
ron
c1d48010a1 Added caching for the HTTP fingerprint files. It mimics similar code from http-usedir-enum.nse, storing the fingerprints in the registry and checking if it exists before reading them. 2009-08-25 23:45:48 +00:00
ron
0ed14b10b1 Added a script designed to display HTTP headers. 2009-08-25 23:36:49 +00:00
fyodor
58d8401b7c changes from chat w/David 2009-08-25 22:09:49 +00:00
luis
a5ca31db9e Replaced nmap's hex dump functions with new hexdump() included in nbase. Before
Nmap used two functions: one of them, hdump(), just printed raw hex bytes 
(no ASCII equivalents) and the other one, lamont_hdump() had a bug when 
printing buffers where bufflen%16==3. A new function has been implemented 
from scratch, that basically produces the same output as Wireshark. 
Output looks like this:

0000   e8 60 65 86 d7 86 6d 30  35 97 54 87 ff 67 05 9e  .`e...m05.T..g..
0010   07 5a 98 c0 ea ad 50 d2  62 4f 7b ff e1 34 f8 fc  .Z....P.bO{..4..
0020   c4 84 0a 6a 39 ad 3c 10  63 b2 22 c4 24 40 f4 b1  ...j9.<.c.".$@..

Changes:

- The new hexdump() function has been added to nbase.
- Old hdump() and lamont_dump() have been removed from nmap's code.
- A wrapper to the new hexdump(), called nmap_hexdump(), has been added
  to nmap's utils.cc. The wrapper basically prints the buffer returned 
  by hexdump() using nmap's log_write() function.
2009-08-25 18:09:19 +00:00
ron
d63fba1dd6 Add some more fingerprints that a commercial tool just found in an application I'm assessing.
I realize we're getting too many fingerprints to handle, but we can always trim it down later.
2009-08-25 00:05:02 +00:00
david
7c94424d70 Print out a debugging message with a file handle before closing it, not
after, in mmap_file on Windows.
2009-08-24 21:53:27 +00:00
david
f09c8091a4 Avoid doing a calculation with an uninitialized tv_start if no timeout
has been specified.
2009-08-24 21:32:01 +00:00
david
6dc99d0e25 Fix a typo in parse_fingerprint_file; after calling strpbrk we need to
test teh return value, not the (unchanged) value we passed in. This
would cause a segmentation fault instead of a fatal error if nmap-os-db
ended in a Fingerprint line that didn't have a terminating newline.
2009-08-24 21:25:06 +00:00
david
cac58924e0 Avoid dereferencing a NULL key in l_nsock_ncap_close. 2009-08-24 21:18:26 +00:00
david
c371d35714 Add a check against svc->probe_matched being NULL before doing a string
comparison in scanThroughTunnel. It is checked against NULL later in the
function, so presumably it can happen.
2009-08-24 21:14:51 +00:00
david
ddf05afe1b Fix a memory leak in l_nsock_get_info when trying to get information
from a closed socket.
2009-08-24 21:09:47 +00:00
david
cfeb9d6563 fclose the /proc/net/route file handle after reading routes from it. 2009-08-24 21:07:47 +00:00
david
cb226847e5 Move a couple of allocated string variables into the same scope where
they are freed to avoid a memory leak.
2009-08-24 21:02:32 +00:00
david
d6ea9ea18a Fix an array bound passed to GetModuleFileName. It should be the size of
our static buffer, not 1024.
2009-08-24 20:57:32 +00:00
david
41d053a1ed Fix a stupid bug I introduced: Use MAX and not MIN to give a minimum
size to the allocation of space for the --data-length.
2009-08-24 20:47:28 +00:00
ron
986ba5ab8c Realized the my check_get() function was elminating perfectly good hosts. Some of our printers use a '301 Moved Permanently' to redirect you to their login page from the root page, but my script was mistaking those for an off-site redirect. I changed check_get() to display a warning rather than causing the scan to fail. 2009-08-24 19:56:52 +00:00
david
66ec6eab6f Fix a memory leak in parse_single_fingerprint. This function isn't used
in Nmap, but only in the separate fingerprint utilities.
2009-08-24 19:19:11 +00:00
david
6bd9760f3b In xml_convert, handle the case when repl is the empty string on the
first iteration. This can't happen with the current data definitions,
but if it did it would result in memcpy being passed a null pointer.
(memcpy would be asked to do a zero-byte copy, so it would probably be
okay anyway, but it's better to be safe.)
2009-08-24 18:10:12 +00:00