1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-21 15:09:02 +00:00
Commit Graph

9911 Commits

Author SHA1 Message Date
dmiller
314a519dfc Delay loading modules and objects until gettext is loaded
This was resulting in strings not getting translated, especially when
the calls to gettext came at the lowest indent level of the module.
2014-01-09 22:27:15 +00:00
dmiller
bc47cb3d97 Replace explicit X == True/False with X/not X 2014-01-09 16:47:24 +00:00
dmiller
51b143353b Replace == and != with is and is not for comparisons with None 2014-01-09 16:47:20 +00:00
dmiller
96141b431e Implement "make check" for zenmap
Currently, this just uses Python's unittest module to autodiscover
tests, which may skip some, but is better than nothing. TODO: move tests
to their own module and let the zenmap_check target test them directly.
2014-01-09 16:39:39 +00:00
dmiller
3c9eeb3608 Remove some unneeded imports of re, and compile one pattern 2014-01-08 23:09:32 +00:00
dmiller
b254234118 Replace key existence tests with dict.get()
Replaced instances of this pattern:

if 'key' in somedict:
    var = somedict['key']
else:
    var = ""

...with this much simpler pattern:

var = somedict.get('key', "")

Some variations, like returning None if the key is not found were also
replaced.
2014-01-08 20:28:12 +00:00
dmiller
5c662fffdc Apply PEP 8 style guidance to zenmap
Using the pep8 tool (https://pypi.python.org/pypi/pep8), fixed the
following style issues:

Count   Issue
11      E201 whitespace after '['
8       E203 whitespace before ','
41      E211 whitespace before '('
11      E221 multiple spaces before operator
61      E225 missing whitespace around operator
237     E231 missing whitespace after ':'
91      E251 no spaces around keyword / parameter equals
19      E261 at least two spaces before inline comment
41      E301 expected 1 blank line, found 0
200     E302 expected 2 blank lines, found 1
356     E303 too many blank lines (2)
563     E501 line too long (106 characters)
39      E701 multiple statements on one line (colon)
13      E702 multiple statements on one line (semicolon)
4       W291 trailing whitespace
2       W293 blank line contains whitespace
8       W391 blank line at end of file
21      W601 .has_key() is deprecated, use 'in'
2       W602 deprecated form of raising exception

The remaining issues are long lines due to very deep data structures. I
chose not to alter them, as it would involve backslash-continuation
where whitespace is not permitted:

./zenmapGUI/ScanInterface.py:323:80: E501 line too long (90 characters)
./zenmapGUI/ScanInterface.py:456:80: E501 line too long (84 characters)
./zenmapGUI/ScanInterface.py:464:80: E501 line too long (84 characters)
./zenmapGUI/ScanInterface.py:472:80: E501 line too long (122 characters)
./zenmapGUI/ScanInterface.py:479:80: E501 line too long (122 characters)
./zenmapGUI/ScanInterface.py:920:80: E501 line too long (94 characters)
./zenmapGUI/ScanInterface.py:923:80: E501 line too long (93 characters)
./zenmapGUI/MainWindow.py:575:80: E501 line too long (99 characters)
./zenmapGUI/MainWindow.py:906:80: E501 line too long (99 characters)
2014-01-08 19:50:22 +00:00
d33tah
9210a7f1fa Replace '# Fingerprint' with just '#' to make it more consistent. 2014-01-08 01:14:33 +00:00
dmiller
7e521bcc4f Remove unecessary circular import from radialnet.util.misc 2014-01-07 20:03:46 +00:00
dmiller
0c995f95d8 Add missing make_graph_from_nmap_parser needed by some unittests 2014-01-07 20:03:44 +00:00
dmiller
fc49e4ade6 Let "make check" only check appropriate things
When configuring --without-ncat, "make check" was trying to run Ncat's
test suite. This commit splits the check target into ncat_check and
nsock_check, and makes each conditional on that subsystem's configure
status.
2014-01-07 19:04:12 +00:00
dmiller
351054de12 Add some CHANGELOG entries for recent changes 2014-01-06 20:19:23 +00:00
dmiller
d1304e602c Fix windows build breakage from r32558 2014-01-06 20:19:21 +00:00
d33tah
4816358475 Replace all tab characters at the beginnings of lines with 8 spaces.
Mixed indentation annoyed my vim.
2014-01-05 19:14:26 +00:00
dmiller
3570ca78d8 Adjust unittest definitions to generate proper nsedoc 2014-01-04 03:48:13 +00:00
dmiller
c70a7be88f Remove stupid hacks that are unneeded because of select() magic 2014-01-03 23:02:02 +00:00
dmiller
739fee324b Fix some requires in unittest.lua 2014-01-03 21:16:38 +00:00
dmiller
d95cbeb2b9 Add some unit tests to ipOps. Far from complete coverage! 2014-01-03 21:10:03 +00:00
dmiller
dc617c42f3 New unittest library and driver script for NSE testing
Please read the documentation. This is a way to add unit testing to NSE
libraries (not scripts, yet). Please add tests to your libraries!
Examples to come in further commits.
2014-01-03 21:10:01 +00:00
dmiller
54cea8be4f Let nsedebug.tostr support other datatypes with tostring
Instead of erroring, just use tostring to handle functions, userdata,
etc. This works for booleans and numbers, too, so no need for special
handling there.

Also switched from a string-concatenation model to a table-building one,
with a final concatenation. This could prevent catastrophic slowness
with representing large tables due to continuous reallocation of
strings.
2014-01-03 21:09:59 +00:00
dmiller
395a91b026 Fix @output nsedoc for targets-asn 2014-01-03 21:09:57 +00:00
d33tah
7d5879d4d1 Fix an assertion that always evaluated to true. Reported by David
Binderman here: http://seclists.org/nmap-dev/2014/q1/6
2014-01-02 17:18:32 +00:00
dmiller
4842def2f6 Update bundled liblua from 5.2.2 to 5.2.3 2014-01-02 15:33:55 +00:00
d33tah
36fc84ab31 Fix coding style - only run begin_sniffer in case of a raw scan. 2013-12-30 18:56:43 +00:00
henri
0ba3dc0be7 Include stddef only if required 2013-12-30 14:35:50 +00:00
d33tah
c7927c5449 Add missing stddef.h import. 2013-12-30 13:58:46 +00:00
fyodor
8418f18274 Minor updates to comments. For example, wanted to clarify that the Nikto http-enum integration was done with cooperation/encouragement from Nikto folks 2013-12-27 03:45:53 +00:00
fyodor
5d0eb7aaec Add some ports/descriptions sent in by James Cole 2013-12-26 00:36:45 +00:00
dmiller
b5d9c1107f checklibs.sh: newest didn't work when newest version was first in list 2013-12-24 19:23:33 +00:00
dmiller
08a12f3921 Added a script to check for newer versions of included libs
Just run "sh checklibs.sh". Currently checks liblua, libpcre, libpcap,
and prints the latest version of liblinear (no version info is in the
copy we have). Requires perl, curl, and a C compiler (cc).
2013-12-24 16:57:36 +00:00
david
ee701dc116 Add a new Windows 8 fingerprint. 2013-12-24 00:12:08 +00:00
dmiller
338dcb115c [Ndiff] Fix DeprecationWarning under python -3
Classes that inherit __hash__ and comparison functions like __eq__ (e.g.
from object) but only override one of them will break under Python 3.
This is because a class shouldn't use one criterion for equality and a
different one for hashing. Explicitly discarding the inherited __hash__
method disables this warning and makes the class unhashable (not a
problem in this case).
2013-12-23 20:12:40 +00:00
dmiller
57135c89c1 A couple more todo items. Enough for now. 2013-12-23 17:54:26 +00:00
dmiller
038f56df22 Genericize OpenBSD fingerprint with bad # character
d33tah noticed that the # in "Fingerprint OpenBSD 5.0 GENERIC#43 i386"
was being interpreted as a comment, resulting in matches for "OpenBSD
5.0 GENERIC". Looking at this, it appears that no other OS fingerprints
put the build number in the Fingerprint line, and this fingerprint
closely matches another OpenBSD 5.0 fingerprint. Changed to drop
everything after GENERIC.
2013-12-23 16:49:11 +00:00
sophron
55e066c0e6 [NSE] Added a feature that integrates Nikto's large db to our http-fingerprint file on runtime. http://seclists.org/nmap-dev/2013/q4/292 2013-12-23 15:50:19 +00:00
dmiller
df4c69306b New todo file for me. 2013-12-23 13:31:19 +00:00
dmiller
dc0f5b592e Fix incorrect invocation of NmapParser in NetworkInventory.open_from_file 2013-12-20 22:13:28 +00:00
sophron
0645d18764 [NSE] Renamed and fixed the script that detects Zimbra LFI. Patch by Ron Bowes. 2013-12-19 20:45:49 +00:00
dmiller
771a6a0793 Fix more Lua patterns with '-', see r32566 2013-12-19 20:34:46 +00:00
dmiller
45cd8091a4 Fix Lua patterns that contain -
"-" in a Lua pattern means "ungreedy zero-or-more" and must be escaped
to match a literal "-". http://www.lua.org/manual/5.2/manual.html#6.4.1
2013-12-19 20:05:09 +00:00
sophron
c52c5476de [NSE] Added a script that detects Zimbra zero-day LFI. Script written by Paul Amar. 2013-12-18 22:42:15 +00:00
dmiller
228f0bec77 Fix ICMPv6 assertion failure: http://seclists.org/nmap-dev/2013/q4/290 2013-12-17 14:10:49 +00:00
fyodor
ebfe8e32dd Add a note about upgrading our included libpcap (a recent email from Daniel Miller reminded me that 1.5.2 is now available while we are still shipping 1.2.1) 2013-12-15 02:21:36 +00:00
fyodor
7b5ec8d43d o Added version detection signatures and probes for a bunch of Android
remote mouse/keyboard servers, including AndroMouse, AirHID,
  Wifi-mouse, and RemoteMouse. [Paul Hemberger]
2013-12-14 22:23:29 +00:00
dmiller
2506269bcc Let nsock's configure take the same --with-libpcap as Nmap does 2013-12-11 23:17:50 +00:00
dmiller
44e251306e Re-autoconf the configure scripts (using 2.69) 2013-12-11 23:17:47 +00:00
dmiller
a379a8ba2b Use CPPFLAGS for -I, not CFLAGS or CXXFLAGS
CPPFLAGS is for the C Pre-Processor, and should be used for -I flags. In
a couple cases (nping, nmap) this was resulting in duplicate -Ilibpcap
arguments.
2013-12-11 23:17:42 +00:00
dmiller
26665465c6 Refactor ftp bounce scan into nmap_ftp.{h,cc}
By factoring this code out, we make it easier to convert to NSE.
http://seclists.org/nmap-dev/2013/q4/255
2013-12-11 02:23:58 +00:00
sophron
f280a93538 [NSE] Added a detection method and the option to execute a payload. Patch by Paul Amar. 2013-12-09 15:54:43 +00:00
david
98bbff8b69 Remove unused local. 2013-12-05 23:41:21 +00:00