[-]
[+]
|
Changed |
nmap.spec
|
|
[-]
[+]
|
Deleted |
nmap-5.50.tar.bz2/nmap-5.50-1.spec
^
|
@@ -1,139 +0,0 @@
-# To build a static RPM, add
-# --define "static 1"
-# to the rpmbuild command line. To build without Ncat, add
-# --define "buildncat 0"
-# To build without Nping, add
-# --define "buildnping 0"
-#
-# To specify openssl dir, add something like:
-# --define "openssl /usr/local/ssl"
-
-%define name nmap
-%define version 5.50
-%define release 1
-%define _prefix /usr
-
-Summary: Network exploration tool and security scanner
-Name: %{name}
-Version: %{version}
-Release: %{release}
-Epoch: 2
-License: http://nmap.org/man/man-legal.html
-Group: Applications/System
-Source0: http://nmap.org/dist/%{name}-%{version}.tgz
-URL: http://nmap.org
-
-# For Ndiff.
-Requires: python >= 2.4
-
-# RPM can't be relocatable until I stop storing path info in the binary.
-# Prefix: %{_prefix}
-BuildRoot: %{_tmppath}/%{name}-root
-
-%description
-
-Nmap ("Network Mapper") is a free and open source utility
-for network exploration or security auditing. Many systems and network
-administrators also find it useful for tasks such as network
-inventory, managing service upgrade schedules, and monitoring host or
-service uptime. Nmap uses raw IP packets in novel ways to determine
-what hosts are available on the network, what services (application
-name and version) those hosts are offering, what operating systems
-(and OS versions) they are running, what type of packet
-filters/firewalls are in use, and dozens of other characteristics. It
-was designed to rapidly scan large networks, but works fine against
-single hosts. Nmap runs on all major computer operating systems, and
-both console and graphical versions are available.
-
-%prep
-%setup -q
-
-%build
-%configure --with-openssl=%{openssl} --without-zenmap --with-ndiff --with-libdnet=included --with-libpcap=included --with-libpcre=included --with-liblua=included
-%if "%{buildncat}" == "0"
-%configure --without-ncat
-%endif
-%if "%{buildnping}" == "0"
-%configure --without-nping
-%endif
-%if "%{static}" == "1"
-make static
-%else
-make
-%endif
-
-%install
-[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
-make install DESTDIR=$RPM_BUILD_ROOT
-strip $RPM_BUILD_ROOT%{_bindir}/* || :
-gzip $RPM_BUILD_ROOT%{_mandir}/man1/* || :
-
-%clean
-[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
-
-%files
-%defattr(-,root,root)
-%doc COPYING
-%doc docs/README
-%doc docs/nmap.usage.txt
-%doc %{_prefix}/share/man/man1/nmap.1.gz
-%doc %{_prefix}/share/man/*/man1/nmap.1.gz
-%{_bindir}/nmap
-%{_datadir}/nmap
-
-%{_bindir}/ndiff
-%doc %{_prefix}/share/man/man1/ndiff.1.gz
-
-# Ncat subpackage
-%if "%{buildncat}" != "0"
-%package -n ncat
-Summary: Nmap's Netcat replacement
-Group: Applications/System
-
-%description -n ncat
-Ncat is a feature packed networking utility which will read and
-write data across a network from the command line. It uses both
-TCP and UDP for communication and is designed to be a reliable
-back-end tool to instantly provide network connectivity to other
-applications and users. Ncat will not only work with IPv4 and IPv6
-but provides the user with a virtually limitless number of potential
-uses.
-
-%files -n ncat
-%defattr(-,root,root)
-%doc %{_prefix}/share/man/man1/ncat.1.gz
-%{_bindir}/ncat
-%{_datadir}/ncat
-
-%endif
-
-# Nping subpackage
-%if "%{buildnping}" != "0"
-%package -n nping
-# If this 0. prefix is removed it must also be removed from Makefile.in.
-Version: 0.%{version}
-Summary: Nping packet generator
-Group: Applications/System
-
-%description -n nping
-Nping is an open source tool for network packet generation, response
-analysis and response time measurement. Nping allows to generate network
-packets of a wide range of protocols, letting users to tune virtually
-any field of the protocol headers. While Nping can be used as a simple
-ping utility to detect active hosts, it can also be used as a raw packet
-generator for network stack stress tests, ARP poisoning, Denial of
-Service attacks, route tracing, etc.
-
-%files -n nping
-%defattr(-,root,root)
-%doc %{_prefix}/share/man/man1/nping.1.gz
-%{_bindir}/nping
-
-%endif
-
-%changelog
-
-* Sat Jun 06 2009 Fyodor (fyodor(a)insecure.org)
-- Removed changelog entries as SVN is a more authoritative source. Execute:
-- svn log --username guest --password "" svn://svn.insecure.org/nmap/nmap.spec.in
-
|
[-]
[+]
|
Deleted |
nmap-5.50.tar.bz2/zenmap-5.50-1.spec
^
|
@@ -1,90 +0,0 @@
-# By default, Zenmap will be built using whatever version of Python is
-# the default on your system. To change this, use something like
-# --define "__python /usr/bin/python2.5"
-
-%define name zenmap
-%define version 5.50
-%define release 1
-%define _prefix /usr
-
-# Find where Python modules are installed. See
-# http://fedoraproject.org/wiki/Packaging/Python.
-%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
-
-Summary: Multi-platform graphical Nmap frontend and results viewer
-Name: %{name}
-Version: %{version}
-Release: %{release}
-Epoch: 2
-License: http://nmap.org/man/man-legal.html
-Group: Applications/System
-Source0: http://nmap.org/dist/nmap-%{version}.tgz
-URL: http://nmap.org
-BuildArch: noarch
-
-# Disable automatic dependency calculation because we want to provide
-# packages for more than one version of Python. Without this, RPM will
-# grep through the installed files and automatically add things like
-# Requires: python(abi) = 2.4
-# setup.py takes care of adjusting sys.path to point to wherever the
-# modules were installed so it's not dependent on any particular ABI.
-AutoReqProv: no
-Requires: python >= 2.4, nmap, pygtk2
-
-Prefix: %{_prefix}
-BuildRoot: %{_tmppath}/%{name}-root
-
-%description
-Zenmap is an Nmap frontend. It is meant to be useful for advanced users
-and to make Nmap easy to use by beginners. It was originally derived
-from Umit, an Nmap GUI created as part of the Google Summer of Code.
-
-%prep
-%setup -q -n nmap-%{version}
-
-%build
-# Cannot use configure macro because noarch-redhat-linux is not
-# recognized by the auto tools in the tarball. Upgrading to the
-# latest GNU CVS config.sub/config.guess on 3/15/08 didn't fix it. So
-# I'm using this approach, as is done by other projects, such as
-# http://mono.ximian.com/monobuild/snapshot/snapshot_packages/noarch/xsp/96614/xsp.spec
-# -Fyodor
-./configure --prefix=%{_prefix} \
- --libexecdir=%{_prefix}/lib \
- --bindir=%{_prefix}/bin \
- --datadir=%{_prefix}/share \
- --libdir=%{_prefix}/lib \
- --mandir=%{_prefix}/share/man \
- --infodir=%{_prefix}/share/info \
- --sysconfdir=%{_sysconfdir} \
- --without-openssl \
- --with-zenmap PYTHON="%{__python}"
-make build-zenmap DESTDIR=$RPM_BUILD_ROOT
-
-%install
-[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
-make install-zenmap DESTDIR=$RPM_BUILD_ROOT
-# Don't package the uninstaller with the RPM.
-rm -f $RPM_BUILD_ROOT%{_bindir}/uninstall_zenmap
-gzip $RPM_BUILD_ROOT%{_mandir}/man1/* || :
-
-%clean
-[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
-
-%files
-%defattr(-,root,root)
-%doc %{_mandir}/man1/zenmap.1.gz
-%{_bindir}/zenmap
-%{_bindir}/nmapfe
-%{_bindir}/xnmap
-# This gets the modules and the .egg-info file if it was installed.
-%{python_sitelib}/*
-%{_datadir}/zenmap
-%{_datadir}/applications/*.desktop
-
-%changelog
-
-* Sat Jun 06 2009 Fyodor (fyodor(a)insecure.org)
-- Removed changelog entries as SVN is a more authoritative source. Execute:
-- svn log --username guest --password "" svn://svn.insecure.org/nmap/zenmap.spec.in
-
|
[-]
[+]
|
Changed |
nmap-5.51.tar.bz2/CHANGELOG
^
|
@@ -1,4 +1,49 @@
-# Nmap Changelog ($Id: CHANGELOG 22072 2011-01-28 01:10:25Z fyodor $); -*-text-*-
+# Nmap Changelog ($Id: CHANGELOG 22229 2011-02-11 21:20:23Z fyodor $); -*-text-*-
+
+Nmap 5.51 [2011-02-11]
+
+o [Ndiff] Added support for prerule and postrule scripts. [David]
+
+o [NSE] Fixed a bug which caused some NSE scripts to fail due to the
+ absence of the NSE SCRIPT_NAME environment variable when loaded.
+ Michael Pattrick reported the problem. [Djalal]
+
+o [Zenmap] Selecting one of the scan targets in the left pane is
+ supposed to jump to that host in the Nmap Output in the right pane
+ (but it wasn't). Brian Krebs reported this bug. [David]
+
+o Fixed an obscure bug in Windows interface matching. If the MAC
+ address of an interface couldn't be retrieved, it might have been
+ used instead of the correct interface. Alexander Khodyrev reported
+ the problem. [David]
+
+o [NSE] Fixed portrules in dns-zone-transfer and ftp-proftpd-backdoor
+ that used shortport functions incorrectly and always returned
+ true. [Jost Krieger]
+
+o [Ndiff] Fixed ndiff.dtd to include two elements that can be diffed:
+ status and address. [Daniel Miller]
+
+o [Ndiff] Fixed the ordering of hostscript-related elements in XML
+ output. [Daniel Miller]
+
+o [NSE] Fixed a bug in the nrpe-enum script that would make it run for
+ every port (when it was selected--it isn't by default). Daniel
+ Miller reported the bug. [Patrick]
+
+o [NSE] When an NSE script sets a negative socket timeout, it now
+ causes a controlled Lua stack trace instead of a fatal error.
+ Vlatko Kosturjak reported the bug. [David]
+
+o [Zenmap] Worked around an error that caused the py2app bootstrap
+ executable to be non-universal even when the rest of the application
+ was universal. This prevented the binary .dmg from working on
+ PowerPC. Yxynaxen reported the problem. [David]
+
+o [Ndiff] Fixed an output line that wasn't being redirected to a file
+ when all other output was. [Daniel Miller]
+
+Nmap 5.50 [2011-01-28]
o [Zenmap] Added a new script selection interface, allowing you to
choose scripts and arguments from a list which includes descriptions
@@ -576,6 +621,10 @@
o Added a service detection probe for master servers of Quake 3 and
related games. [Toni Ruottu]
+o [Zenmap] Fixed an crash when printing a scan that had no output
+ (like a scan made by command-line Nmap). Henri Doreau noticed the
+ error. [David]
+
Nmap 5.35DC1 [2010-07-16]
o [NSE] Added 17 scripts, bringing the total to 131! They are
|
[-]
[+]
|
Changed |
nmap-5.51.tar.bz2/docs/nmap.1
^
|
@@ -2,12 +2,12 @@
.\" Title: nmap
.\" Author: [see the "Author" section]
.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
-.\" Date: 01/21/2011
+.\" Date: 02/11/2011
.\" Manual: Nmap Reference Guide
.\" Source: Nmap
.\" Language: English
.\"
-.TH "NMAP" "1" "01/21/2011" "Nmap" "Nmap Reference Guide"
+.TH "NMAP" "1" "02/11/2011" "Nmap" "Nmap Reference Guide"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
@@ -117,7 +117,7 @@
.RS 4
.\}
.nf
-Nmap 5\&.50 ( http://nmap\&.org )
+Nmap 5\&.51 ( http://nmap\&.org )
Usage: nmap [Scan Type(s)] [Options] {target specification}
TARGET SPECIFICATION:
Can pass hostnames, IP addresses, networks, etc\&.
|
[-]
[+]
|
Changed |
nmap-5.51.tar.bz2/docs/nmap.usage.txt
^
|
@@ -1,4 +1,4 @@
-Nmap 5.50 ( http://nmap.org )
+Nmap 5.51 ( http://nmap.org )
Usage: nmap [Scan Type(s)] [Options] {target specification}
TARGET SPECIFICATION:
Can pass hostnames, IP addresses, networks, etc.
|
[-]
[+]
|
Changed |
nmap-5.51.tar.bz2/docs/zenmap.1
^
|
@@ -2,12 +2,12 @@
.\" Title: zenmap
.\" Author: [see the "Authors" section]
.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
-.\" Date: 01/21/2011
+.\" Date: 02/11/2011
.\" Manual: Zenmap Reference Guide
.\" Source: Zenmap
.\" Language: English
.\"
-.TH "ZENMAP" "1" "01/21/2011" "Zenmap" "Zenmap Reference Guide"
+.TH "ZENMAP" "1" "02/11/2011" "Zenmap" "Zenmap Reference Guide"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
|
[-]
[+]
|
Changed |
nmap-5.51.tar.bz2/libdnet-stripped/src/intf-win32.c
^
|
@@ -441,12 +441,12 @@
/* Check the MAC address if available. */
data->Oid = OID_802_3_CURRENT_ADDRESS;
data->Length = sizeof(buf) - sizeof(*data);
- if (PacketRequest(lpa, FALSE, data) == TRUE) {
- if (data->Length != ifrow.dwPhysAddrLen)
- goto close_adapter;
- if (memcmp(ifrow.bPhysAddr, data->Data, data->Length) != 0)
- goto close_adapter;
- }
+ if (!PacketRequest(lpa, FALSE, data))
+ goto close_adapter;
+ if (data->Length != ifrow.dwPhysAddrLen)
+ goto close_adapter;
+ if (memcmp(ifrow.bPhysAddr, data->Data, data->Length) != 0)
+ goto close_adapter;
/* A hardware address match is good enough, but we will prefer
an additional match with the description if available. */
|
[-]
[+]
|
Changed |
nmap-5.51.tar.bz2/macosx/Makefile
^
|
@@ -42,13 +42,20 @@
# when building against the 10.4u SDK on OS X 10.6.
UNIVERSAL_CC = gcc-4.0
UNIVERSAL_CXX = g++-4.0
+# Setting ARCHFLAGS separately is required. distutils.util.get_platform
+# sniffs it to determine whether to return a universal architecture
+# ("fat" or "universal") or a single one ("i386" or "ppc"). py2app in
+# turn uses the arch value to decide which of its bootstrappers to
+# install.
+UNIVERSAL_ARCHFLAGS = -arch ppc -arch i386
UNIVERSAL_CPPFLAGS = -isysroot /Developer/SDKs/MacOSX10.4u.sdk
-UNIVERSAL_CFLAGS = $(UNIVERSAL_CPPFLAGS) -mmacosx-version-min=10.4 -arch ppc -arch i386
+UNIVERSAL_CFLAGS = $(UNIVERSAL_CPPFLAGS) -mmacosx-version-min=10.4 $(UNIVERSAL_ARCHFLAGS)
UNIVERSAL_CXXFLAGS = $(UNIVERSAL_CFLAGS)
-UNIVERSAL_LDFLAGS = -Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -arch ppc -arch i386
+UNIVERSAL_LDFLAGS = -Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 $(UNIVERSAL_ARCHFLAGS)
CC = $(UNIVERSAL_CC)
CXX = $(UNIVERSAL_CXX)
+ARCHFLAGS += $(UNIVERSAL_ARCHFLAGS)
CONFIGURE_ARGS += $(UNIVERSAL_CONFIGURE_ARGS)
CPPFLAGS += $(UNIVERSAL_CPPFLAGS)
CFLAGS += $(UNIVERSAL_CFLAGS)
@@ -91,7 +98,7 @@
make -C $(NPING_BUILD_DIR) install-nping DESTDIR="`pwd`/$(NPING_STAGING_DIR)"
# make-bundle.sh uses these to build its authorization wrapper.
-export CC CPPFLAGS CFLAGS CXXFLAGS LDFLAGS
+export CC ARCHFLAGS CPPFLAGS CFLAGS CXXFLAGS LDFLAGS
stage-zenmap: export-$(ZENMAP_BUILD_DIR)
cd $(ZENMAP_BUILD_DIR)/zenmap && install_scripts/macosx/make-bundle.sh
|
[-]
[+]
|
Changed |
nmap-5.51.tar.bz2/ncat/docs/ncat.1
^
|
@@ -2,12 +2,12 @@
.\" Title: Ncat
.\" Author: [see the "Authors" section]
.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
-.\" Date: 01/21/2011
+.\" Date: 02/11/2011
.\" Manual: Ncat Reference Guide
.\" Source: Ncat
.\" Language: English
.\"
-.TH "NCAT" "1" "01/21/2011" "Ncat" "Ncat Reference Guide"
+.TH "NCAT" "1" "02/11/2011" "Ncat" "Ncat Reference Guide"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
@@ -36,7 +36,7 @@
.RS 4
.\}
.nf
-Ncat 5\&.50 ( http://nmap\&.org/ncat )
+Ncat 5\&.51 ( http://nmap\&.org/ncat )
Usage: ncat [options] [hostname] [port]
Options taking a time assume seconds\&. Append \'ms\' for milliseconds,
|
[-]
[+]
|
Changed |
nmap-5.51.tar.bz2/ncat/docs/ncat.usage.txt
^
|
@@ -1,4 +1,4 @@
-Ncat 5.50 ( http://nmap.org/ncat )
+Ncat 5.51 ( http://nmap.org/ncat )
Usage: ncat [options] [hostname] [port]
Options taking a time assume seconds. Append 'ms' for milliseconds,
|
[-]
[+]
|
Changed |
nmap-5.51.tar.bz2/ncat/ncat.h
^
|
@@ -85,7 +85,7 @@
* *
***************************************************************************/
-/* $Id: ncat.h 21947 2011-01-21 23:10:38Z fyodor $ */
+/* $Id: ncat.h 22228 2011-02-11 21:09:04Z fyodor $ */
#ifndef NCAT_H_
#define NCAT_H_
@@ -114,7 +114,7 @@
/* Ncat information for output, etc. */
#define NCAT_NAME "Ncat"
#define NCAT_URL "http://nmap.org/ncat"
-#define NCAT_VERSION "5.50"
+#define NCAT_VERSION "5.51"
#ifndef __GNUC__
#ifndef __attribute__
|
[-]
[+]
|
Changed |
nmap-5.51.tar.bz2/ndiff/docs/ndiff.1
^
|
@@ -2,12 +2,12 @@
.\" Title: ndiff
.\" Author: [see the "Authors" section]
.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
-.\" Date: 01/21/2011
+.\" Date: 02/11/2011
.\" Manual: User Commands
.\" Source: Ndiff
.\" Language: English
.\"
-.TH "NDIFF" "1" "01/21/2011" "Ndiff" "User Commands"
+.TH "NDIFF" "1" "02/11/2011" "Ndiff" "User Commands"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
|
[-]
[+]
|
Changed |
nmap-5.51.tar.bz2/ndiff/docs/ndiff.dtd
^
|
@@ -71,9 +71,12 @@
version 0, which was rather different. -->
<!ATTLIST nmapdiff version CDATA #IMPLIED>
-<!ELEMENT scandiff (hostdiff | host)*>
+<!ELEMENT scandiff (prescript | hostdiff | host | postscript | (a, b?) | b)*>
+<!ELEMENT prescript (script* | (a, b?) | b)>
+<!ELEMENT postscript (script* | (a, b?) | b)>
+
<!ELEMENT hostdiff (host | (a, b?) | b)>
<!ELEMENT host (status | address | hostnames | ports | os | hostscript | a | b)*>
@@ -124,6 +127,6 @@
<!ELEMENT hostscript (script | a | b)*>
-<!ENTITY % diff-elem "(host | hostname | extraports* | port | state | service | script | os | osmatch* | hostscript)">
+<!ENTITY % diff-elem "(prescript | postscript | host | status | address | hostname | extraports* | port | state | service | script | os | osmatch* | hostscript)">
<!ELEMENT a %diff-elem;>
<!ELEMENT b %diff-elem;>
|
[-]
[+]
|
Changed |
nmap-5.51.tar.bz2/ndiff/ndiff
^
|
@@ -34,6 +34,8 @@
self.start_date = None
self.end_date = None
self.hosts = []
+ self.pre_script_results = []
+ self.post_script_results = []
def find_host(self, id):
for host in self.hosts:
@@ -388,6 +390,42 @@
parts.append(u"at %s" % scan.start_date.strftime("%Y-%m-%d %H:%M"))
return u" ".join(parts)
+def print_script_result_diffs_text(title, script_results_a, script_results_b,
+ script_result_diffs, f = sys.stdout):
+ table = Table(u"*")
+ for sr_diff in script_result_diffs:
+ sr_diff.append_to_port_table(table)
+ if len(table) > 0:
+ print >> f
+ if len(script_results_b) == 0:
+ print >> f, u"-%s:" % title
+ elif len(script_results_a) == 0:
+ print >> f, u"+%s:" % title
+ else:
+ print >> f, u" %s:" % title
+ print >> f, table
+
+def script_result_diffs_to_dom_fragment(elem, script_results_a,
+ script_results_b, script_result_diffs, document):
+ if len(script_results_a) == 0 and len(script_results_b) == 0:
+ return document.createDocumentFragment()
+ elif len(script_results_b) == 0:
+ a_elem = document.createElement(u"a")
+ for sr in script_results_a:
+ elem.appendChild(sr.to_dom_fragment(document))
+ a_elem.appendChild(elem)
+ return a_elem
+ elif len(script_results_a) == 0:
+ b_elem = document.createElement(u"b")
+ for sr in script_results_b:
+ elem.appendChild(sr.to_dom_fragment(document))
+ b_elem.appendChild(elem)
+ return b_elem
+ else:
+ for sr_diff in script_result_diffs:
+ elem.appendChild(sr_diff.to_dom_fragment(document))
+ return elem
+
class ScanDiff(object):
"""A complete diff of two scans. It is a container for two scans and a dict
mapping hosts to HostDiffs."""
@@ -396,6 +434,8 @@
self.scan_a = scan_a
self.scan_b = scan_b
self.hosts = []
+ self.pre_script_result_diffs = []
+ self.post_script_result_diffs = []
self.host_diffs = {}
self.diff()
@@ -414,6 +454,9 @@
self.hosts.append(host)
self.host_diffs[host] = h_diff
+ self.pre_script_result_diffs = ScriptResultDiff.diff_lists(self.scan_a.pre_script_results, self.scan_b.pre_script_results)
+ self.post_script_result_diffs = ScriptResultDiff.diff_lists(self.scan_a.post_script_results, self.scan_b.post_script_results)
+
def print_text(self, f = sys.stdout):
"""Print this diff in a human-readable text form."""
banner_a = format_banner(self.scan_a)
@@ -424,12 +467,20 @@
else:
print >> f, u" %s" % banner_a
+ print_script_result_diffs_text("Pre-scan script results",
+ self.scan_a.pre_script_results, self.scan_b.pre_script_results,
+ self.pre_script_result_diffs)
+
for host in self.hosts:
- print
+ print >> f
h_diff = self.host_diffs[host]
h_diff.print_text(f)
+ print_script_result_diffs_text("Post-scan script results",
+ self.scan_a.post_script_results, self.scan_b.post_script_results,
+ self.post_script_result_diffs)
+
def print_xml(self, f = sys.stdout):
impl = xml.dom.minidom.getDOMImplementation()
document = impl.createDocument(None, u"nmapdiff", None)
@@ -438,11 +489,27 @@
scandiff_elem = document.createElement(u"scandiff")
root.appendChild(scandiff_elem)
+ # prerule script changes.
+ if len(self.pre_script_result_diffs) > 0 or verbose:
+ prescript_elem = document.createElement(u"prescript")
+ scandiff_elem.appendChild(script_result_diffs_to_dom_fragment(
+ prescript_elem, self.scan_a.pre_script_results,
+ self.scan_b.pre_script_results, self.pre_script_result_diffs,
+ document))
+
for host in self.hosts:
h_diff = self.host_diffs[host]
frag = h_diff.to_dom_fragment(document)
scandiff_elem.appendChild(frag)
+ # postrule script changes.
+ if len(self.post_script_result_diffs) > 0 or verbose:
+ postscript_elem = document.createElement(u"postscript")
+ scandiff_elem.appendChild(script_result_diffs_to_dom_fragment(
+ postscript_elem, self.scan_a.post_script_results,
+ self.scan_b.post_script_results, self.post_script_result_diffs,
+ document))
+
document.writexml(f, addindent = u" ", newl = u"\n", encoding = "UTF-8")
document.unlink()
@@ -587,18 +654,9 @@
for i in range(i1, i2):
print >> f, " %s" % host_a.os[i]
- table = Table(u"*")
- for sr_diff in self.script_result_diffs:
- sr_diff.append_to_port_table(table)
- if len(table) > 0:
- print >> f
- if len(host_b.script_results) == 0:
- print >> f, u"-Host script results:"
- elif len(host_a.script_results) == 0:
- print >> f, u"+Host script results:"
- else:
- print >> f, u" Host script results:"
- print >> f, table
+ print_script_result_diffs_text("Host script results",
+ host_a.script_results, host_b.script_results,
+ self.script_result_diffs)
def to_dom_fragment(self, document):
host_a = self.host_a
@@ -715,24 +773,10 @@
# Host script changes.
if len(self.script_result_diffs) > 0 or verbose:
hostscript_elem = document.createElement(u"hostscript")
- if len(host_a.script_results) == 0 and len(host_b.script_results) == 0:
- pass
- elif len(host_b.script_results) == 0:
- a_elem = document.createElement(u"a")
- for sr in host_a.script_results:
- a_elem.appendChild(sr.to_dom_fragment(document))
- a_elem.appendChild(hostscript_elem)
- host_elem.appendChild(a_elem)
- elif len(host_a.script_results) == 0:
- b_elem = document.createElement(u"b")
- for sr in host_b.script_results:
- b_elem.appendChild(sr.to_dom_fragment(document))
- b_elem.appendChild(hostscript_elem)
- host_elem.appendChild(b_elem)
- else:
- for sr_diff in self.script_result_diffs:
- hostscript_elem.appendChild(sr_diff.to_dom_fragment(document))
- host_elem.appendChild(hostscript_elem)
+ host_elem.appendChild(script_result_diffs_to_dom_fragment(
+ hostscript_elem, host_a.script_results,
+ host_b.script_results, self.script_result_diffs,
+ document))
hostdiff_elem.appendChild(host_elem)
@@ -1099,24 +1143,27 @@
self.current_port.service.extrainfo = attrs.get(u"extrainfo")
self.current_port.service.tunnel = attrs.get(u"tunnel")
elif name == u"script":
- assert self.current_host is not None
result = ScriptResult()
try:
result.id = attrs[u"id"]
except KeyError:
- warn(u"%s element of host %s missing the \"id\" attribute; skipping." % (name, self.current_host.format_name()))
+ warn(u"%s element missing the \"id\" attribute; skipping." % name)
return
try:
result.output = attrs[u"output"]
except KeyError:
- warn(u"%s element of host %s missing the \"output\" attribute; skipping." % (name, self.current_host.format_name()))
+ warn(u"%s element missing the \"output\" attribute; skipping." % name)
return
- if self.parent_element() == u"hostscript":
+ if self.parent_element() == u"prescript":
+ self.scan.pre_script_results.append(result)
+ elif self.parent_element() == u"postscript":
+ self.scan.post_script_results.append(result)
+ elif self.parent_element() == u"hostscript":
self.current_host.script_results.append(result)
elif self.parent_element() == u"port":
self.current_port.script_results.append(result)
else:
- warn(u"%s element of host %s not inside hostscript or port element; ignoring." % (name, self.current_host.format_name()))
+ warn(u"%s element not inside prescript, postscript, hostscript, or port element; ignoring." % name)
return
elif name == u"osmatch":
assert self.parent_element() == u"os"
@@ -1198,7 +1245,7 @@
scan_a.load_from_file(filename_a)
scan_b = Scan()
scan_b.load_from_file(filename_b)
- except Exception, e:
+ except IOError, e:
print >> sys.stderr, u"Can't open file: %s" % str(e)
sys.exit(EXIT_ERROR)
|
[-]
[+]
|
Added |
nmap-5.51.tar.bz2/nmap-5.51-1.spec
^
|
@@ -0,0 +1,139 @@
+# To build a static RPM, add
+# --define "static 1"
+# to the rpmbuild command line. To build without Ncat, add
+# --define "buildncat 0"
+# To build without Nping, add
+# --define "buildnping 0"
+#
+# To specify openssl dir, add something like:
+# --define "openssl /usr/local/ssl"
+
+%define name nmap
+%define version 5.51
+%define release 1
+%define _prefix /usr
+
+Summary: Network exploration tool and security scanner
+Name: %{name}
+Version: %{version}
+Release: %{release}
+Epoch: 2
+License: http://nmap.org/man/man-legal.html
+Group: Applications/System
+Source0: http://nmap.org/dist/%{name}-%{version}.tgz
+URL: http://nmap.org
+
+# For Ndiff.
+Requires: python >= 2.4
+
+# RPM can't be relocatable until I stop storing path info in the binary.
+# Prefix: %{_prefix}
+BuildRoot: %{_tmppath}/%{name}-root
+
+%description
+
+Nmap ("Network Mapper") is a free and open source utility
+for network exploration or security auditing. Many systems and network
+administrators also find it useful for tasks such as network
+inventory, managing service upgrade schedules, and monitoring host or
+service uptime. Nmap uses raw IP packets in novel ways to determine
+what hosts are available on the network, what services (application
+name and version) those hosts are offering, what operating systems
+(and OS versions) they are running, what type of packet
+filters/firewalls are in use, and dozens of other characteristics. It
+was designed to rapidly scan large networks, but works fine against
+single hosts. Nmap runs on all major computer operating systems, and
+both console and graphical versions are available.
+
+%prep
+%setup -q
+
+%build
+%configure --with-openssl=%{openssl} --without-zenmap --with-ndiff --with-libdnet=included --with-libpcap=included --with-libpcre=included --with-liblua=included
+%if "%{buildncat}" == "0"
+%configure --without-ncat
+%endif
+%if "%{buildnping}" == "0"
+%configure --without-nping
+%endif
+%if "%{static}" == "1"
+make static
+%else
+make
+%endif
+
+%install
+[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
+make install DESTDIR=$RPM_BUILD_ROOT
+strip $RPM_BUILD_ROOT%{_bindir}/* || :
+gzip $RPM_BUILD_ROOT%{_mandir}/man1/* || :
+
+%clean
+[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(-,root,root)
+%doc COPYING
+%doc docs/README
+%doc docs/nmap.usage.txt
+%doc %{_prefix}/share/man/man1/nmap.1.gz
+%doc %{_prefix}/share/man/*/man1/nmap.1.gz
+%{_bindir}/nmap
+%{_datadir}/nmap
+
+%{_bindir}/ndiff
+%doc %{_prefix}/share/man/man1/ndiff.1.gz
+
+# Ncat subpackage
+%if "%{buildncat}" != "0"
+%package -n ncat
+Summary: Nmap's Netcat replacement
+Group: Applications/System
+
+%description -n ncat
+Ncat is a feature packed networking utility which will read and
+write data across a network from the command line. It uses both
+TCP and UDP for communication and is designed to be a reliable
+back-end tool to instantly provide network connectivity to other
+applications and users. Ncat will not only work with IPv4 and IPv6
+but provides the user with a virtually limitless number of potential
+uses.
+
+%files -n ncat
+%defattr(-,root,root)
+%doc %{_prefix}/share/man/man1/ncat.1.gz
+%{_bindir}/ncat
+%{_datadir}/ncat
+
+%endif
+
+# Nping subpackage
+%if "%{buildnping}" != "0"
+%package -n nping
+# If this 0. prefix is removed it must also be removed from Makefile.in.
+Version: 0.%{version}
+Summary: Nping packet generator
+Group: Applications/System
+
+%description -n nping
+Nping is an open source tool for network packet generation, response
+analysis and response time measurement. Nping allows to generate network
+packets of a wide range of protocols, letting users to tune virtually
+any field of the protocol headers. While Nping can be used as a simple
+ping utility to detect active hosts, it can also be used as a raw packet
+generator for network stack stress tests, ARP poisoning, Denial of
+Service attacks, route tracing, etc.
+
+%files -n nping
+%defattr(-,root,root)
+%doc %{_prefix}/share/man/man1/nping.1.gz
+%{_bindir}/nping
+
+%endif
+
+%changelog
+
+* Sat Jun 06 2009 Fyodor (fyodor(a)insecure.org)
+- Removed changelog entries as SVN is a more authoritative source. Execute:
+- svn log --username guest --password "" svn://svn.insecure.org/nmap/nmap.spec.in
+
|
[-]
[+]
|
Changed |
nmap-5.51.tar.bz2/nmap.cc
^
|
@@ -88,7 +88,7 @@
* *
***************************************************************************/
-/* $Id: nmap.cc 22066 2011-01-27 21:49:15Z david $ */
+/* $Id: nmap.cc 22209 2011-02-09 02:37:53Z david $ */
#include "nmap.h"
#include "osscan.h"
@@ -1321,11 +1321,14 @@
print_iflist();
exit(0);
}
+
+#ifndef NOLUA
if (o.scripthelp) {
/* Special-case open_nse for --script-help only. */
open_nse();
exit(0);
}
+#endif
#if HAVE_IPV6
if(o.af() == AF_INET6 && o.traceroute)
@@ -1618,6 +1621,7 @@
if (o.scriptversion || o.script || o.scriptupdatedb)
open_nse();
+ /* Run the script pre-scanning phase */
if (o.script) {
new_targets = NewTargets::get();
script_scan_results = get_script_scan_results_obj();
|
[-]
[+]
|
Changed |
nmap-5.51.tar.bz2/nmap.h
^
|
@@ -89,7 +89,7 @@
* *
***************************************************************************/
-/* $Id: nmap.h 21947 2011-01-21 23:10:38Z fyodor $ */
+/* $Id: nmap.h 22228 2011-02-11 21:09:04Z fyodor $ */
#ifndef NMAP_H
#define NMAP_H
@@ -252,8 +252,8 @@
#ifndef NMAP_VERSION
/* Edit this definition only within the quotes, because it is read from this
file by the makefiles. */
-#define NMAP_VERSION "5.50"
-#define NMAP_NUM_VERSION "5.50.0.0"
+#define NMAP_VERSION "5.51"
+#define NMAP_NUM_VERSION "5.51.0.0"
#endif
/* User configurable #defines: */
|
[-]
[+]
|
Changed |
nmap-5.51.tar.bz2/nping/EchoServer.cc
^
|
@@ -96,6 +96,7 @@
#include "output.h"
#include "NpingOps.h"
#include "ProbeMode.h"
+#include <signal.h>
extern NpingOps o;
extern EchoServer es;
|
[-]
[+]
|
Changed |
nmap-5.51.tar.bz2/nping/configure
^
|
@@ -4878,6 +4878,17 @@
$as_echo "#define HAVE_OPENSSL 1" >>confdefs.h
OPENSSL_LIBS="-lssl -lcrypto"
+ LIBS_TMP="$LIBS"
+ LIBS="$LIBS $OPENSSL_LIBS"
+ # Check whether the installed OpenSSL supports SHA-256 (ver 0.9.8 or later).
+ ac_fn_c_check_func "$LINENO" "EVP_sha256" "ac_cv_func_EVP_sha256"
+if test "x$ac_cv_func_EVP_sha256" = x""yes; then :
+
+else
+ as_fn_error "Your version of OpenSSL does not support SHA-256. Please install OpenSSL 0.9.8 or later." "$LINENO" 5
+fi
+
+ LIBS="$LIBS_TMP"
fi
|
[-]
[+]
|
Changed |
nmap-5.51.tar.bz2/nping/configure.ac
^
|
@@ -173,6 +173,11 @@
if test "$use_openssl" = "yes"; then
AC_DEFINE(HAVE_OPENSSL)
OPENSSL_LIBS="-lssl -lcrypto"
+ LIBS_TMP="$LIBS"
+ LIBS="$LIBS $OPENSSL_LIBS"
+ # Check whether the installed OpenSSL supports SHA-256 (ver 0.9.8 or later).
+ AC_CHECK_FUNC(EVP_sha256,, AC_MSG_ERROR([Your version of OpenSSL does not support SHA-256. Please install OpenSSL 0.9.8 or later.]))
+ LIBS="$LIBS_TMP"
fi
AC_SUBST(OPENSSL_LIBS)
|
[-]
[+]
|
Changed |
nmap-5.51.tar.bz2/nping/docs/nping.1
^
|
@@ -2,12 +2,12 @@
.\" Title: nping
.\" Author: [see the "Authors" section]
.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
-.\" Date: 01/21/2011
+.\" Date: 02/11/2011
.\" Manual: Nping Reference Guide
.\" Source: Nping
.\" Language: English
.\"
-.TH "NPING" "1" "01/21/2011" "Nping" "Nping Reference Guide"
+.TH "NPING" "1" "02/11/2011" "Nping" "Nping Reference Guide"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
|
[-]
[+]
|
Changed |
nmap-5.51.tar.bz2/nping/nping.h
^
|
@@ -306,7 +306,7 @@
/* General tunable defines **************************************************/
#define NPING_NAME "Nping"
#define NPING_URL "http://nmap.org/nping"
-#define NPING_VERSION "0.5.50"
+#define NPING_VERSION "0.5.51"
#define DEFAULT_VERBOSITY VB_0
#define DEFAULT_DEBUGGING DBG_0
|
[-]
[+]
|
Changed |
nmap-5.51.tar.bz2/nse_main.lua
^
|
@@ -303,6 +303,7 @@
local script_type = assert(NSE_SCRIPT_RULES[rule]);
if not self[rule] then return nil end -- No rule for this script?
local file_closure = self.file_closure;
+ -- Rebuild the environment for the running thread.
local env = {
SCRIPT_PATH = self.filename,
SCRIPT_NAME = self.short_basename,
@@ -366,10 +367,15 @@
"Warning: Loading '%s' -- the recommended file extension is '.nse'.",
filename);
end
+ local basename = match(filename, "[/\\]([^/\\]-)$") or filename;
+ local short_basename = match(filename, "[/\\]([^/\\]-)%.nse$") or
+ match(filename, "[/\\]([^/\\]-)%.[^.]*$") or
+ filename;
local file_closure = assert(loadfile(filename));
-- Give the closure its own environment, with global access
local env = {
- filename = filename,
+ SCRIPT_PATH = filename,
+ SCRIPT_NAME = short_basename,
dependencies = {},
};
setmetatable(env, {__index = _G});
@@ -412,11 +418,9 @@
-- Return the script
local script = {
filename = filename,
- basename = match(filename, "[/\\]([^/\\]-)$") or filename,
- short_basename = match(filename, "[/\\]([^/\\]-)%.nse$") or
- match(filename, "[/\\]([^/\\]-)%.[^.]*$") or
- filename,
- id = match(filename, "^.-[/\\]([^\\/]-)%.nse$") or filename,
+ basename = basename,
+ short_basename = short_basename,
+ id = match(filename, "^.-[/\\]([^\\/]-)%.nse$") or short_basename,
file_closure = file_closure,
prerule = prerule,
hostrule = hostrule,
@@ -627,7 +631,7 @@
-- Arguments:
-- threads An array of threads (a runlevel) to run.
-- scantype A string that indicates the current script scan phase.
-local function run (threads_iter, scantype)
+local function run (threads_iter, scantype, hosts)
-- running scripts may be resumed at any time. waiting scripts are
-- yielded until Nsock wakes them. After being awakened with
-- nse_restore, waiting threads become pending and later are moved all
@@ -724,6 +728,18 @@
return
end
+ if (scantype == NSE_PRE_SCAN) then
+ print_verbose(1, "Script Pre-scanning.");
+ elseif (scantype == NSE_SCAN) then
+ if #hosts > 1 then
+ print_verbose(1, "Script scanning %d hosts.", #hosts);
+ elseif #hosts == 1 then
+ print_verbose(1, "Script scanning %s.", hosts[1].ip);
+ end
+ elseif (scantype == NSE_POST_SCAN) then
+ print_verbose(1, "Script Post-scanning.");
+ end
+
local progress = cnse.scan_progress_meter(NAME);
-- Loop while any thread is running or waiting.
@@ -1043,18 +1059,6 @@
insert(runlevels[script.runlevel], script);
end
- if (scantype == NSE_PRE_SCAN) then
- print_verbose(1, "Script Pre-scanning.");
- elseif (scantype == NSE_SCAN) then
- if #hosts > 1 then
- print_verbose(1, "Script scanning %d hosts.", #hosts);
- elseif #hosts == 1 then
- print_verbose(1, "Script scanning %s.", hosts[1].ip);
- end
- elseif (scantype == NSE_POST_SCAN) then
- print_verbose(1, "Script Post-scanning.");
- end
-
for runlevel, scripts in ipairs(runlevels) do
-- This iterator is passed to the run function. It returns one new script
-- thread on demand until exhausted.
@@ -1101,8 +1105,8 @@
end
end
end
- print_verbose(1, "Starting runlevel %u (of %u) scan.", runlevel, #runlevels);
- run(wrap(threads_iter), scantype)
+ print_verbose(2, "Starting runlevel %u (of %u) scan.", runlevel, #runlevels);
+ run(wrap(threads_iter), scantype, hosts)
end
collectgarbage "collect";
|
[-]
[+]
|
Changed |
nmap-5.51.tar.bz2/nse_nsock.cc
^
|
@@ -756,6 +756,8 @@
{
nse_nsock_udata *nu = check_nsock_udata(L, 1, 0);
nu->timeout = luaL_checkint(L, 2);
+ if ((int) nu->timeout < -1)
+ return luaL_error(L, "Negative timeout: %d", nu->timeout);
return success(L);
}
|
[-]
[+]
|
Changed |
nmap-5.51.tar.bz2/nselib/mssql.lua
^
|
@@ -8,6 +8,7 @@
--
-- The code has been implemented based on traffic analysis and the following
-- documentation:
+-- * SSRP Protocol Specification: http://msdn.microsoft.com/en-us/library/cc219703.aspx
-- * TDS Protocol Documentation: http://www.freetds.org/tds.html.
-- * The JTDS source code: http://jtds.sourceforge.net/index.html.
--
@@ -53,6 +54,8 @@
-- Version 0.2
-- Created 01/17/2010 - v0.1 - created by Patrik Karlsson <patrik@cqure.net>
-- Revised 03/28/2010 - v0.2 - fixed incorrect token types. added 30 seconds timeout
+-- Revised 01/23/2011 - v0.3 - fixed parsing error in discovery code with patch
+-- from Chris Woodbury
require("bit")
require("bin")
@@ -827,8 +830,29 @@
local _, ip
status, _, _, ip, _ = socket:get_info()
-
- for instance in string.gmatch(data, "(.-;;)") do
+
+
+ -- It would seem easier to just capture (.-;;) repeateadly, since
+ -- each instance ends with ";;", but ";;" can also occur within the
+ -- data, signifying an empty field (e.g. "...bv;;@COMPNAME;;tcp;1433;;...").
+ -- So, instead, we'll split up the string ahead of time.
+ -- See the SSRP specification for more details.
+ local instanceStrings = {}
+
+ local firstInstanceEnd, instanceString
+ repeat
+ firstInstanceEnd = data:find( ";ServerName;(.-);InstanceName;(.-);IsClustered;(.-);" )
+ if firstInstanceEnd then
+ instanceString = data:sub( 1, firstInstanceEnd )
+ data = data:sub( firstInstanceEnd + 1 )
+ else
+ instanceString = data
+ end
+
+ table.insert( instanceStrings, instanceString )
+ until (not firstInstanceEnd)
+
+ for _, instance in ipairs( instanceStrings ) do
instances[ip] = instances[ip] or {}
local info = {}
|
[-]
[+]
|
Changed |
nmap-5.51.tar.bz2/nselib/wsdd.lua
^
|
@@ -34,9 +34,14 @@
module(... or "wsdd", package.seeall)
-require 'openssl'
require 'target'
+local HAVE_SSL = false
+
+if pcall(require,'openssl') then
+ HAVE_SSL = true
+end
+
-- The different probes
local probes = {
@@ -332,6 +337,8 @@
-- @return matches table containing responses, suitable for printing using
-- the <code>stdnse.format_output</code> function
discoverServices = function( self, probename )
+ if ( not(HAVE_SSL) ) then return false, "The wsdd library requires OpenSSL" end
+
local comm = Comm:new(self.host, self.port, self.mcast)
local probe = Util.getProbeByName(probename)
comm:setProbe( probe )
|
[-]
[+]
|
Changed |
nmap-5.51.tar.bz2/scripts/dns-zone-transfer.nse
^
|
@@ -112,7 +112,7 @@
end
portrule = function(host, port)
- if shortport.portnumber(53, 'tcp') then
+ if shortport.portnumber(53, 'tcp')(host, port) then
dns_opts.domain, dns_opts.addall = stdnse.get_script_args(
{"dns-zone-transfer.domain", "dnszonetransfer.domain"},
{"dns-zone-transfer.addall","dnszonetransfer.addall"}
|
[-]
[+]
|
Changed |
nmap-5.51.tar.bz2/scripts/ftp-anon.nse
^
|
@@ -78,12 +78,12 @@
local listing = {}
while not max_lines or #listing < max_lines do
local status, data = list_socket:receive_buf("\r?\n", false)
+ if (not status and data == "EOF") or data == "" then
+ break
+ end
if not status then
return status, data
end
- if data == "" then
- break
- end
listing[#listing + 1] = data
end
@@ -162,18 +162,22 @@
result[#result + 1] = "Anonymous FTP login allowed (FTP code " .. code .. ")"
if not max_list or max_list > 0 then
- local listing = try(list(socket, host, max_list))
+ local status, listing = list(socket, host, max_list)
socket:close()
- for _, item in ipairs(listing) do
- -- Just a quick passive check on user rights.
- if string.match(item, "^[d-].......w.") then
- item = item .. " [NSE: writeable]"
+ if not status then
+ result[#result + 1] = "Can't get directory listing: " .. listing
+ else
+ for _, item in ipairs(listing) do
+ -- Just a quick passive check on user rights.
+ if string.match(item, "^[d-].......w.") then
+ item = item .. " [NSE: writeable]"
+ end
+ result[#result + 1] = item
+ end
+ if max_list and #listing == max_list then
+ result[#result + 1] = string.format("Only %d shown. Use --script-args %s.maxlist=-1 to see all.", #listing, SCRIPT_NAME)
end
- result[#result + 1] = item
- end
- if max_list and #listing == max_list then
- result[#result + 1] = string.format("Only %d shown. Use --script-args %s.maxlist=-1 to see all.", #listing, SCRIPT_NAME)
end
end
|
[-]
[+]
|
Changed |
nmap-5.51.tar.bz2/scripts/ftp-proftpd-backdoor.nse
^
|
@@ -43,7 +43,7 @@
return false
end
- return shortport.port_or_service(21, "ftp")
+ return shortport.port_or_service(21, "ftp")(host, port)
end
action = function(host, port)
|
[-]
[+]
|
Changed |
nmap-5.51.tar.bz2/scripts/nrpe-enum.nse
^
|
@@ -197,9 +197,7 @@
return true, nrpe_read(resp)
end
-portrule = function(host, port)
- return shortport.port_or_service(5666, "nrpe")
-end
+portrule = shortport.port_or_service(5666, "nrpe")
action = function(host, port)
-- Get script arguments.
|
[-]
[+]
|
Changed |
nmap-5.51.tar.bz2/scripts/oracle-brute.nse
^
|
@@ -37,7 +37,15 @@
require 'shortport'
require 'brute'
-require 'tns'
+if pcall(require,"openssl") then
+ require("tns")
+else
+ portrule = function() return false end
+ action = function() end
+ stdnse.print_debug( 3, "Skipping %s script because OpenSSL is missing.",
+ SCRIPT_NAME)
+ return;
+end
portrule = shortport.port_or_service(1521, "oracle-tns", "tcp", "open")
@@ -134,4 +142,4 @@
status, result = engine:start()
return result
-end
\ No newline at end of file
+end
|
[-]
[+]
|
Changed |
nmap-5.51.tar.bz2/scripts/oracle-enum-users.nse
^
|
@@ -33,8 +33,16 @@
categories = {"intrusive", "auth"}
require 'shortport'
-require 'tns'
require 'unpwdb'
+if pcall(require,"openssl") then
+ require("tns")
+else
+ portrule = function() return false end
+ action = function() end
+ stdnse.print_debug( 3, "Skipping %s script because OpenSSL is missing.",
+ SCRIPT_NAME)
+ return;
+end
portrule = shortport.port_or_service(1521, 'oracle-tns' )
@@ -156,4 +164,4 @@
end
return stdnse.format_output(true, result)
-end
\ No newline at end of file
+end
|
[-]
[+]
|
Changed |
nmap-5.51.tar.bz2/scripts/snmp-interfaces.nse
^
|
@@ -36,12 +36,23 @@
-- Revised 04/11/2010 - v0.2 - moved snmp_walk to snmp library <patrik@cqure.net>
-- Revised 08/10/2010 - v0.3 - prerule; add interface addresses to Nmap's target list (Kris Katterjohn)
+require "stdnse"
require "shortport"
require "snmp"
require "datafiles"
require "target"
-prerule = function() return true end
+prerule = function()
+ if not stdnse.get_script_args({"snmp-interfaces.host", "host"}) then
+ stdnse.print_debug(3,
+ "Skipping '%s' %s, 'snmp-interfaces.host' argument is missing.",
+ SCRIPT_NAME, SCRIPT_TYPE)
+ return false
+ end
+
+ return true
+end
+
portrule = shortport.portnumber(161, "udp", {"open", "open|filtered"})
-- List of IANA-assigned network interface types
@@ -389,26 +400,16 @@
local srvhost, srvport
if SCRIPT_TYPE == "prerule" then
- for _, k in ipairs({"snmp-interfaces.host", "host"}) do
- if nmap.registry.args[k] then
- srvhost = nmap.registry.args[k]
- end
- end
-
+ srvhost = stdnse.get_script_args({"snmp-interfaces.host", "host"})
if not srvhost then
- stdnse.print_debug(3,
- "Skipping '%s' %s, 'snmp-interfaces.host' argument is missing.",
- SCRIPT_NAME, SCRIPT_TYPE)
+ -- Shouldn't happen; checked in prerule.
return
end
- for _, k in ipairs({"snmp-interfaces.port", "port"}) do
- if nmap.registry.args[k] then
- srvport = tonumber(nmap.registry.args[k])
- end
- end
-
- if not srvport then
+ srvport = stdnse.get_script_args({"snmp-interfaces.port", "port"})
+ if srvport then
+ srvport = tonumber(srvport)
+ else
srvport = 161
end
else
|
[-]
[+]
|
Changed |
nmap-5.51.tar.bz2/scripts/ssh2-enum-algos.nse
^
|
@@ -57,7 +57,15 @@
require "shortport"
require "stdnse"
-require "ssh2"
+if pcall(require,"openssl") then
+ require("ssh2")
+else
+ portrule = function() return false end
+ action = function() end
+ stdnse.print_debug( 3, "Skipping %s script because OpenSSL is missing.",
+ SCRIPT_NAME)
+ return;
+end
portrule = shortport.port_or_service(22, "ssh")
|
[-]
[+]
|
Added |
nmap-5.51.tar.bz2/zenmap-5.51-1.spec
^
|
@@ -0,0 +1,90 @@
+# By default, Zenmap will be built using whatever version of Python is
+# the default on your system. To change this, use something like
+# --define "__python /usr/bin/python2.5"
+
+%define name zenmap
+%define version 5.51
+%define release 1
+%define _prefix /usr
+
+# Find where Python modules are installed. See
+# http://fedoraproject.org/wiki/Packaging/Python.
+%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
+
+Summary: Multi-platform graphical Nmap frontend and results viewer
+Name: %{name}
+Version: %{version}
+Release: %{release}
+Epoch: 2
+License: http://nmap.org/man/man-legal.html
+Group: Applications/System
+Source0: http://nmap.org/dist/nmap-%{version}.tgz
+URL: http://nmap.org
+BuildArch: noarch
+
+# Disable automatic dependency calculation because we want to provide
+# packages for more than one version of Python. Without this, RPM will
+# grep through the installed files and automatically add things like
+# Requires: python(abi) = 2.4
+# setup.py takes care of adjusting sys.path to point to wherever the
+# modules were installed so it's not dependent on any particular ABI.
+AutoReqProv: no
+Requires: python >= 2.4, nmap, pygtk2
+
+Prefix: %{_prefix}
+BuildRoot: %{_tmppath}/%{name}-root
+
+%description
+Zenmap is an Nmap frontend. It is meant to be useful for advanced users
+and to make Nmap easy to use by beginners. It was originally derived
+from Umit, an Nmap GUI created as part of the Google Summer of Code.
+
+%prep
+%setup -q -n nmap-%{version}
+
+%build
+# Cannot use configure macro because noarch-redhat-linux is not
+# recognized by the auto tools in the tarball. Upgrading to the
+# latest GNU CVS config.sub/config.guess on 3/15/08 didn't fix it. So
+# I'm using this approach, as is done by other projects, such as
+# http://mono.ximian.com/monobuild/snapshot/snapshot_packages/noarch/xsp/96614/xsp.spec
+# -Fyodor
+./configure --prefix=%{_prefix} \
+ --libexecdir=%{_prefix}/lib \
+ --bindir=%{_prefix}/bin \
+ --datadir=%{_prefix}/share \
+ --libdir=%{_prefix}/lib \
+ --mandir=%{_prefix}/share/man \
+ --infodir=%{_prefix}/share/info \
+ --sysconfdir=%{_sysconfdir} \
+ --without-openssl \
+ --with-zenmap PYTHON="%{__python}"
+make build-zenmap DESTDIR=$RPM_BUILD_ROOT
+
+%install
+[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
+make install-zenmap DESTDIR=$RPM_BUILD_ROOT
+# Don't package the uninstaller with the RPM.
+rm -f $RPM_BUILD_ROOT%{_bindir}/uninstall_zenmap
+gzip $RPM_BUILD_ROOT%{_mandir}/man1/* || :
+
+%clean
+[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(-,root,root)
+%doc %{_mandir}/man1/zenmap.1.gz
+%{_bindir}/zenmap
+%{_bindir}/nmapfe
+%{_bindir}/xnmap
+# This gets the modules and the .egg-info file if it was installed.
+%{python_sitelib}/*
+%{_datadir}/zenmap
+%{_datadir}/applications/*.desktop
+
+%changelog
+
+* Sat Jun 06 2009 Fyodor (fyodor(a)insecure.org)
+- Removed changelog entries as SVN is a more authoritative source. Execute:
+- svn log --username guest --password "" svn://svn.insecure.org/nmap/zenmap.spec.in
+
|
[-]
[+]
|
Changed |
nmap-5.51.tar.bz2/zenmap/share/zenmap/config/zenmap_version
^
|
@@ -1 +1 @@
-5.50
+5.51
|
[-]
[+]
|
Changed |
nmap-5.51.tar.bz2/zenmap/zenmapCore/Version.py
^
|
@@ -1 +1 @@
-VERSION = "5.50"
+VERSION = "5.51"
|
[-]
[+]
|
Changed |
nmap-5.51.tar.bz2/zenmap/zenmapGUI/NmapOutputViewer.py
^
|
@@ -180,10 +180,10 @@
start_iter, end_iter = buff.get_bounds()
output = buff.get_text(start_iter, end_iter).split("\n")
- re_host = re.compile("%s\s{0,1}:" % re.escape(host))
+ re_host = re.compile(r'^Nmap scan report for %s\s*$' % re.escape(host))
for i in xrange(len(output)):
- if re_host.search(output[i]):
+ if re_host.match(output[i]):
self.text_view.scroll_to_iter(buff.get_iter_at_line(i), 0, True, 0, 0)
break
|
[-]
[+]
|
Changed |
nmap-5.51.tar.bz2/zenmap/zenmapGUI/ScanInterface.py
^
|
@@ -708,8 +708,9 @@
self.refresh_port_output()
# Switch nmap output to show first host occourrence
model, selection = self.host_view_selection.get_selected_rows()
- if len(selection) > 0:
- self.go_to_host(model[0][2])
+ for path in selection:
+ self.go_to_host(model[path][2])
+ break
def service_selection_changed(self, widget):
self.refresh_host_output()
|