1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-20 22:49:01 +00:00
Commit Graph

2789 Commits

Author SHA1 Message Date
david
46378a0dfd Rearrange the dnet route functions so they are all together, add a function
comment.
2009-01-01 19:33:19 +00:00
david
adab33deb9 Split out the assignment of interfaces to routes into a postprocessing step. We
need to have all the routes available before assigning interfaces to handle a
situation like the following:

# nmap --iflist
************************INTERFACES************************
DEV  (SHORT) IP/MASK        TYPE        UP MAC
lo0  (lo0)   127.0.0.1/8    loopback    up
ppp0 (ppp0)  YY.YY.YY.YY/16 point2point up

# netstat -rn
Destination  Gateway      Flags  Refs  Use  Netif Expire
default      XX.XX.XX.XX  UGSc      7   16   ppp0
XX.XX.XX.XX  YY.YY.YY.YY  UH        8    0   ppp0

Here the second route can be matched up immediately with the ppp0 device,
because the YY.YY.YY.YY gateway address matches the YY.YY.YY.YY/16 IP and mask
of ppp0. But the first route (default) needs to go through the second route in
order to find its interface. So we don't reject the default route immediately,
but save it an try to match it with an interface after all routes have been
found. See http://seclists.org/nmap-dev/2008/q4/0576.html for more information.
2009-01-01 19:29:44 +00:00
david
9f7cffc025 Refactor getsysroutes. It had two ways to get routes: by reading
/proc/net/route and with libdnet. I split those into two separate functions.
2009-01-01 16:45:55 +00:00
fyodor
516a8ddd0c proofreading from Raul Siles 2008-12-31 22:22:12 +00:00
david
3414659676 Give TCP probes that result in a filtered state a lower rank. When a TCP gets a
positive response that results in being marked filtered, the reply was an ICMP
error. Such probes are now ranked a 2 along with UDP, IP proto, and other
probes that get ICMP replies that are likely to be rate limited. Previously
they got the highest rank, 6, because they were TCP probes other than SYN to an
open port. SYN to an open port retains its rank of 3.
2008-12-30 23:45:28 +00:00
david
7261608125 Update the German Zenmap translation by Chris Leick. Debian bug #510158. 2008-12-30 19:46:17 +00:00
batrick
1a22089dd0 Changed nil or none to be acceptable for the first value of the try function. 2008-12-30 06:56:44 +00:00
kris
5e28ad96d4 Adding nsi_set_debug() to Nsock to enable socket debugging (SO_DEBUG) 2008-12-30 01:23:49 +00:00
batrick
3016193c11 Improvements to the nmap library. See [1] for discussion and a full listing of
the changes.

[1] http://seclists.org/nmap-dev/2008/q4/0663.html
2008-12-29 21:59:08 +00:00
jah
3fb2b96f78 Fix a couple of typos in openssl.luadoc:
Descrypt -> Decrypt
encrypt  -> decrypt
2008-12-29 18:28:45 +00:00
david
9b82189c39 Make the documentation for nmap.new_try more clear on a suggestion by Patrick. 2008-12-29 04:08:43 +00:00
david
bc32baff98 Destroy connect scan probes that aren't otherwise handled (thereby closing the
socket). It's possible to get an EHOSTUNREACH or EHOSTDOWN (and possibly other
errors) against a nonexistent LAN host and formerly the socket wasn't closed.
This allowed Nmap's internal count of sockets to be less that the true count of
open sockets. It would eventually try to open too many sockets and quit with
the message

Socket creation in sendConnectScanProbe: Too many open files (24)

Be aware that in this message 24 is the errno, not the number of open files.
2008-12-26 22:26:17 +00:00
ron
67f9577de9 No longer erroring if a server leaves out the 'domain' section of packets (some configurations of Samba seem to do this) 2008-12-24 20:36:30 +00:00
batrick
38394e9f24 Corrected an output line that Ron left in from a patch I gave him.
The script's filename cannot be acessed when a thread's target times out
because we do not have access to the thread's environment when it is yielded.
All we can do is print out which target timed out. This output can
unfortunately be printed out many times for each thread (it is currently
difficult to track).
2008-12-24 08:40:03 +00:00
ron
1c08d02689 Updated the output section for smb-enum-processes.nse 2008-12-24 00:58:52 +00:00
ron
773000b65a Merging changes from my experimental branch; the new versions of this scripts, which have significant changes to their core functionality, managed to hold their own against Brandon's network. More testing would be very helpful, though, especially with credentials (most of Brandon's scans were anonymous). 2008-12-24 00:53:01 +00:00
david
a246aaf469 Only increase max_successful_tryno when we have a positive response to a probe;
i.e., the probe didn't just time out. This was the case before r11253 when I
mistakenly removed it. I meant only to allow ultrascan_adjust_timing to be
called when rcvdtime == NULL, but as a side effect I also allowed
max_successful_tryno to increase in that case too. I was able to get that bit
of code to run with rcvdtime == NULL in a normal scan, but I don't think it
happens often.

