1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-09 06:01:28 +00:00
Commit Graph

462 Commits

Author SHA1 Message Date
henri
c631af1c09 Added a --proxies <chain> option to nmap to let users specify proxies to use
from command line.

<chain> is expected (by nsock) to be a comma-separated list of proxies.
e.g.:
  http://relay1.local:8080,http://relay2.local:3128

This option has currently no effect.
2013-04-22 19:29:01 +00:00
david
6784954eee Use more automatic memory management in nmap_dns.cc. 2013-01-25 06:26:23 +00:00
david
50a4817671 Remove dynamically allocated fakeargv.
This used to be used to hold the original argv before quashing with -q.
Now that -q is gone, it was just a copy of argv.

fakeargv was also causing Valgrind to complain about leaked memory. it
wasn't a real leak, but now it's out of the report anyway.
2013-01-25 06:26:21 +00:00
david
e1fba2d663 Merge r30416:30527 from /nmap-exp/david/ipv6-ranges.
This is a refactoring of target parsing that stores different types of
target specifications as different classes. The eventual intention is to
allow easy iteration over each specification for the purpose of IPv6
multicast host discovery.
2013-01-22 00:01:08 +00:00
david
d4ddff34d4 Point the --webxml stylesheet at the new repository.
The old URL at svn.insecure.org was a redirect pointing at the new
svn.nmap.org.
Unfortunately, it appears that the new URL still doesn't work, because
of same-origin issues.
http://seclists.org/nmap-dev/2013/q1/56
2013-01-20 10:23:04 +00:00
david
f86b575aa1 Remove -q (quash argv to "pine" option). 2013-01-04 18:59:11 +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
f4ff002c71 Warn on failure of munmap.
Patch based on one by Bill Parker.
http://seclists.org/nmap-dev/2012/q4/261
2012-11-22 00:50:16 +00:00
henri
e76d41fa04 Don't fatal() in nsock_set_default_engine()
Return negative value instead. Moved the fatal() statement to nmap.cc
2012-10-21 22:56:53 +00:00
henri
5aaf80a0b9 Added the list of available engines to the output of nmap -V 2012-10-21 20:21:02 +00:00
henri
1e3115dbcb Renamed nmap_fileexistsandisreadable() by file_is_readable(). Former was
hardly readable and is not even a good candidate for longest method
name (http://msdn.microsoft.com/en-us/library/system.windows.media.textformatting.textsource.gettexteffectcharacterindexfromtextsourcecharacterindex.aspx#Y0)
2012-10-20 15:00:10 +00:00
david
03d4b03d2c Get rid of "using namespace std".
Importing the whole std namespace caused a problem with Clang and the
punning of bind and std::bind.

http://seclists.org/nmap-dev/2012/q4/58

The Web's opinion of "using namespace std" also seems to be more against
than for.
2012-10-11 04:45:50 +00:00
david
53cb923ffd Call socket_bindtodevice in FTP bounce scan. 2012-10-03 15:43:26 +00:00
david
a0601febeb Store port numbers in host byte order in number-to-service mapping.
I don't know why these were in network byte order. Every single
interaction had a htons on entrance and ntohs on exit.
2012-09-25 05:24:16 +00:00
david
b2a1ff8e54 Fix broken protocol lookup.
For some reason (probably by imitation of nmap_getservbyport), protocol
numbers, which are byte values 0–255, had htons called on them after
being read from nmap-protocols. On little-endian platforms, this turned
them into integers 0x0100, 0x0200, 0x0300, etc.

protocol_table is supposed to be an array of 256 linked lists, linking
all the protocol names of the same number. Because of the above htons
conversion, all protocols mapped to bucket 0 on lookup instead. Perhaps
in an attempt to work around this broken lookup, all protocols were
inserted into bucket 0 on init; all other buckets were empty. This
worked on little-endian platforms, but on big-endian platforms where
htons is a no-op, all protocol numbers but 0 mapped to an empty linked
list.

Remove all the htons stuff and just look things up by integers. Use the
same mapping on initial insertion and on lookup, so that the buckets are
acutally populated.

This was noticed by hejianet.
http://seclists.org/nmap-dev/2012/q3/1005
2012-09-25 05:08:09 +00:00
david
40eb708922 Show gai_strerror in some error messages. 2012-09-15 17:56:14 +00:00
david
113e0b975f Break out resolve and resolve_numeric.
Besides the confusingness of the nodns argument being negatively
phrased, it had the value 0 in every existing call. Split out the nodns
special case into a separate function resolve_numeric.

This also has the side effect of changing the number of parameters to
the resolve function, which will cause a compile error for any calls I
might have missed changing when I changed the return code meaning in the
previous commit.

Ncat has its own copy of resolve, which obeys the global o.nodns rather
than a parameter. I'm leaving that alone for now. But give it the same
resolve_internal function, and make resolve call it with different flags
depending on the value of o.nodns.
2012-09-15 17:56:11 +00:00
david
0e738370ee Make resolve return a getaddrinfo error code.
The only error we can have apart from a getaddrinfo error is a list of
zero addresses; return EAI_NONAME in that case.

This unfortunately inverts the truth value of the return code of
resolve; 0 now means success.
2012-09-15 17:56:08 +00:00
david
8803578976 Don't use optarg outside of option parsing. 2012-09-15 17:53:29 +00:00
david
bc197f1877 Whitespace. 2012-09-14 21:08:23 +00:00
david
84fc27ee2d Make --route-dst option obey other command-line args.
--route-dst has been a useful debugging option, but it ran inline during
option processing and always used AF_UNSPEC to resolve names. Let it run
after options have been processed, so it can obey things like -6, -S,
and -e. Let it always resolve with o.af(), so you get different results:
  nmap --route-dst scanme.nmap.org
  nmap -6 --route-dst scanme.nmap.org
2012-09-11 21:00:47 +00:00
david
c1484a52a9 Wording, brevity. 2012-09-11 21:00:46 +00:00
david
bb075521ea Formatting in nmap.cc.
astyle -a -p -H -s2 -m2 nmap.cc
2012-09-11 20:43:24 +00:00
david
4357a97403 Make magic_port_set a bool. 2012-08-28 13:07:19 +00:00
kroosec
7ff385da85 First commit from rpc-grind branch. 2012-08-17 18:30:11 +00:00
david
0c3e0fcc4d Structured script output.
Scripts may now return a key–value table, or such a table in addition to
a string. The table will be automatically formatted for normal output
and will appear as a hierarchy of elements in XML output.

Some history and discussion of this development can be found at
https://secwiki.org/w/Nmap/Structured_Script_Output.

This is a merge of r29484:29569 from /nmap-exp/david/xml-output.
2012-08-14 16:36:25 +00:00
david
129ebc4634 Add the --disable-arp-ping option.
This option disables implicit ARP and ND host discovery (the implicit
discovery that would happen even if you used -Pn or IP-based discovery.)
2012-07-16 18:11:21 +00:00
sean
9b09390c52 Added a comment explaining the log-errors handling section 2012-06-30 01:45:10 +00:00
sean
0909f12308 Removed the log-errors option from the code, by treating it as if it was always true. This was done for the action item of o Remove Nmap's --log-errors feature and make its behavior the default. I also updated the docs/refguide.xml to reflect this change. I have not yet compiled the Dockbook.xml however. 2012-06-30 00:36:15 +00:00
david
42f71759c2 Use one, not two, spaces after "WARNING:".
There were more cases of one space than two.
2012-06-20 20:13:51 +00:00
fyodor
4402144394 Moved the setuid check from main.cc to nmap.cc after option parsing so that I can use error() and have it write to output file with --log-errors, etc. I did receive a complaint that the setuid warning isn't converted to script kiddie mode when -oS is enabled. If we decide that we want script kiddify error messages, we'll have to add that support to error() 2012-06-02 18:08:39 +00:00
jah
99a37f8aa1 The greppable output was missing a new line character at the end of per host info lines when --host-timeout was used and the host timed-out (after something was received from that host). This issue was reported by Matthew Morgan. 2012-05-22 20:46:57 +00:00
david
56b7063aa9 Use a header file constant for xmloutputversion. 2012-05-05 18:02:37 +00:00
david
1599aa6fe8 Make osclass XML elements children of the osmatch element they belong to.
Add the --deprecated-xml-osclass to restore the old output.
2012-05-05 18:02:33 +00:00
david
ef2987bc68 Don't print_iflist until after win_init. 2012-05-05 00:43:35 +00:00
david
f511045723 Make the two versions of target_needs_new_hostgroup the same.
Up to data structure differences. I'm not sure why they differed to
begin with, though I remember writing the comment that explains that
they differed. This is related to a problem reported by Daniel Miller:
http://seclists.org/nmap-dev/2012/q1/675.
2012-04-17 22:55:09 +00:00
david
035866237a Whitespace. 2012-04-17 04:36:06 +00:00
henri
b1086ac340 Added a --nsock-engine option to nmap, nping and ncat to enforce use of a
given nsock IO engine. [Henri]
2012-03-01 09:05:02 +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
fyodor
984f62f5bc Patrik suggested that we add --script-args-file to the Nmap help screen, which I think is a good idea (done) 2012-01-03 07:18:14 +00:00
fyodor
bb62bab448 o Added the new --script-args-file option which allows you to specify
the name of a file containing all of your desired NSE script
  arguments.  The arguments may be separated with commas or newlines
  and may be overridden by arguments specified on the command-line
  with --script-args. [Daniel Miller]
2012-01-03 07:14:20 +00:00
david
9941656055 Require separate host groups for targets with different source addresses. 2011-12-30 18:19:07 +00:00
david
08b5d81db5 Fix nmap_fetchfile_userdir for non-Windows. 2011-12-20 21:21:44 +00:00
david
5d362169f2 o On Windows, the directory <HOME>\AppData\Roaming\nmap is now
searched for data files. This is the equivalent of $HOME/.nmap on
  POSIX.
2011-12-20 21:11:21 +00:00
david
149ff73451 Check the NMAP_UPDATE_CHANNEL subdirectory first. 2011-12-16 02:55:27 +00:00
david
233fd6c0f9 Comment improvement. 2011-12-16 02:55:26 +00:00
david
212c2a82cb Split out a subroutine in nmap_fetchfile. 2011-12-15 21:13:42 +00:00
david
ee024fde3a Make the comment about fetchfile search order better. 2011-12-15 21:13:41 +00:00
david
6cbd5a9a58 Allow --exclude and --excludefile together. 2011-12-08 23:16:57 +00:00