I also improved the comments in that block of code.
2008-12-23 02:29:04 +00:00
kris
8eb6313aa2 updating ip_is_reserved(): 108/8 and 184/8 allocated 2008-12-22 18:17:34 +00:00
kris
e36c7e3e9a change sizeof(struct sockaddr_storage) to real sockaddr len 2008-12-22 00:05:22 +00:00
kris
3d7a640364 Wrap sin6{} in #if HAVE_IPV6 2008-12-21 22:49:39 +00:00
kris
c6cd59cc16 pass flags from Send() to send() 2008-12-21 22:46:22 +00:00
david
4f3dbf5d56 Add some more TCP cheat ports. The new ones are
3306	mysql
8080	http-proxy
1723	pptp
111	rpcbind
995	pop3s
993	imaps
5900	vnc
1025	NFS-or-IIS
587	submission
8888	sun-answerbook
199	smux
1720	H.323/Q.931
2008-12-19 22:45:58 +00:00
david
46f8875b6e Add to CHANGELOG:
o A problem that caused OS detection to fail for most hosts in a
  certain was fixed. It happened when sending raw Ethernet frames
  (by default on Windows or on other platforms with --send-eth) to
  hosts on a switched LAN. The destination MAC address was wrong for
  most targets. The symptom was that only one out of each scan group
  of 20 or 30 hosts would have a meaningful OS fingerprint. Thanks go
  to Michael Head for running tests and especially Trent Snyder for
  testing and finding the cause of the problem. [David]
2008-12-19 21:51:53 +00:00
david
dbb6464deb Fill in the destination MAC address before each probe sent in OS scan.
This fixes the following bug: When scanning with an Ethernet handle (as
opposed to raw sockets), only the first host in an OS scan group would
get a result. All others would be blank fingerprints with R=N for every
probe. This was first noticed on Windows because Ethernet is the default
sending method, but it affects other platforms with --send-eth.

OS scan initialized an Ethernet handle once for each group, and recorded
the first-hop MAC address of the first target at that time. That
first-hop address was used for all targets. This failed on a switched
LAN, when the first-hop address for every host is different (it's the
MAC address of each target).

All the various high-level probe sending functions now do their work
through three low-level sending functions: one each for TCP, UDP, and
ICMP. Those low-level functions take care of setting the MAC addresses
before each send.

I checked and the other places where Ethernet sends are used do not have
this problem. ultra_scan, idle scan, and traceroute all set the
addresses before every send.
2008-12-19 19:54:06 +00:00
david
b4dbc10f0c Rename the function send_closedudp_probe_2 to send_closedudp_probe (lose the _2
suffix). It was named this was to avoid a name conflict with first-gen OS
detection, which isn't a problem now.
2008-12-19 18:39:29 +00:00
david
fc9290d734 Remove the unused seq_info array from HostOsScanInfo. That information is kept
in a variable in HostOsScanStats and reinitialized for each scan round. The two
variables had the same name (si) and it was confusing.
2008-12-19 17:59:01 +00:00
fyodor
2ba1f3f14b Add 554 and 256 to the popular ports list. They aren't open as often as some others, but they still provide a lot of value (closed ports are as useful as open ones for pop_ports purposes 2008-12-19 06:56:26 +00:00
david
7aa5ed3008 Update the list of cheat TCP ports from the latest nmap-services with frequency
measurements. These commonly responsive ports are moved to the front of the
list when randomizing ports to help us quickly get some timing feedback and
find a timing ping probe.

The previous list was
	{ 21, 22, 23, 25, 53, 80, 113, 256, 389, 443, 554, 636, 1723, 3389 }
The new list is
	{ 80, 23, 443, 21, 22, 25, 3389, 110, 445, 139, 143, 53, 135, 113 }

The ports that were removed are
256     fw1-secureremote
389     ldap
554     rtsp
636     ldapssl
1723    pptp

The ports that were added are
110     pop3
135     msrpc
139     netbios-ssn
143     imap
445     microsoft-ds
2008-12-19 06:21:22 +00:00
david
eb7fda541e Fix global congestion control in OS scan.
Like ultra_scan, OS scan has global and host-based congestion control
mechanisms like those in TCP. Part of global congestion control is
keeping track of how many probes are outstanding in the network; OS scan
keeps the number in a member variable called num_probes_active.

num_probes_active is meant to be the sum of the sizes of each host's
list of outstanding probes. It was correctly being decremented whenever
a probe was removed from an active list, but it was never incremented.
num_probes_active was always zero or negative, and therefore never
exceeded the global congestion window. This almost completely disabled
global congestion control.

With this fix OS scan will send a maximum of ten probes immediately at
the beginning of the scan. Previously it was limited only by the number
of hosts being scanned (20 or 30).
2008-12-18 04:49:49 +00:00
david
9a37ef907f Remove some unused OS scan performance variables. 2008-12-18 04:27:28 +00:00
kris
31d3f882f8 Removing some prototypes for functions that aren't around anymore 2008-12-17 22:53:26 +00:00
bmenrigh
c4bebb3a01 Starting in Lua 5.1, string.gfind was renamed to string.gmatch. This commit fixes a warning when gfind is used by using gmatch instead. 2008-12-17 20:43:57 +00:00
david
9fe196bb0b o Fixed a division by zero error in the packet rate measuring code
that could cause a display of infinity packets per seconds near the
  start of a scan. [Jah]
2008-12-17 02:48:14 +00:00
bmenrigh
7922c3edb5 Added/fixed a few RICOH/LANIER printer FTP/HTTP matches 2008-12-17 01:34:51 +00:00
fyodor
9815a95ff5 regenerated 2008-12-14 06:17:06 +00:00
fyodor
ffde458abe sorting 2008-12-14 06:16:50 +00:00
david
4ff6b3d67e Give RateMeter::elapsedTime public visibility. 2008-12-13 04:31:40 +00:00
batrick
88419b0c6e Cleaned up the creation of the string payload. 2008-12-09 06:00:50 +00:00
batrick
f08596bf49 Fixed a misspelling. 2008-12-09 01:37:10 +00:00
ron
32f6181224 Updated some error messages for more clarity, and added a number after them to help track back issues that may arise. 2008-12-08 15:06:17 +00:00
ron
80dec40366 Added some more DOS constants that Brandon ran across 2008-12-08 03:48:23 +00:00
ron
86de493a3e Changed smb-enum-shares to detect a host that returns the incorrect value for unknown shares (happened against what appears to be a EMC SANS). Also added a check to stdnse.strjoin() to ensure that the first parameter is either nil or a string, I got the parameters wrong and spent awhile trying to figure otu why. 2008-12-08 03:33:25 +00:00
ron
da4a8ef302 Fixed a bug where int8 arrays wouldn't align properly (I hadn't noticed it before because the only place it's used is in registry functions, and all following variables were either ignored or set to the proper value by luck 2008-12-07 19:10:17 +00:00
ron
ea42f39faa Merged in significant changes to Microsoft RPC calls 2008-12-07 16:16:11 +00:00
batrick
e6505d9954 Corrected nmap.print_debug_unformatted to print if the verbosity is greater
than or _equal_ to the specified verbosity.
See http://nmap.org/nsedoc/modules/stdnse.html#print_debug
2008-12-07 09:22:29 +00:00
batrick
c361d17734 Cleaned up some code for mutexes. 2008-12-07 01:25:14 +00:00
david
e70d1966d9 Add a translation of Zenmap into German by Chris Leick. Originally from Debian
bug #507867.
2008-12-06 19:08:56 +00:00
fyodor
659d1caaff latest build 2008-12-06 08:39:08 +00:00
fyodor
f0928c9db3 update to new shorter format of Amazon URLs 2008-12-06 08:38:58 +00:00
david
be28828544 Add a patch by Tom Sellers to use "html-title.nse" in the debug messages of the
script of that name, instead of the old name "showHTMLTitle."
2008-12-06 02:48:30 +00:00