diff --git a/CHANGELOG b/CHANGELOG index 1362d40f9..a3679881d 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -2,8 +2,13 @@ 4.22SOC1 -o Upgraded from WinPcap 4.0 to WinPcap 4.01 and fixed a versioning - error [Eddie] +o The UMIT graphical Nmap frontend is now included (as an ALPHA TEST + release) with the Nmap tarball distribution. It isn't yet in the + RPMs or the Windows distributions. UMIT is written with Python/GTK + and has many huge advantages over NmapFE. It installs from the Nmap + source tarballs as part of the "make install" process unless you + specify --without-umit to configure. Please give UMIT a try (the + executable is named umit) and let us know the results! o The port selection mechanism was overhauled. Nmap now knows (roughly) how common various services are, so you can specify @@ -62,7 +67,8 @@ o The build dependencies were dramatically reduced by removing This should make Nmap compilation faster and prevent some portability problems. [David Fifield] -o Upgraded from WinPcap 3.1 to WinPcap 4.0 [Eddie] +o Upgraded from WinPcap 3.1 to WinPcap 4.01 and fixed a pcap installer + error. [Eddie] o In verbose mode, Nmap now reports where it obtains data files (such as nmap-services) from. [David Fifield] @@ -112,6 +118,8 @@ o A number of changes were made to the Windows build system to handle version numbers, publisher field, add/remove program support, etc. [Eddie] +o The Nmap -A option now enables the traceroute option too [Eddie] + o Improved how the Gen1 OS Detection system selects which UDP ports to send probes to. [Kris] diff --git a/Makefile.in b/Makefile.in index 1c5b7af33..59ede246b 100644 --- a/Makefile.in +++ b/Makefile.in @@ -53,6 +53,7 @@ TARGET = nmap TARGETNMAPFE=@TARGETNMAPFE@ INSTALLNMAPFE=@INSTALLNMAPFE@ INSTALLNSE=@INSTALLNSE@ +INSTALLUMIT=@INSTALLUMIT@ ifneq (@LIBLUA_LIBS@,) NSE_SRC=nse_main.cc nse_auxiliar.cc nse_nsock.cc nse_init.cc nse_nmaplib.cc nse_debug.cc nse_pcrelib.cc nse_string.cc @@ -103,7 +104,7 @@ $(NSOCKDIR)/src/libnsock.a: $(NSOCKDIR)/src/Makefile FORCE cd $(NSOCKDIR)/src && $(MAKE) $(LIBLUADIR)/liblua.a: $(LIBLUADIR)/Makefile FORCE - @echo Compiling liblua; cd $(LIBLUADIR) && $(MAKE) @LUAFLAVOR@ + @echo Compiling liblua; cd $(LIBLUADIR) && $(MAKE) liblua.a @LUAFLAGS@ #$(LIBPCAPDIR)/Makefile: # @echo Configuring libpcap; cd $(LIBPCAPDIR); ./configure @@ -197,6 +198,9 @@ install-nmapfe: $(TARGETNMAPFE) @echo "If the next command fails -- you cannot use the X front end" -test -f nmapfe/nmapfe && $(INSTALL) -c -m 755 -s nmapfe/nmapfe $(DESTDIR)$(bindir)/nmapfe && rm -f $(DESTDIR)$(bindir)/xnmap && $(SHTOOL) mkln -f -s $(DESTDIR)$(bindir)/nmapfe $(DESTDIR)$(bindir)/xnmap && $(INSTALL) -c -m 644 nmapfe.desktop $(DESTDIR)$(deskdir)/nmapfe.desktop && $(INSTALL) -c -m 644 docs/nmapfe.1 $(DESTDIR)$(mandir)/man1/nmapfe.1 && $(INSTALL) -c -m 644 docs/xnmap.1 $(DESTDIR)$(mandir)/man1/xnmap.1 +install-umit: umit/setup.py + cd umit && python setup.py install --prefix $(DESTDIR)$(prefix) + NSE_FILES = scripts/script.db scripts/*.nse NSE_LIB_FILES = nselib/*lua nselib/*so install-nse: $(TARGET) @@ -205,7 +209,8 @@ install-nse: $(TARGET) $(SHTOOL) mkdir -f -p -m 755 $(DESTDIR)$(nmapdatadir)/nselib cp -f $(NSE_LIB_FILES) $(DESTDIR)$(nmapdatadir)/nselib -install: install-nmap $(INSTALLNMAPFE) $(INSTALLNSE) +install: install-nmap $(INSTALLNMAPFE) $(INSTALLNSE) $(INSTALLUMIT) + @echo "NMAP SUCCESSFULLY INSTALLED" uninstall: rm -f $(bindir)/$(TARGET) $(bindir)/nmapfe $(bindir)/xnmap diff --git a/configure b/configure index d8b9270bb..c6bff21d8 100755 --- a/configure +++ b/configure @@ -673,12 +673,13 @@ host host_cpu host_vendor host_os -LUAFLAVOR +LUAFLAGS CPP GREP EGREP TARGETNMAPFE INSTALLNMAPFE +INSTALLUMIT OPENSSL_LIBS PCAP_DEPENDS PCAP_CLEAN @@ -1300,7 +1301,8 @@ Optional Packages: --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-localdirs Explicitly ask compiler to use /usr/local/{include,libs} if they exist - --without-nmapfe skip nmapfe X-window GUI + --without-nmapfe Skip nmapfe X-window GUI + --without-umit Skip installation of the UMIT graphical frontend --with-openssl=DIR Use optional openssl libs and includes from DIR/lib/ and DIR/include/openssl/) --with-libpcap=DIR Look for pcap in DIR/include and DIR/libs. @@ -3408,14 +3410,14 @@ case "$host" in #define DEC 1 _ACEOF - LUAFLAVOR=posix + LUAFLAGS="MYCFLAGS=\"-DLUA_USE_POSIX -DLUA_USE_DLOPEN\"" ;; *-netbsd* | *-knetbsd*-gnu) cat >>confdefs.h <<\_ACEOF #define NETBSD 1 _ACEOF - LUAFLAVOR=bsd + LUAFLAGS="MYCFLAGS=\"-DLUA_USE_POSIX -DLUA_USE_DLOPEN\"" LDFLAGS="-Wl,-E $LDFLAGS" # needed for nse-C-module support ;; *-openbsd*) @@ -3423,7 +3425,7 @@ _ACEOF #define OPENBSD 1 _ACEOF - LUAFLAVOR=bsd + LUAFLAGS="MYCFLAGS=\"-DLUA_USE_POSIX -DLUA_USE_DLOPEN\"" LDFLAGS="-Wl,-E $LDFLAGS" # needed for nse-C-module support ;; *-sgi-irix5*) @@ -3433,8 +3435,8 @@ _ACEOF if test -z "$GCC"; then sgi_cc=yes - LUAFLAVOR=posix fi + LUAFLAGS="MYCFLAGS=\"-DLUA_USE_POSIX -DLUA_USE_DLOPEN\"" ;; *-sgi-irix6*) cat >>confdefs.h <<\_ACEOF @@ -3444,7 +3446,7 @@ _ACEOF if test -z "$GCC"; then sgi_cc=yes fi - LUAFLAVOR=posix + LUAFLAGS="MYCFLAGS=\"-DLUA_USE_POSIX -DLUA_USE_DLOPEN\"" ;; *-hpux*) cat >>confdefs.h <<\_ACEOF @@ -3524,7 +3526,7 @@ _ACEOF fi - LUAFLAVOR=posix + LUAFLAGS="MYCFLAGS=\"-DLUA_USE_POSIX -DLUA_USE_DLOPEN\"" ;; *-solaris2.0*) cat >>confdefs.h <<\_ACEOF @@ -3535,14 +3537,14 @@ _ACEOF #define SOLARIS 1 _ACEOF - LUAFLAVOR=solaris + LUAFLAGS="MYCFLAGS=\"-DLUA_USE_POSIX -DLUA_USE_DLOPEN\"" ;; *-solaris2.[1-9][0-9]*) cat >>confdefs.h <<\_ACEOF #define SOLARIS 1 _ACEOF - LUAFLAVOR=solaris + LUAFLAGS="MYCFLAGS=\"-DLUA_USE_POSIX -DLUA_USE_DLOPEN\"" ;; *-solaris2.1*) cat >>confdefs.h <<\_ACEOF @@ -3553,7 +3555,7 @@ _ACEOF #define SOLARIS 1 _ACEOF - LUAFLAVOR=solaris + LUAFLAGS="MYCFLAGS=\"-DLUA_USE_POSIX -DLUA_USE_DLOPEN\"" ;; *-solaris2.2*) cat >>confdefs.h <<\_ACEOF @@ -3564,7 +3566,7 @@ _ACEOF #define SOLARIS 1 _ACEOF - LUAFLAVOR=solaris + LUAFLAGS="MYCFLAGS=\"-DLUA_USE_POSIX -DLUA_USE_DLOPEN\"" ;; *-solaris2.3*) cat >>confdefs.h <<\_ACEOF @@ -3575,7 +3577,7 @@ _ACEOF #define SOLARIS 1 _ACEOF - LUAFLAVOR=solaris + LUAFLAGS="MYCFLAGS=\"-DLUA_USE_POSIX -DLUA_USE_DLOPEN\"" ;; *-solaris2.4*) cat >>confdefs.h <<\_ACEOF @@ -3586,7 +3588,7 @@ _ACEOF #define SOLARIS 1 _ACEOF - LUAFLAVOR=solaris + LUAFLAGS="MYCFLAGS=\"-DLUA_USE_POSIX -DLUA_USE_DLOPEN\"" ;; *-solaris2.5.1) cat >>confdefs.h <<\_ACEOF @@ -3597,14 +3599,14 @@ _ACEOF #define SOLARIS 1 _ACEOF - LUAFLAVOR=solaris + LUAFLAGS="MYCFLAGS=\"-DLUA_USE_POSIX -DLUA_USE_DLOPEN\"" ;; *-solaris*) cat >>confdefs.h <<\_ACEOF #define SOLARIS 1 _ACEOF - LUAFLAVOR=solaris + LUAFLAGS="MYCFLAGS=\"-DLUA_USE_POSIX -DLUA_USE_DLOPEN\"" ;; *-sunos4*) cat >>confdefs.h <<\_ACEOF @@ -3615,7 +3617,7 @@ _ACEOF #define SPRINTF_RETURNS_STRING 1 _ACEOF - LUAFLAVOR=solaris + LUAFLAGS="MYCFLAGS=\"-DLUA_USE_POSIX -DLUA_USE_DLOPEN\"" ;; *-linux*) linux=yes @@ -3628,7 +3630,7 @@ _ACEOF _ACEOF # libpcap doesn't even LOOK at # the timeout you give it under Linux - LUAFLAVOR=linux + LUAFLAGS="MYCFLAGS=\"-DLUA_USE_POSIX -DLUA_USE_DLOPEN\"" LDFLAGS="-Wl,-E $LDFLAGS" # needed for nse-C-module support ;; *-freebsd* | *-kfreebsd*-gnu | *-dragonfly*) @@ -3636,7 +3638,7 @@ _ACEOF #define FREEBSD 1 _ACEOF - LUAFLAVOR=bsd + LUAFLAGS="MYCFLAGS=\"-DLUA_USE_POSIX -DLUA_USE_DLOPEN\"" LDFLAGS="-Wl,-E $LDFLAGS" # needed for nse-C-module support ;; *-bsdi*) @@ -3645,7 +3647,7 @@ _ACEOF _ACEOF LUAFLAVOR=bsd - LDFLAGS="-Wl,-E $LDFLAGS" # needed for nse-C-module support + LUAFLAGS="MYCFLAGS=\"-DLUA_USE_POSIX -DLUA_USE_DLOPEN\"" ;; *-apple-darwin*) macosx=yes @@ -3654,10 +3656,10 @@ _ACEOF _ACEOF needs_cpp_precomp=yes - LUAFLAVOR=macosx + LUAFLAGS="MYCFLAGS=\"-DLUA_USE_MACOSX\"" ;; *) - LUAFLAVOR=posix + LUAFLAGS=MYCFLAGS="-DLUA_USE_POSIX -DLUA_USE_DLOPEN" esac @@ -5426,7 +5428,23 @@ fi -# First we test whether they specified openssl desires explicitly +# Do they want UMIT? +INSTALLUMIT=install-umit + +# Check whether --with-umit was given. +if test "${with_umit+set}" = set; then + withval=$with_umit; case "$with_umit" in + no) + INSTALLUMIT="" + ;; + esac + +fi + + + + +# We test whether they specified openssl desires explicitly use_openssl="yes" specialssldir="" @@ -7067,6 +7085,7 @@ if test "${with_liblua+set}" = set; then LUA_DEPENDS="$LIBLUADIR/liblua.a" LUA_CLEAN="lua_clean" LUA_DIST_CLEAN="lua_dist_clean" + have_lua="yes" ;; no) @@ -9593,12 +9612,13 @@ host!$host$ac_delim host_cpu!$host_cpu$ac_delim host_vendor!$host_vendor$ac_delim host_os!$host_os$ac_delim -LUAFLAVOR!$LUAFLAVOR$ac_delim +LUAFLAGS!$LUAFLAGS$ac_delim CPP!$CPP$ac_delim GREP!$GREP$ac_delim EGREP!$EGREP$ac_delim TARGETNMAPFE!$TARGETNMAPFE$ac_delim INSTALLNMAPFE!$INSTALLNMAPFE$ac_delim +INSTALLUMIT!$INSTALLUMIT$ac_delim OPENSSL_LIBS!$OPENSSL_LIBS$ac_delim PCAP_DEPENDS!$PCAP_DEPENDS$ac_delim PCAP_CLEAN!$PCAP_CLEAN$ac_delim @@ -9629,7 +9649,6 @@ NSOCKDIR!$NSOCKDIR$ac_delim LIBNSOCK_LIBS!$LIBNSOCK_LIBS$ac_delim GTK_CONFIG!$GTK_CONFIG$ac_delim LIBOBJS!$LIBOBJS$ac_delim -LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then @@ -9668,6 +9687,50 @@ CEOF$ac_eof _ACEOF +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + cat >conf$$subs.sed <<_ACEOF +LTLIBOBJS!$LTLIBOBJS$ac_delim +_ACEOF + + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 1; then + break + elif $ac_last_try; then + { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` +if test -n "$ac_eof"; then + ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` + ac_eof=`expr $ac_eof + 1` +fi + +cat >>$CONFIG_STATUS <<_ACEOF +cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end +_ACEOF +sed ' +s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g +s/^/s,@/; s/!/@,|#_!!_#|/ +:n +t n +s/'"$ac_delim"'$/,g/; t +s/$/\\/; p +N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n +' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF +:end +s/|#_!!_#|//g +CEOF$ac_eof +_ACEOF + + # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty @@ -9906,7 +9969,7 @@ s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t $ac_datarootdir_hack -" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed 's/|#_!!_#|//g' >$tmp/out +" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && diff --git a/configure.ac b/configure.ac index 9a1a5cdd2..345430b79 100644 --- a/configure.ac +++ b/configure.ac @@ -136,111 +136,111 @@ needs_cpp_precomp=no case "$host" in *alpha-dec-osf*) AC_DEFINE(DEC) - LUAFLAVOR=posix + LUAFLAGS="MYCFLAGS=\"-DLUA_USE_POSIX -DLUA_USE_DLOPEN\"" ;; *-netbsd* | *-knetbsd*-gnu) AC_DEFINE(NETBSD) - LUAFLAVOR=bsd + LUAFLAGS="MYCFLAGS=\"-DLUA_USE_POSIX -DLUA_USE_DLOPEN\"" LDFLAGS="-Wl,-E $LDFLAGS" # needed for nse-C-module support ;; *-openbsd*) AC_DEFINE(OPENBSD) - LUAFLAVOR=bsd + LUAFLAGS="MYCFLAGS=\"-DLUA_USE_POSIX -DLUA_USE_DLOPEN\"" LDFLAGS="-Wl,-E $LDFLAGS" # needed for nse-C-module support ;; *-sgi-irix5*) AC_DEFINE(IRIX) if test -z "$GCC"; then sgi_cc=yes - LUAFLAVOR=posix fi + LUAFLAGS="MYCFLAGS=\"-DLUA_USE_POSIX -DLUA_USE_DLOPEN\"" ;; *-sgi-irix6*) AC_DEFINE(IRIX) if test -z "$GCC"; then sgi_cc=yes fi - LUAFLAVOR=posix + LUAFLAGS="MYCFLAGS=\"-DLUA_USE_POSIX -DLUA_USE_DLOPEN\"" ;; *-hpux*) AC_DEFINE(HPUX) # To link with libnet and NM (/usr/lib/libnm.sl) library # on HP-UX 11.11 (other versions?) Mikhail Zakharov (zmey20000@yahoo.com) AC_CHECK_LIB(nm, open_mib) - LUAFLAVOR=posix + LUAFLAGS="MYCFLAGS=\"-DLUA_USE_POSIX -DLUA_USE_DLOPEN\"" ;; *-solaris2.0*) AC_DEFINE(STUPID_SOLARIS_CHECKSUM_BUG) AC_DEFINE(SOLARIS) - LUAFLAVOR=solaris + LUAFLAGS="MYCFLAGS=\"-DLUA_USE_POSIX -DLUA_USE_DLOPEN\"" ;; *-solaris2.[[1-9]][[0-9]]*) AC_DEFINE(SOLARIS) - LUAFLAVOR=solaris + LUAFLAGS="MYCFLAGS=\"-DLUA_USE_POSIX -DLUA_USE_DLOPEN\"" ;; *-solaris2.1*) AC_DEFINE(STUPID_SOLARIS_CHECKSUM_BUG) AC_DEFINE(SOLARIS) - LUAFLAVOR=solaris + LUAFLAGS="MYCFLAGS=\"-DLUA_USE_POSIX -DLUA_USE_DLOPEN\"" ;; *-solaris2.2*) AC_DEFINE(STUPID_SOLARIS_CHECKSUM_BUG) AC_DEFINE(SOLARIS) - LUAFLAVOR=solaris + LUAFLAGS="MYCFLAGS=\"-DLUA_USE_POSIX -DLUA_USE_DLOPEN\"" ;; *-solaris2.3*) AC_DEFINE(STUPID_SOLARIS_CHECKSUM_BUG) AC_DEFINE(SOLARIS) - LUAFLAVOR=solaris + LUAFLAGS="MYCFLAGS=\"-DLUA_USE_POSIX -DLUA_USE_DLOPEN\"" ;; *-solaris2.4*) AC_DEFINE(STUPID_SOLARIS_CHECKSUM_BUG) AC_DEFINE(SOLARIS) - LUAFLAVOR=solaris + LUAFLAGS="MYCFLAGS=\"-DLUA_USE_POSIX -DLUA_USE_DLOPEN\"" ;; *-solaris2.5.1) AC_DEFINE(STUPID_SOLARIS_CHECKSUM_BUG) AC_DEFINE(SOLARIS) - LUAFLAVOR=solaris + LUAFLAGS="MYCFLAGS=\"-DLUA_USE_POSIX -DLUA_USE_DLOPEN\"" ;; *-solaris*) AC_DEFINE(SOLARIS) - LUAFLAVOR=solaris + LUAFLAGS="MYCFLAGS=\"-DLUA_USE_POSIX -DLUA_USE_DLOPEN\"" ;; *-sunos4*) AC_DEFINE(SUNOS) AC_DEFINE(SPRINTF_RETURNS_STRING) - LUAFLAVOR=solaris + LUAFLAGS="MYCFLAGS=\"-DLUA_USE_POSIX -DLUA_USE_DLOPEN\"" ;; *-linux*) linux=yes AC_DEFINE(LINUX) AC_DEFINE(PCAP_TIMEOUT_IGNORED) # libpcap doesn't even LOOK at # the timeout you give it under Linux - LUAFLAVOR=linux + LUAFLAGS="MYCFLAGS=\"-DLUA_USE_POSIX -DLUA_USE_DLOPEN\"" LDFLAGS="-Wl,-E $LDFLAGS" # needed for nse-C-module support ;; *-freebsd* | *-kfreebsd*-gnu | *-dragonfly*) AC_DEFINE(FREEBSD) - LUAFLAVOR=bsd + LUAFLAGS="MYCFLAGS=\"-DLUA_USE_POSIX -DLUA_USE_DLOPEN\"" LDFLAGS="-Wl,-E $LDFLAGS" # needed for nse-C-module support ;; *-bsdi*) AC_DEFINE(BSDI) LUAFLAVOR=bsd - LDFLAGS="-Wl,-E $LDFLAGS" # needed for nse-C-module support + LUAFLAGS="MYCFLAGS=\"-DLUA_USE_POSIX -DLUA_USE_DLOPEN\"" ;; *-apple-darwin*) macosx=yes AC_DEFINE(MACOSX) needs_cpp_precomp=yes - LUAFLAVOR=macosx + LUAFLAGS="MYCFLAGS=\"-DLUA_USE_MACOSX\"" ;; *) - LUAFLAVOR=posix + LUAFLAGS=MYCFLAGS="-DLUA_USE_POSIX -DLUA_USE_DLOPEN" esac -AC_SUBST(LUAFLAVOR) +AC_SUBST(LUAFLAGS) AC_SEARCH_LIBS(dlopen, dl) dnl equiv to '#define inline' to 'inline', '__inline__', '__inline' or '' @@ -300,7 +300,7 @@ test "${with_nmapfe+set}" != "set" && with_nmapfe=yes TARGETNMAPFE=nmapfe/nmapfe INSTALLNMAPFE=install-nmapfe -AC_ARG_WITH(nmapfe, AC_HELP_STRING([--without-nmapfe], [skip nmapfe X-window GUI]), +AC_ARG_WITH(nmapfe, AC_HELP_STRING([--without-nmapfe], [Skip nmapfe X-window GUI]), [ case "$with_nmapfe" in no) TARGETNMAPFE=""; INSTALLNMAPFE="" @@ -310,7 +310,19 @@ AC_ARG_WITH(nmapfe, AC_HELP_STRING([--without-nmapfe], [skip nmapfe X-window GUI AC_SUBST(TARGETNMAPFE) AC_SUBST(INSTALLNMAPFE) -# First we test whether they specified openssl desires explicitly +# Do they want UMIT? +INSTALLUMIT=install-umit +AC_ARG_WITH(umit, AC_HELP_STRING([--without-umit], [Skip installation of the UMIT graphical frontend]), + [ case "$with_umit" in + no) + INSTALLUMIT="" + ;; + esac] +) +AC_SUBST(INSTALLUMIT) + + +# We test whether they specified openssl desires explicitly use_openssl="yes" specialssldir="" @@ -589,6 +601,7 @@ AC_HELP_STRING([--without-liblua], [Compile without lua (this will exclude all o LUA_DEPENDS="$LIBLUADIR/liblua.a" LUA_CLEAN="lua_clean" LUA_DIST_CLEAN="lua_dist_clean" + have_lua="yes" ;; no) diff --git a/docs/leet-nmap-ascii-art.txt b/docs/leet-nmap-ascii-art.txt index 9781c76cd..7fefcea1f 100644 --- a/docs/leet-nmap-ascii-art.txt +++ b/docs/leet-nmap-ascii-art.txt @@ -12,5 +12,3 @@ / / _/ / + / \/ ' (__/ / \ NMAP IS A POWERFUL TOOL -- USE CAREFULLY AND RESPONSIBLY - [ Sick of the Nmap dragon? Submit your art and tag ] - [ lines to nmap-dev@insecure.org for next release! ] diff --git a/docs/nmap-fingerprinting-article.txt b/docs/nmap-fingerprinting-article.txt deleted file mode 100644 index 086ff9475..000000000 --- a/docs/nmap-fingerprinting-article.txt +++ /dev/null @@ -1,620 +0,0 @@ -[ NOTE -- A more up-to-date version of this paper and translations to - many other languages are available from - http://www.insecure.org/nmap/nmap-fingerprinting-article.html ] - - Remote OS detection via TCP/IP Stack FingerPrinting - by Fyodor (www.insecure.org) - October 18, 1998 - - -ABSTRACT - -This paper discusses how to glean precious information about a host by -querying its TCP/IP stack. I first present some of the "classical" -methods of determining host OS which do not involve stack -fingerprinting. Then I describe the current "state of the art" in -stack fingerprinting tools. Next comes a description of many -techniques for causing the remote host to leak information about -itself. Finally I detail my (nmap) implementation of this, followed -by a snapshot gained from nmap which discloses what OS is running on -many popular Internet sites. - - -REASONS - -I think the usefulness of determining what OS a system is running is -pretty obvious, so I'll make this section short. One of the strongest -examples of this usefulness is that many security holes are dependent -on OS version. Lets say you are doing a penetration test and you find -port 53 open. If this is a vulnerable version of Bind, you only get -one chance to exploit it since a failed attempt will crash the daemon. -With a good TCP/IP fingerprinter, you will quickly find that this -machine is running 'Solaris 2.51' or 'Linux 2.0.35' and you can adjust -your shellcode accordingly. - -A worse possibility is someone scanning 500,000 hosts in advance to -see what OS is running and what ports are open. Then when someone -posts (say) a root hole in Sun's comsat daemon, our little cracker -could grep his list for 'UDP/512' and 'Solaris 2.6' and he immediately -has pages and pages of rootable boxes. It should be noted that this -is SCRIPT KIDDIE behavior. You have demonstrated no skill and nobody -is even remotely impressed that you were able to find some vulnerable -.edu that had not patched the hole in time. Also, people will be even -_less_ impressed if you use your newfound access to deface the -department's web site with a self-aggrandizing rant about how damn -good you are and how stupid the sysadmins must be. - -Another possible use is for social engineering. Lets say that you are -scanning your target company and nmap reports a 'Datavoice TxPORT -PRISM 3000 T1 CSU/DSU 6.22/2.06'. The hacker might now call up as -'Datavoice support' and discuss some issues about their PRISM 3000. -"We are going to announce a security hole soon, but first we want all -our current customers to install the patch -- I just mailed it to you -..." Some naive administrators might assume that only an authorized -engineer from Datavoice would know so much about their CSU/DSU. - -Another potential use of this capability is evaluation of companies -you may want to do business with. Before you choose a new ISP, scan -them and see what equipment is in use. Those "$99/year" deals don't -sound nearly so good when you find out they have crappy routers and -offer PPP services off a bunch of Windows boxes. - - -CLASSICAL TECHNIQUES - -Stack fingerprinting solves the problem of OS identification in a -unique way. I think this technique holds the most promise, but there -are currently many other solutions. Sadly, this is still one the most -effective of those techniques: - -playground~> telnet hpux.u-aizu.ac.jp -Trying 163.143.103.12... -Connected to hpux.u-aizu.ac.jp. -Escape character is '^]'. - -HP-UX hpux B.10.01 A 9000/715 (ttyp2) - -login: - -There is no point going to all this trouble of fingerprinting if the -machine will blatantly announce to the world exactly what it is -running! Sadly, many vendors ship _current_ systems with these kind -of banners and many admins do not turn them off. Just because there -are other ways to figure out what OS is running (such as -fingerprinting), does not mean we should just announce our OS and -architecture to every schmuck who tries to connect. - -The problems with relying on this technique are that an increasing -number of people are turning banners off, many systems don't give much -information, and it is trivial for someone to "lie" in their banners. -Nevertheless, banner reading is all you get for OS and OS Version -checking if you spend $thousands on the commercial ISS scanner. -Download nmap or queso instead and save your money :). - -Even if you turn off the banners, many applications will happily give -away this kind of information when asked. For example lets look at an -FTP server: - -payfonez> telnet ftp.netscape.com 21 -Trying 207.200.74.26... -Connected to ftp.netscape.com. -Escape character is '^]'. -220 ftp29 FTP server (UNIX(r) System V Release 4.0) ready. -SYST -215 UNIX Type: L8 Version: SUNOS - -First of all, it gives us system details in its default banner. Then -if we give the 'SYST' command it happily feeds back even more information. - -If anon FTP is supported, we can often download /bin/ls or other -binaries and determine what architecture it was built for. - -Many other applications are too free with information. Take web -servers for example: - -playground> echo 'GET / HTTP/1.0\n' | nc hotbot.com 80 | egrep '^Server:' -Server: Microsoft-IIS/4.0 -playground> - -Hmmm ... I wonder what OS those lamers are running. - -Other classic techniques include DNS host info records (rarely -effective) and social engineering. If the machine is listening on -161/udp (snmp), you are almost guaranteed a bunch of detailed info -using 'snmpwalk' from the CMU SNMP tools distribution and the 'public' -community name. - - -CURRENT FINGERPRINTING PROGRAMS - - -Nmap is not the first OS recognition program to use TCP/IP -fingerprinting. The common IRC spoofer sirc by Johan has included -very rudimentary fingerprinting techniques since version 3 (or -earlier). It attempts to place a host in the classes "Linux", -"4.4BSD", "Win95", or "Unknown" using a few simple TCP flag tests. - -Another such program is checkos, released publicly in January of this -year by Shok in Confidence Remains High Issue #7. -The fingerprinting techniques are exactly the same as SIRC, and even -the _code_ is identical in many places. Checkos was privately -available for a long time prior to the public release, so I have no -idea who swiped code from whom. But neither seems to credit the -other. One thing checkos does add is telnet banner checking, which is -useful but has the problems described earlier. [ Update: Shok wrote in -to say that chekos was never intended to be public and this is why he -didn't bother to credit SIRC for some of the code. ] - -Su1d also wrote an OS checking program. His is called SS and as of -Version 3.11 it can identify 12 different OS types. I am somewhat -partial to this one since he credits my nmap program for some of the -networking code :). - -Then there is queso. This program is the newest and it is a huge leap -forward from the other programs. Not only do they introduce a couple -new tests, but they were the first (that I have seen) to move the -OS fingerprints _out_ of the code. The other scanners included code like: - -/* from ss */ -if ((flagsfour & TH_RST) && (flagsfour & TH_ACK) && (winfour == 0) && - (flagsthree & TH_ACK)) - reportos(argv[2],argv[3],"Livingston Portmaster ComOS"); - -Instead, queso moves this into a configuration file which obviously -scales much better and makes adding an OS as easy as appending a few -lines to a fingerprint file. - -Queso was written by Savage, one of the fine folks at Apostols.org . - -One problem with all the programs describe above is that they are very -limited in the number of fingerprinting tests which limits the -granularity of answers. I want to know more than just 'this machine -is OpenBSD, FreeBSD, or NetBSD', I wish to know exactly which of those -it is as well as some idea of the release version number. In the same -way, I would rather see 'Solaris 2.6' than simply 'Solaris'. To -achieve this response granularity, I worked on a number of -fingerprinting techniques which are described in the next section. - -FINGERPRINTING METHODOLOGY - -There are many, many techniques which can be used to fingerprint -networking stacks. Basically, you just look for things that differ -among operating systems and write a probe for the difference. If you -combine enough of these, you can narrow down the OS very tightly. For -example nmap can reliably distinguish Solaris 2.4 vs. Solaris 2.5-2.51 -vs Solaris 2.6. It can also tell Linux kernel 2.0.30 from 2.0.31-34 -or 2.0.35. Here are some techniques: - -The FIN probe -- Here we send a FIN packet (or any packet without an - ACK or SYN flag) to an open port and wait for a response. The - correct RFC793 behavior is to NOT respond, but many broken - implementations such as MS Windows, BSDI, CISCO, HP/UX, MVS, and - IRIX send a RESET back. Most current tools utilize this - technique. - -The BOGUS flag probe -- Queso is the first scanner I have seen to use - this clever test. The idea is to set an undefined TCP "flag" ( 64 - or 128) in the TCP header of a SYN packet. Linux boxes prior to - 2.0.35 keep the flag set in their response. I have not found any - other OS to have this bug. However, some operating systems seem - to reset the connection when they get a SYN+BOGUS packet. This - behavior could be useful in identifying them. - -TCP ISN Sampling -- The idea here is to find patterns in the initial - sequence numbers chosen by TCP implementations when responding to - a connection request. These can be categorized in to many groups - such as the traditional 64K (many old UNIX boxes), Random - increments (newer versions of Solaris, IRIX, FreeBSD, Digital - UNIX, Cray, and many others), True "random" (Linux 2.0.*, OpenVMS, - newer AIX, etc). Windows boxes (and a few others) use a "time - dependent" model where the ISN is incremented by a small fixed - amount each time period. Needless to say, this is almost as - easily defeated as the old 64K behavior. Of course my favorite - technique is "constant". The machines ALWAYS use the exact same - ISN :). I've seen this on some 3Com hubs (uses 0x803) and Apple - LaserWriter printers (uses 0xC7001). - - You can also subclass groups such as random incremental by - computing variances, greatest common divisors, and other functions - on the set of sequence numbers and the differences between the - numbers. - - It should be noted that ISN generation has important security - implications. For more information on this, contact "security - expert" Tsutomu "Shimmy" Shimomura at SDSC and ask him how he was - owned. Nmap is the first program I have seen to use this for OS - identification. - -Don't Fragment bit -- Many operating systems are starting to set the - IP "Don't Fragment" bit on some of the packets they send. This - gives various performance benefits (though it can also be annoying - -- this is why nmap fragmentation scans do not work from Solaris - boxes). In any case, not all OS's do this and some do it in - different cases, so by paying attention to this bit we can glean - even more information about the target OS. I haven't seen this - one before either. - -TCP Initial Window -- This simply involves checking the window size on - returned packets. Older scanners simply used a non-zero window on - a RST packet to mean "BSD 4.4 derived". Newer scanners such as - queso and nmap keep track of the exact window since it is actually - pretty constant by OS type. This test actually gives us a lot of - information, since some operating systems can be uniquely - identified by the window alone (for example, AIX is the only OS I - have seen which uses 0x3F25). In their "completely rewritten" - TCP stack for NT5, Microsoft uses 0x402E. Interestingly, that is - exactly the number used by OpenBSD and FreeBSD. - -ACK Value -- Although you would think this would be completely - standard, implementations differ in what value they use for the - ACK field in some cases. For example, lets say you send a - FIN|PSH|URG to a closed TCP port. Most implementations will set - the ACK to be the same as your initial sequence number, though - Windows and some stupid printers will send your seq + 1. If you - send a SYN|FIN|URG|PSH to an open port, Windows is very - inconsistent. Sometimes it sends back your seq, other times it - sends S++, and still other times is sends back a seemingly random - value. One has to wonder what kind of code MS is writing that - changes its mind like this. - -ICMP Error Message Quenching -- Some (smart) operating systems follow - the RFC 1812 suggestion to limit the rate at which various error - messages are sent. For example, the Linux kernel (in - net/ipv4/icmp.h) limits destination unreachable message generation - to 80 per 4 seconds, with a 1/4 second penalty if that is - exceeded. One way to test this is to send a bunch of packets to - some random high UDP port and count the number of unreachables - received. I have not seen this used before, and in fact I have - not added this to nmap (except for use in UDP port scanning). - This test would make the OS detection take a bit longer since you - need to send a bunch of packets and wait for them to return. Also - dealing with the possibility of packets dropped on the network - would be a pain. - -ICMP Message Quoting -- The RFCs specify that ICMP error messages - quote some small amount of an ICMP message that causes various - errors. For a port unreachable message, almost all - implementations send only the required IP header + 8 bytes back. - However, Solaris sends back a bit more and Linux sends back even - more than that. The beauty with this is it allows nmap to - recognize Linux and Solaris hosts even if they don't have any - ports listening. - -ICMP Error message echoing integrity -- I got this idea from something - Theo De Raadt (lead OpenBSD developer) posted to - comp.security.unix. As mentioned before, machines have to send - back part of your original message along with a port unreachable - error. Yet some machines tend to use your headers as 'scratch - space' during initial processing and so they are a bit warped by - the time you get them back. For example, AIX and BSDI send back an - IP 'total length' field that is 20 bytes too high. Some BSDI, - FreeBSD, OpenBSD, ULTRIX, and VAXen fuck up the IP ID that you sent - them. While the checksum is going to change due to the changed - TTL anyway, there are some machines (AIX, FreeBSD, etc.) which send - back an inconsistent or 0 checksum. Same thing goes with the UDP - checksum. All in all, nmap does nine different tests on the ICMP - errors to sniff out subtle differences like these. - -Type of Service -- For the ICMP port unreachable messages I look at - the type of service (TOS) value of the packet sent back. Almost - all implementations use 0 for this ICMP error although Linux uses - 0xC0. This does not indicate one of the standard TOS values, but instead is - part of the unused (AFAIK) precedence field. I do not know why - this is set, but if they change to 0 we will be able to keep - identifying the old versions _and_ we will be able to identify - between old and new. - -Fragmentation Handling -- This is a favorite technique of Thomas - H. Ptacek of Secure Networks, Inc (now owned by a bunch of Windows - users at NAI). This takes advantage of the fact that different - implementations often handle overlapping IP fragments differently. - Some will overwrite the old portions with the new, and in other - cases the old stuff has precedence. There are many different - probes you can use to determine how the packet was reassembled. I - did not add this capability since I know of no portable way to send - IP fragments (in particular, it is a bitch on Solaris). For more - information on overlapping fragments, you can read their IDS paper - (www.secnet.com). - -TCP Options -- These are truly a gold mine in terms of leaking - information. The beauty of these options is that: - 1) They are generally optional (duh!) :) so not all hosts implement - them. - 2) You know if a host implements them by sending a query with an - option set. The target generally show support of the option by - setting it on the reply. - 3) You can stuff a whole bunch of options on one packet to test - everything at once. - - Nmap sends these options along with almost every probe packet: - - Window Scale=10; NOP; Max Segment Size = 265; Timestamp; End of Ops; - - When you get your response, you take a look at which options were - returned and thus are supported. Some operating systems such as - recent FreeBSD boxes support all of the above, while others, such - as Linux 2.0.X support very few. The latest Linux 2.1.x kernels - do support all of the above. On the other hand, they are more - vulnerable to TCP sequence prediction. Go figure. - - Even if several operating systems support the same set of options, - you can sometimes distinguish them by the _values_ of the options. - For example, if you send a small MSS value to a Linux box, it will - generally echo that MSS back to you. Other hosts will give you - different values. - - And even if you get the same set of supported options AND the same - values, you can still differentiate via the _order_ that the - options are given, and where padding is applied. For example - Solaris returns 'NNTNWME' which means: - - - While Linux 2.1.122 returns MENNTNW. Same options, same values, - but different order! - - I have not seen any other OS detection tools utilizes TCP options, - but it is very useful. - - There are a few other useful options I might probe for at some - point, such as those that support T/TCP and selective - acknowledgements. - - -Exploit Chronology -- Even with all the tests above, nmap is unable to - distinguish between the TCP stacks of Win95, WinNT, or Win98. - This is rather surprising, especially since Win98 came out about 4 - years after Win95. You would think they would have bothered to - improve the stack in some way (like supporting more TCP options) - and so we would be able to detect the change and distinguish the - operating systems. Unfortunately, this is not the case. The NT - stack is apparently the same crappy stack they put into '95. And - they didn't bother to upgrade it for '98. - - But do not give up hope, for there is a solution. You can simply - start with early Windows DOS attacks (Ping of Death, Winnuke, etc) - and move up a little further to attacks such as Teardrop and Land. - After each attack, ping them to see whether they have crashed. - When you finally crash them, you will likely have narrowed what - they are running down to one service pack or hotfix. - - I have not added this functionality to nmap, although I must admit - it is very tempting :). - - -SYN Flood Resistance -- Some operating systems will stop accepting new - connections if you send too many forged SYN packets at them - (forging the packets avoids trouble with your kernel resetting the - connections). Many operating systems can only handle 8 packets. - Recent Linux kernels (among other operating systems) allow - various methods such as SYN cookies to prevent this from being a - serious problem. Thus you can learn something about your target - OS by sending 8 packets from a forged source to an open port and - then testing whether you can establish a connection to that port - yourself. This was not implemented in nmap since some people get - upset when you SYN flood them. Even explaining that you were - simply trying to determine what OS they are running might not help - calm them. - -NMAP IMPLEMENTATION AND RESULTS - -I have created a reference implementation of the OS detection -techniques mentioned above (except those I said were excluded). I -have added this to my Nmap scanner which has the advantage that it -already _knows_ what ports are open and closed for fingerprinting so -you do not have to tell it. It is also portable among Linux, *BSD, -and Solaris 2.51 and 2.6, and some other operating systems. - -The new version of nmap reads a file filled with Fingerprint templates -that follow a simple grammar. Here is an example: - -FingerPrint IRIX 6.2 - 6.4 # Thanks to Lamont Granquist -TSeq(Class=i800) -T1(DF=N%W=C000|EF2A%ACK=S++%Flags=AS%Ops=MNWNNT) -T2(Resp=Y%DF=N%W=0%ACK=S%Flags=AR%Ops=) -T3(Resp=Y%DF=N%W=C000|EF2A%ACK=O%Flags=A%Ops=NNT) -T4(DF=N%W=0%ACK=O%Flags=R%Ops=) -T5(DF=N%W=0%ACK=S++%Flags=AR%Ops=) -T6(DF=N%W=0%ACK=O%Flags=R%Ops=) -T7(DF=N%W=0%ACK=S%Flags=AR%Ops=) -PU(DF=N%TOS=0%IPLEN=38%RIPTL=148%RID=E%RIPCK=E%UCK=E%ULEN=134%DAT=E) - -Lets look at the first line (I'm adding '>' quote markers): - -> FingerPrint IRIX 6.2 - 6.3 # Thanks to Lamont Granquist - -This simply says that the fingerprint covers IRIX versions 6.2 through -6.3 and the comment states that Lamont Granquist kindly sent me the IP -addresses or fingerprints of the IRIX boxes tested. - -> TSeq(Class=i800) - -This means that ISN sampling put it in the "i800 class". This means -that each new sequence number is a multiple of 800 greater than the -last one. - -> T1(DF=N%W=C000|EF2A%ACK=S++%Flags=AS%Ops=MNWNNT) - -The test is named T1 (for test1, clever eh?). In this test we send a -SYN packet with a bunch of TCP options to an open port. DF=N means -that the "Don't fragment" bit of the response must not be set. -W=C000|EF2A means that the window advertisement we received must -be 0xC000 or EF2A. ACK=S++ means the acknowledgement we receive must -be our initial sequence number plus 1. Flags = AS means the ACK and -SYN flags were sent in the response. Ops = MNWNNT means the options -in the response must be (in this order): - - - -> T2(Resp=Y%DF=N%W=0%ACK=S%Flags=AR%Ops=) - -Test 2 involves a NULL with the same options to an open port. Resp=Y -means we must get a response. Ops= means that there must not be any -options included in the response packet. If we took out '%Ops=' -entirely then any options sent would match. - -> T3(Resp=Y%DF=N%W=400%ACK=S++%Flags=AS%Ops=M) - -Test 3 is a SYN|FIN|URG|PSH w/options to an open port. - -> T4(DF=N%W=0%ACK=O%Flags=R%Ops=) - -This is an ACK to an open port. Note that we do not have a Resp= -here. This means that lack of a response (such as the packet being -dropped on the network or an evil firewall) will not disqualify a -match as long as all the other tests match. We do this because -virtually any OS will send a response, so a lack of response is -generally an attribute of the network conditions and not the OS -itself. We put the Resp tag in tests 2 and 3 because some operating -systems _do_ drop those without responding. - -> T5(DF=N%W=0%ACK=S++%Flags=AR%Ops=) -> T6(DF=N%W=0%ACK=O%Flags=R%Ops=) -> T7(DF=N%W=0%ACK=S%Flags=AR%Ops=) - -These tests are a SYN, ACK, and FIN|PSH|URG, respectively, to a closed -port. The same options as always are set. Of course this is all -probably obvious given the descriptive names 'T5', 'T6', and 'T7' :). - -> PU(DF=N%TOS=0%IPLEN=38%RIPTL=148%RID=E%RIPCK=E%UCK=E%ULEN=134%DAT=E) - -This big sucker is the 'port unreachable' message test. You should -recognize the DF=N by now. TOS=0 means that IP type of service field -was 0. The next two fields give the (hex) values of the IP total -length field of the message IP header and the total length given in -the IP header they are echoing back to us. RID=E means the RID value -we got back in the copy of our original UDP packet was expected (ie -the same as we sent). RIPCK=E means they didn't fuck up the checksum -(if they did, it would say RIPCK=F). UCK=E means the UDP checksum is -also correct. Next comes the UDP length which was 0x134 and DAT=E -means they echoed our UDP data correctly. Since most implementations -(including this one) do not send any of our UDP data back, they get -DAT=E by default. - -The version of nmap with this functionality is currently in the 6th -private beta cycle. It may be out by the time you read this in -Phrack. Then again, it might not. See http://www.insecure.org/nmap/ -for the latest version. - -POPULAR SITE SNAPSHOTS - -Here is the fun result of all our effort. We can now take random -Internet sites and determine what OS they are using. A lot of these -people have eliminated telnet banners, etc. to keep this information -private. But this is of no use with our new fingerprinter! Also -this is a good way to expose the users as the -lamers that they are :)! - -The command used in these examples was: nmap -sS -p 80 -O -v - -Also note that most of these scans were done on 10/18/98. Some of -these folks may have upgraded/changed servers since then. - -Note that I do not like every site on here. - -# "Hacker" sites or (in a couple cases) sites that think they are -www.l0pht.com => OpenBSD 2.2 - 2.4 -www.insecure.org => Linux 2.0.31-34 -www.rhino9.ml.org => Windows 95/NT # No comment :) -www.technotronic.com => Linux 2.0.31-34 -www.nmrc.org => FreeBSD 2.2.6 - 3.0 -www.cultdeadcow.com => OpenBSD 2.2 - 2.4 -www.kevinmitnick.com => Linux 2.0.31-34 # Free Kevin! -www.2600.com => FreeBSD 2.2.6 - 3.0 Beta -www.antionline.com => FreeBSD 2.2.6 - 3.0 Beta -www.rootshell.com => Linux 2.0.35 # Changed to OpenBSD after - # they got owned. - -# Security vendors, consultants, etc. -www.repsec.com => Linux 2.0.35 -www.iss.net => Linux 2.0.31-34 -www.checkpoint.com => Solaris 2.5 - 2.51 -www.infowar.com => Win95/NT - -# Vendor loyalty to their OS -www.li.org => Linux 2.0.35 # Linux International -www.redhat.com => Linux 2.0.31-34 # I wonder what distribution :) -www.debian.org => Linux 2.0.35 -www.linux.org => Linux 2.1.122 - 2.1.126 -www.sgi.com => IRIX 6.2 - 6.4 -www.netbsd.org => NetBSD 1.3X -www.openbsd.org => Solaris 2.6 # Ahem :) -www.freebsd.org => FreeBSD 2.2.6-3.0 Beta - -# Ivy league -www.harvard.edu => Solaris 2.6 -www.yale.edu => Solaris 2.5 - 2.51 -www.caltech.edu => SunOS 4.1.2-4.1.4 # Hello! This is the 90's :) -www.stanford.edu => Solaris 2.6 -www.mit.edu => Solaris 2.5 - 2.51 # Coincidence that so many good - # schools seem to like Sun? - # Perhaps it is the 40% - # .edu discount :) -www.berkeley.edu => UNIX OSF1 V 4.0,4.0B,4.0D -www.oxford.edu => Linux 2.0.33-34 # Rock on! - -# Lamer sites -www.aol.com => IRIX 6.2 - 6.4 # No wonder they are so insecure :) -www.happyhacker.org => OpenBSD 2.2-2.4 # Sick of being owned, Carolyn? - # Even the most secure OS is - # useless in the hands of an - # incompetent admin. - -# Misc -www.lwn.net => Linux 2.0.31-34 # This Linux news site rocks! -www.slashdot.org => Linux 2.1.122 - 2.1.126 -www.whitehouse.gov => IRIX 5.3 -sunsite.unc.edu => Solaris 2.6 - -Notes: In their security white paper, Microsoft said about their lax -security: "this assumption has changed over the years as Windows NT -gains popularity largely because of its security features.". Hmm, -from where I stand it doesn't look like Windows is very popular among -the security community :). I only see 2 Windows boxes from the whole -group, and Windows is _easy_ for nmap to distinguish since it is so -broken (standards wise). - -And of course, there is one more site we must check. This is the web -site of the ultra-secret Transmeta corporation. Interestingly the -company was funded largely by Paul Allen of Microsoft, but it employs -Linus Torvalds. So do they stick with Paul and run NT or do they side -with the rebels and join the Linux revolution? Let us see: - -We use the command: -nmap -sS -F -o transmeta.log -v -O www.transmeta.com/24 - -This says SYN scan for known ports (from /etc/services), log the -results to 'transmeta.log', be verbose about it, do an OS scan, and -scan the class 'C' where www.transmeta.com resides. Here is the gist -of the results: - -neon-best.transmeta.com (206.184.214.10) => Linux 2.0.33-34 -www.transmeta.com (206.184.214.11) => Linux 2.0.30 -neosilicon.transmeta.com (206.184.214.14) => Linux 2.0.33-34 -ssl.transmeta.com (206.184.214.15) => Linux unknown version -linux.kernel.org (206.184.214.34) => Linux 2.0.35 -www.linuxbase.org (206.184.214.35) => Linux 2.0.35 ( possibly the same - machine as above ) - -Well, I think this answers our question pretty clearly :). - - -ACKNOWLEDGEMENTS - -The only reason Nmap is currently able to detect so many different -operating systems is that many people on the private beta team went to -a lot of effort to search out new and exciting boxes to fingerprint! -In particular, Jan Koum, van Hauser, Dmess0r, David O'Brien, James -W. Abendschan, Solar Designer, Chris Wilson, Stuart Stock, Mea Culpa, -Lamont Granquist, Dr. Who, Jordan Ritter, Brett Eldridge, and Pluvius -sent in tons of IP addresses of wacky boxes and/or fingerprints of -machines not reachable through the Internet. - -Thanks to Richard Stallman for writing GNU Emacs. This article would -not be so well word-wrapped if I was using vi or cat and ^D. - -Questions and comments can be sent to fyodor@insecure.org (if that doesn't -work for some reason, use fyodor@insecure.org). Nmap can be obtained -from http://www.insecure.org/nmap . - - - diff --git a/docs/nmap.1 b/docs/nmap.1 index e948fe859..df46d524f 100644 --- a/docs/nmap.1 +++ b/docs/nmap.1 @@ -2,7 +2,7 @@ .\" It was generated using the DocBook XSL Stylesheets (version 1.69.1). .\" Instead of manually editing it, you probably should edit the DocBook XML .\" source for it and then use the DocBook XSL Stylesheets to regenerate it. -.TH "NMAP" "1" "07/04/2007" "" "Nmap Reference Guide" +.TH "NMAP" "1" "07/07/2007" "" "Nmap Reference Guide" .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) @@ -40,9 +40,9 @@ In addition to the interesting ports table, Nmap can provide further information .PP A typical Nmap scan is shown in Example\ 14.1, \(lqA representative Nmap scan\(rq. The only Nmap arguments used in this example are -\fB\-A\fR, to enable OS and version detection, +\fB\-A\fR, to enable OS and version detection, script scanning, and traceroute; \fB\-T4\fR -for faster execution, and then the two target hostnames. +for faster execution; and then the two target hostnames. Example\ 14.1.\ A representative Nmap scan.sp .nf # nmap \-A \-T4 scanme.nmap.org playground @@ -118,7 +118,6 @@ SCAN TECHNIQUES: \-sO: IP protocol scan \-b : FTP bounce scan \-\-traceroute: Trace hop path to each host - \-\-reason: Display the reason a port is in a particular state PORT SPECIFICATION AND SCAN ORDER: \-p : Only scan specified ports Ex: \-p22; \-p1\-65535; \-p U:53,111,137,T:21\-25,80,139,8080 @@ -180,7 +179,7 @@ OUTPUT: \-\-no\-stylesheet: Prevent associating of XSL stylesheet w/XML output MISC: \-6: Enable IPv6 scanning - \-A: Enables OS detection, Version detection, Script scanning and Traceroute + \-A: Enables OS detection and Version detection \-\-datadir : Specify custom Nmap data file location \-\-send\-eth/\-\-send\-ip: Send using raw ethernet frames or IP packets \-\-privileged: Assume that the user is fully privileged @@ -383,7 +382,7 @@ Traceroutes are performed post\-scan using information from the scan results to Traceroute works by sending packets with a low TTL (time\-to\-live) in an attempt to illicit ICMP TTL_EXCCEDED messages from intermediate hops between the scanner and the target host. Standard traceroute implementation start with a TTL of 1 and increment the TTL until the destination host is reached. Nmap's traceroute starts with a high TTL and then decrements the TTL until it reaches 0. Doing it backwards lets nmap employ clever caching algorithms to speed up traces over multiple hosts. On average nmap sends 5\-10 fewer packets per host, depending on network conditions. If a single subnet is being scanned (i.e. 192.168.0.0/24) nmap may only have to send a single packet to most hosts. .TP \fB\-\-reason\fR (Host and port state reasons) -Shows the reason each port is set to a specific state and the reason each host is up or down. This option displays the type of the packet that determined a port or hosts state. For example, A RST packet from a closed port or an echo reply from an alive host. The information nmap can provide is determined by the type of scan or ping. The SYN scan and SYN ping (\fB\-sS and -PT\fR) are very detailed. Whilst the TCP connect scan and ping (\fB\-sT\fR) are limited by the implementation of connect(). This feature is automatically enabled by the debug flag (\fB\-d\fR) and the results are stored in XML log files even if this option is not specified. +Shows the reason each port is set to a specific state and the reason each host is up or down. This option displays the type of the packet that determined a port or hosts state. For example, A RST packet from a closed port or an echo reply from an alive host. The information nmap can provide is determined by the type of scan or ping. The SYN scan and SYN ping (\fB\\\-sS and \-PT\fR) are very detailed. Whilst the TCP connect scan and ping (\fB\\\-sT\fR) are limited by the implementation of connect(). This feature is automatically enabled by the debug flag (\fB\\\-d\fR) and the results are stored in XML log files even if this option is not specified. .TP \fB\-n\fR (No DNS resolution) Tells Nmap to @@ -664,6 +663,15 @@ and at least one TCP scan type (such as \fB\-sS\fR, \fB\-sF\fR, or \fB\-sT\fR). If no protocol qualifier is given, the port numbers are added to all protocol lists. +Ports can also be specified by name according to what the port is referred to in the +\fInmap\-services\fR. You can even use the wildcards * and ? with the names. For example, to scan ftp and all ports whose names begin with http, use +\fB\-p ftp,http*\fR. Be careful about shell expansions and quote the argument to \-p if unsure. +.sp +Ranges of ports can be surrounded by square brackets to indicate ports inside that range that appear in +\fInmap\-services\fR. For example, the following will scan all ports in +\fInmap\-services\fR +equal to or below 1024: +\fB\-p [\-1024]\fR. Be careful with shell expansions and quote the argument to \-p if unsure. .TP \fB\-F\fR (Fast (limited port) scan) Specifies that you only wish to scan for ports listed in the @@ -681,6 +689,20 @@ options. By default, Nmap randomizes the scanned port order (except that certain commonly accessible ports are moved near the beginning for efficiency reasons). This randomization is normally desirable, but you can specify \fB\-r\fR for sequential port scanning instead. +.TP +\fB\-\-port\-ratio \fR +Scans all ports in +\fInmap\-services\fR +file with a ratio greater than the number specified as the argument. (new format +\fInmap\-services\fR +only.) +.TP +\fB\-\-top\-ports \fR +Scans the N highest\-ratio ports found in +\fInmap\-services\fR +file. (new format +\fInmap\-services\fR +only.) .SH "SERVICE AND VERSION DETECTION" .PP Point Nmap at a remote machine and it might tell you that ports 25/tcp, 80/tcp, and 53/udp are open. Using its @@ -706,8 +728,7 @@ Version detection is enabled and controlled with the following options: .TP \fB\-sV\fR (Version detection) Enables version detection, as discussed above. Alternatively, you can use -\fB\-A\fR -to enable both OS detection and version detection. +\fB\-A\fR, which enables version detection among other things. .TP \fB\-\-allports\fR (Don't exclude any ports from version detection) By default, Nmap version detection skips TCP port 9100 because some printers simply print anything sent to that port, leading to dozens of pages of HTTP get requests, binary SSL session requests, etc. This behavior can be changed by modifying or removing the @@ -766,7 +787,7 @@ OS detection is enabled and controlled with the following options: \fB\-O\fR (Enable OS detection) Enables OS detection, as discussed above. Alternatively, you can use \fB\-A\fR -to enable both OS detection and version detection. 2nd generation OS detection is tried first. If that fails, Nmap will either print out the host fingerprint and ask you to submit it (if you are certain about what the target host is running), or Nmap will fall back to the 1st generation OS detection system in case its larger database has a match. +to enable OS detection along with other things. 2nd generation OS detection is tried first. If that fails, Nmap will either print out the host fingerprint and ask you to submit it (if you are certain about what the target host is running), or Nmap will fall back to the 1st generation OS detection system in case its larger database has a match. .TP \fB\-O2\fR (2nd Generation OS Detection Only) Enables 2nd generation OS detection, but never falls back to the old (1st generation) system, even if it fails to find any match. This saves time and can reduce the number of packets sent to each target. diff --git a/docs/nmap.deprecated.txt b/docs/nmap.deprecated.txt deleted file mode 100644 index 4057687e1..000000000 --- a/docs/nmap.deprecated.txt +++ /dev/null @@ -1,371 +0,0 @@ - .oO Phrack 51 Oo. - - Volume Seven, Issue Fifty One - xx of xx - - The Art of Port Scanning - by Fyodor (fyodor@insecure.org) - - - -[ Abstract ] - -This paper details many of the techniques used to determine what ports (or -similar protocol abstraction) of a host are listening for connections. These -ports represent potential communication channels. Mapping their existence -facilitates the exchange of information with the host, and thus it is quite -useful for anyone wishing to explore their networked environment, including -hackers. Despite what you have heard from the media, the Internet is NOT -all about TCP port 80. Anyone who relies exclusively on the WWW for -information gathering is likely to gain the same level of proficiency as your -average AOLer, who does the same. This paper is also meant to serve as an -introduction to and ancillary documentation for a coding project I have been -working on. It is a full featured, robust port scanner which (I hope) solves -some of the problems I have encountered when dealing with other scanners and -when working to scan massive networks. The tool, nmap, supports the following: - - - vanilla TCP connect() scanning, - - TCP SYN (half open) scanning, - - TCP FIN (stealth) scanning, - - TCP ftp proxy (bounce attack) scanning - - SYN/FIN scanning using IP fragments (bypasses packet filters), - - UDP recvfrom() scanning, - - UDP raw ICMP port unreachable scanning, - - ICMP scanning (ping-sweep), and - - reverse-ident scanning. - -The freely distributable source code is appended to this paper. - - - -[ Introduction ] - -Scanning, as a method for discovering exploitable communication channels, has -been around for ages. The idea is to probe as many listeners as possible, and -keep track of the ones which are receptive or useful to your particular need. -Much of the field of advertising is based on this paradigm, and the "to current -resident" brute force style of bulk mail is an almost perfect parallel to what -we will discuss. Just stick a message in every mailbox and wait for the -responses to trickle back. - -Scanning entered the h/p world along with the phone systems. Here we have this -tremendous global telecommunications network, all reachable through codes on -our telephone. Millions of numbers are reachable locally, yet we may only -be interested in 0.5% of these numbers, perhaps those that answer with a -carrier. - -The logical solution to finding those numbers that interest us is to try them -all. Thus the field of "wardialing" arose. Excellent programs like Toneloc -were developed to facilitate the probing of entire exchanges and more. The -basic idea is simple. If you dial a number and your modem gives you a CONNECT, -you record it. Otherwise the computer hangs up and tirelessly dials the next -one. - -While wardialing is still useful, we are now finding that many of the computers -we wish to communicate with are connected through networks such as the Internet -rather than analog phone dialups. Scanning these machines involves the same -brute force technique. We send a blizzard of packets for various protocols, -and we deduce which services are listening from the responses we receive (or -don't receive). - - - -[ Techniques ] - -Over time, a number of techniques have been developed for surveying the -protocols and ports on which a target machine is listening. They all offer -different benefits and problems. Here is a line up of the most common: - -- TCP connect() scanning : This is the most basic form of tcp scanning. The -connect() system call provided by your operating system is used to open a -connection to every interesting port on the machine. If the port is listening, -connect() will succeed, otherwise the port isn't reachable. One strong -advantage to this technique is that you don't need any special privileges. Any -user on most UNIX boxes is free to use this call. Another advantage is speed. -While making a separate connect() call for every targeted port in a linear -fashion would take ages over a slow connection, you can hasten the scan by -using many sockets in parallel. Using non-blocking I/O allows you to set a low -time-out period and watch all the sockets at once. This is the fastest -scanning method supported by nmap, and is available with the -t (TCP) option. -The big downside is that this sort of scan is easily detectable and filterable. -The target hosts logs will show a bunch of connection and error messages for -the services which take the connection and then have it immediately shutdown. - - -- TCP SYN scanning : This technique is often referred to as "half-open" -scanning, because you don't open a full TCP connection. You send a SYN packet, -as if you are going to open a real connection and wait for a response. A -SYN|ACK indicates the port is listening. A RST is indicative of a non- -listener. If a SYN|ACK is received, you immediately send a RST to tear down -the connection (actually the kernel does this for us). The primary advantage -to this scanning technique is that fewer sites will log it. Unfortunately you -need root privileges to build these custom SYN packets. SYN scanning is the -s -option of nmap. - - -- TCP FIN scanning : There are times when even SYN scanning isn't clandestine -enough. Some firewalls and packet filters watch for SYNs to an unallowed port, -and programs like synlogger and courtney are available to detect these scans. -FIN packets, on the other hand, may be able to pass through unmolested. This -scanning technique was featured in detail by Uriel Maimon in Phrack 49, article -15. The idea is that closed ports tend to reply to your FIN packet with the -proper RST. Open ports, on the other hand, tend to ignore the packet in -question. This is a bug in TCP implementations and so it isn't 100% reliable -(some systems, notably Micro$oft boxes, seem to be immune). It works well on -most other systems I've tried. FIN scanning is the -U (Uriel) option of nmap. - - -- Fragmentation scanning : This is not a new scanning method in and of itself, -but a modification of other techniques. Instead of just sending the probe -packet, you break it into a couple of small IP fragments. You are splitting -up the TCP header over several packets to make it harder for packet filters -and so forth to detect what you are doing. Be careful with this! Some -programs have trouble handling these tiny packets. My favorite sniffer -segmentation faulted immediately upon receiving the first 36-byte fragment. -After that comes a 24 byte one! While this method won't get by packet filters -and firewalls that queue all IP fragments (like the CONFIG_IP_ALWAYS_DEFRAG -option in Linux), a lot of networks can't afford the performance hit this -causes. This feature is rather unique to scanners (at least I haven't seen -any others that do this). Thanks to daemon9 for suggesting it. The -f -instructs the specified SYN or FIN scan to use tiny fragmented packets. - - -- TCP reverse ident scanning : As noted by Dave Goldsmith in a 1996 Bugtraq -post, the ident protocol (rfc1413) allows for the disclosure of the username of -the owner of any process connected via TCP, even if that process didn't -initiate the connection. So you can, for example, connect to the http port -and then use identd to find out whether the server is running as root. This -can only be done with a full TCP connection to the target port (ie the -t -option). nmap's -i option queries identd for the owner of all listen()ing -ports. - - -- FTP bounce attack : An interesting "feature" of the ftp protocol (RFC 959) is -support for "proxy" ftp connections. In other words, I should be able to -connect from evil.com to the FTP server-PI (protocol interpreter) of target.com -to establish the control communication connection. Then I should be able to -request that the server-PI initiate an active server-DTP (data transfer -process) to send a file ANYWHERE on the internet! Presumably to a User-DTP, -although the rfc specifically states that asking one server to send a file to -another is OK. Now this may have worked well in 1985, when the rfc was -written. But nowadays, we can't have people hijacking ftp servers and -requesting that data be spit out to arbitrary points on the internet. As -*Hobbit* wrote back in 1995, this protocol flaw "can be used to post virtually -untraceable mail and news, hammer on servers at various sites, fill up disks, -try to hop firewalls, and generally be annoying and hard to track down at the -same time." What we will exploit this for is to (surprise, surprise) scan TCP -ports from a "proxy" ftp server. Thus you could connect to an ftp server -behind a firwall, and then scan ports that are more likely to be blocked (139 -is a good one). If the ftp server allows reading from and writing to a -directory (such as /incoming), you can send arbitrary data to ports that you do -find open. - -For port scanning, our technique is to use the PORT command to declare that -our passive "User-DTP" is listening on the target box at a certain port number. - Then we try to LIST the current directory, and the result is sent over the -Server-DTP channel. If our target host is listening on the specified port, the -transfer will be successful (generating a 150 and a 226 response). Otherwise -we will get "425 Can't build data connection: Connection refused." Then we -issue another PORT command to try the next port on the target host. The -advantages to this approach are obvious (harder to trace, potential to bypass -firewalls). The main disadvantages are that it is slow, and that some FTP -servers have finally got a clue and disabled the proxy "feature". For what it -is worth, here is a list of benners from sites where it does/doesn't work: - -*Bounce attacks worked:* - -220 xxxxxxx.com FTP server (Version wu-2.4(3) Wed Dec 14 ...) ready. -220 xxx.xxx.xxx.edu FTP server ready. -220 xx.Telcom.xxxx.EDU FTP server (Version wu-2.4(3) Tue Jun 11 ...) ready. -220 lem FTP server (SunOS 4.1) ready. -220 xxx.xxx.es FTP server (Version wu-2.4(11) Sat Apr 27 ...) ready. -220 elios FTP server (SunOS 4.1) ready - -*Bounce attack failed:* - -220 wcarchive.cdrom.com FTP server (Version DG-2.0.39 Sun May 4 ...) ready. -220 xxx.xx.xxxxx.EDU Version wu-2.4.2-academ[BETA-12](1) Fri Feb 7 -220 ftp Microsoft FTP Service (Version 3.0). -220 xxx FTP server (Version wu-2.4.2-academ[BETA-11](1) Tue Sep 3 ...) ready. -220 xxx.unc.edu FTP server (Version wu-2.4.2-academ[BETA-13](6) ...) ready. - -The 'x's are partly there to protect those guilty of running a flawed server, -but mostly just to make the lines fit in 80 columns. Same thing with the -ellipse points. The bounce attack is avalable with the -b -option of nmap. proxy_server can be specified in standard URL format, -username:password@server:port , with everything but server being optional. - - -- UDP ICMP port unreachable scanning : This scanning method varies from the -above in that we are using the UDP protocol instead of TCP. While this -protocol is simpler, scanning it is actually significantly more difficult. -This is because open ports don't have to send an acknowledgement in response to -our probe, and closed ports aren't even required to send an error packet. -Fortunately, most hosts do send an ICMP_PORT_UNREACH error when you send a -packet to a closed UDP port. Thus you can find out if a port is NOT open, and -by exclusion determine which ports which are. Neither UDP packets, nor the -ICMP errors are guaranteed to arrive, so UDP scanners of this sort must also -implement retransmission of packets that appear to be lost (or you will get a -bunch of false positives). Also, this scanning technique is slow because of -compensation for machines that took RFC 1812 section 4.3.2.8 to heart and limit -ICMP error message rate. For example, the Linux kernel (in net/ipv4/icmp.h) -limits destination unreachable message generation to 80 per 4 seconds, with a -1/4 second penalty if that is exceeded. At some point I will add a better -algorithm to nmap for detecting this. Also, you will need to be root for -access to the raw ICMP socket necessary for reading the port unreachable. The --u (UDP) option of nmap implements this scanning method for root users. - -Some people think UDP scanning is lame and pointless. I usually remind them of -the recent Solaris rcpbind hole. Rcpbind can be found hiding on an -undocumented UDP port somewhere above 32770. So it doesn't matter that 111 is -blocked by the firewall. But can you find which of the more than 30,000 high -ports it is listening on? With a UDP scanner you can! - - -- UDP recvfrom() and write() scanning : While non-root users can't read -port unreachable errors directly, Linux is cool enough to inform the user -indirectly when they have been received. For example a second write() -call to a closed port will usually fail. A lot of scanners such as netcat -and Pluvius' pscan.c do this. I have also noticed that recvfrom() on -non-blocking UDP sockets usually return EAGAIN ("Try Again", errno 13) if -the ICMP error hasn't been received, and ECONNREFUSED ("Connection refused", -errno 111) if it has. This is the technique used for determining open ports -when non-root users use -u (UDP). Root users can also use the -l (lamer -UDP scan) options to force this, but it is a really dumb idea. - - -- ICMP echo scanning : This isn't really port scanning, since ICMP doesn't have -a port abstraction. But it is sometimes useful to determine what hosts in a -network are up by pinging them all. the -P option does this. Also you might -want to adjust the PING_TIMEOUT #define if you are scanning a large -network. nmap supports a host/bitmask notation to make this sort of thing -easier. For example 'nmap -P cert.org/24 152.148.0.0/16' would scan CERT's -class C network and whatever class B entity 152.148.* represents. Host/26 is -useful for 6-bit subnets within an organization. - - - -[ Features ] - -Prior to writing nmap, I spent a lot of time with other scanners exploring the -Internet and various private networks (note the avoidance of the "intranet" -buzzword). I have used many of the top scanners available today, including -strobe by Julian Assange, netcat by *Hobbit*, stcp by Uriel Maimon, pscan by -Pluvius, ident-scan by Dave Goldsmith, and the SATAN tcp/udp scanners by -Wietse Venema. These are all excellent scanners! In fact, I ended up hacking -most of them to support the best features of the others. Finally I decided -to write a whole new scanner, rather than rely on hacked versions of a dozen -different scanners in my /usr/local/sbin. While I wrote all the code, nmap -uses a lot of good ideas from its predecessors. I also incorporated some new -stuff like fragmentation scanning and options which were on my "wish list" for -other scanners. Here are some of the (IMHO) useful features of nmap: - -- dynamic delay time calculations: Some scanners require that you supply a -delay time between sending packets. Well how should I know what to use? -Sure, I can ping them, but that is a pain, and plus the response time of many -hosts changes dramatically when they are being flooded with requests. nmap -tries to determine the best delay time for you. It also tries to keep track -of packet retransmissions, etc. so that it can modify this delay time during -the course of the scan. For root users, the primary technique for finding an -initial delay is to time the internal "ping" function. For non-root users, it -times an attempted connect() to a closed port on the target. It can also pick -a reasonable default value. Again, people who want to specify a delay -themselves can do so with -w (wait), but you shouldn't have to. - -- retransmission: Some scanners just send out all the query packets, and -collect the responses. But this can lead to false positives or negatives in -the case where packets are dropped. This is especially important for -"negative" style scans like UDP and FIN, where what you are looking for is a -port that does NOT respond. In most cases, nmap implements a configurable -number of retransmissions for ports that don't respond. - -- parallel port scanning: Some scanners simply scan ports linearly, one at a -time, until they do all 65535. This actually works for TCP on a very fast -local network, but the speed of this is not at all acceptable on a wide area -network like the Internet. nmap uses non-blocking i/o and parallel scanning -in all TCP and UDP modes. The number of scans in parallel is configurable -with the -M (Max sockets) option. On a very fast network you will actually -decrease performance if you do more than 18 or so. On slow networks, high -values increase performance dramatically. - -- Flexible port specification: I don't always want to just scan all 65535 -ports. Also, the scanners which only allow you to scan ports 1 - N sometimes -fall short of my need. The -p option allows you to specify an arbitrary -number of ports and ranges for scanning. For example, '-p 21-25,80,113, -60000-' does what you would expect (a trailing hyphen means up to 65536, a -leading hyphen means 1 through). You can also use the -F (fast) option, which -scans all the ports registered in your /etc/services (a la strobe). - -- Flexible target specification: I often want to scan more then one host, -and I certainly don't want to list every single host on a large network to -scan. Everything that isn't an option (or option argument) in nmap is -treated as a target host. As mentioned before, you can optionally append -/mask to a hostname or IP address in order to scan all hosts with the same -initial bits of the 32 bit IP address. - -- detection of down hosts: Some scanners allow you to scan large networks, but -they waste a huge amount of time scanning 65535 ports of a dead host! By -default, nmap pings each host to make sure it is up before wasting time on it. -It is also capable of bailing on hosts which seem down based on strange port -scanning errors. It is also meant to be tolerant of people who accidently scan -network addresses, broadcast addresses, etc. - -- detection of your IP address: For some reason, a lot of scanners ask you to -type in your IP address as one of the parameters. Jeez, I don't want to have -to 'ifconfig' and figure out my current address every time I scan. Of course, -this is better then the scanners I've seen which require recompilation every -time you change your address! nmap first tries to detect your address during -the ping stage. It uses the address that the echo response is received on, as -that is the interface it should almost always be routed through. If it can't -do this (like if you don't have host pinging enabled), nmap tries to detect -your primary interface and uses that address. You can also use -S to specify -it directly, but you shouldn't have to (unless you want to make it look like -someone ELSE is SYN or FIN scanning a host. - - -Some other, more minor options: - - -v (verbose): This is highly recommended for interactive use. Among other -useful messages, you will see ports come up as they are found, rather than -having to wait for the sorted summary list. - - -r (randomize): This will randomize the order in which the target host's -ports are scanned. - - -q (quash argv): This changes argv[0] to FAKE_ARGV ("pine" by default). -It also eliminates all other arguments, so you won't look too suspicious in -'w' or 'ps' listings. - - -h for an options summary. - -Also look for http://www.insecure.org/nmap/, which is the web site I plan to -put future versions and more information on. In fact, you would be well -advised to check there right now. - - -[ Greets ] - -Of course this paper would not be complete without a shout out to all the -people who made it possible. - -* Congratulations to the people at Phrack for getting this thing going again! -* Greets to the whole dc-stuff crew. -* Greets to the STUPH, Turntec, L0pht, TACD, the Guild, cDc, and all the other - groups who help keep the scene alive. -* Shout out to _eci for disclosing the coolest Windows bug in recent history. -* Thanks to the Data Haven Project (dhp.com) admins for providing such great - service for $10/month. -* And a special shout out goes to all my friends. You know who - you are and some of you (wisely) stay out of the spotlight, so I'll keep you - anonymous ... except of course for Ken and Jay, and Avenger, Grog, Cash - Monies, Ethernet Kid, Zos, JuICe, Mother Prednisone, and Karen. - - -And finally, we get to ... - - -[ The code ] - -This should compile fine on any Linux box with 'gcc -O6 -o nmap nmap.c -lm'. -It is distrubuted under the terms of the GNU GENERAL PUBLIC LICENSE. If you -have problems or comments, feel free to mail me (fyodor@insecure.org). diff --git a/docs/nmap.usage.txt b/docs/nmap.usage.txt index 2ef3d48a8..ad2f5f068 100644 --- a/docs/nmap.usage.txt +++ b/docs/nmap.usage.txt @@ -89,7 +89,7 @@ OUTPUT: --no-stylesheet: Prevent associating of XSL stylesheet w/XML output MISC: -6: Enable IPv6 scanning - -A: Enables OS detection, Version detection, Script scanning and Traceroute + -A: Enables OS detection and Version detection, Script scanning and Traceroute --datadir : Specify custom Nmap data file location --send-eth/--send-ip: Send using raw ethernet frames or IP packets --privileged: Assume that the user is fully privileged diff --git a/docs/nmap_doc.html b/docs/nmap_doc.html deleted file mode 100644 index 9467153bb..000000000 --- a/docs/nmap_doc.html +++ /dev/null @@ -1,449 +0,0 @@ - - -Nmap: The Art of Port Scanning - - -

The Art of Port Scanning

-

by Fyodor <fyodor@insecure.org>

-
(Last significant update: Sat Sep 6 03:24:53 GMT 1997)
-

- -

Warning, the interface to nmap has changed a bit and so not all the flags and options mentioned in this paper are still accurate. The authoritative documentation is now the man page (html version). This article still contains a lot of information on port scanning though and so I recommend that nmap users read it.

- -
Abstract
- -

This paper details many of the techniques used to determine what ports (or -similar protocol abstraction) of a host are listening for connections. These -ports represent potential communication channels. Mapping their existence -facilitates the exchange of information with the host, and thus it is quite -useful for anyone wishing to explore their networked environment, including -hackers. Despite what you have heard from the media, the Internet is NOT -all about TCP port 80. Anyone who relies exclusively on the WWW for -information gathering is likely to gain the same level of proficiency as your -average AOLer, who does the same. This paper is also meant to serve as an -introduction to and ancillary documentation for a coding project I have been -working on. It is a full featured, robust port scanner which (I hope) solves -some of the problems I have encountered when dealing with other scanners and -when working to scan massive networks. The tool, nmap, supports the following: -

-

-

-The freely distributable source code is available at http://www.insecure.org/nmap/ -

- -
Introduction
- -

Scanning, as a method for discovering exploitable communication channels, has -been around for ages. The idea is to probe as many listeners as possible, and -keep track of the ones that are receptive or useful to your particular need. -Much of the field of advertising is based on this paradigm, and the "to current -resident" brute force style of bulk mail is an almost perfect parallel to what -we will discuss. Just stick a message in every mailbox and wait for the -responses to trickle back. - -

Scanning entered the h/p world along with the phone systems. Here -we have this tremendous global telecommunications network, all -reachable through codes on our telephone. Millions of numbers are -reachable locally, yet we may only be interested in 0.5% of these -numbers, perhaps those that answer with a carrier. - -

The logical solution to finding those numbers that interest us is -to try them all. Thus the field of "wardialing" arose. Excellent -programs like Toneloc were developed to facilitate the probing of -entire exchanges and more. The basic idea is simple. If you dial a -number and your modem gives you a CONNECT, you record it. Otherwise -the computer hangs up and tirelessly dials the next one. - -

While wardialing is still useful, we are now finding that many of -the computers we wish to communicate with are connected through -networks such as the Internet rather than analog phone dialups. -Scanning these machines involves the same brute force technique. We -send a blizzard of packets for various protocols, and we deduce which -services are listening from the responses we receive (or don't -receive). - -

-
Techniques
- -

Over time, a number of techniques have been developed for surveying the -protocols and ports on which a target machine is listening. They all offer -different benefits and problems. Here is a line up of the most common:

- -

-

- -
Features
- -

Prior to writing nmap, I spent a lot of time with other scanners -exploring the Internet and various private networks (note the -avoidance of the "intranet" buzzword). I have used many of the top -scanners available today, including strobe by Julian Assange, netcat -by *Hobbit*, stcp by Uriel Maimon, pscan by Pluvius, ident-scan by -Dave Goldsmith, and the SATAN tcp/udp scanners by Wietse Venema. -These are all excellent scanners! In fact, I ended up hacking most of -them to support the best features of the others. Finally I decided to -write a whole new scanner, rather than rely on hacked versions of a -dozen different scanners in my /usr/local/sbin. While I wrote all the -code, nmap uses a lot of good ideas from its predecessors. I also -incorporated some new stuff like fragmentation scanning and options -that were on my "wish list" for other scanners. Here are some of the -(IMHO) useful features of nmap:

- -

    -
  • dynamic delay time calculations: Some scanners require that you -supply a delay time between sending packets. Well how should I know -what to use? Sure, I can ping them, but that is a pain, and plus the -response time of many hosts changes dramatically when they are being -flooded with requests. nmap tries to determine the best delay time -for you. It also tries to keep track of packet retransmissions, -etc. so that it can modify this delay time during the course of the -scan. For root users, the primary technique for finding an initial -delay is to time the internal "ping" function. For non-root users, it -times an attempted connect() to a closed port on the target. It can -also pick a reasonable default value. Again, people who want to -specify a delay themselves can do so with -w (wait), but you shouldn't -have to.

    - -
  • retransmission: Some scanners just send out all the query packets, -and collect the responses. But this can lead to false positives or -negatives in the case where packets are dropped. This is especially -important for "negative" style scans like UDP and FIN, where what you -are looking for is a port that does NOT respond. In most cases, nmap -implements a configurable number of retransmissions for ports that -don't respond.

    - -
  • parallel port scanning: Some scanners simply scan ports linearly, -one at a time, until they do all 65535. This actually works for TCP -on a very fast local network, but the speed of this is not at all -acceptable on a wide area network like the Internet. nmap uses -non-blocking i/o and parallel scanning in all TCP and UDP modes. The -number of scans in parallel is configurable with the -M (Max sockets) -option. On a very fast network you will actually decrease performance -if you do more than 18 or so. On slow networks, high values increase -performance dramatically.

    - -
  • Flexible port specification: I don't always want to just scan all -65535 ports. Also, the scanners which only allow you to scan ports 1 -- N sometimes fall short of my need. The -p option allows you to -specify an arbitrary number of ports and ranges for scanning. For -example, '-p 21-25,80,113, 60000-' does what you would expect (a -trailing hyphen means up to 65536, a leading hyphen means 1 through). -You can also use the -F (fast) option, which scans all the ports -registered in your /etc/services (a la strobe).

    - -
  • Flexible target specification: I often want to scan more then one -host, and I certainly don't want to list every single host on a large -network to scan. Everything that isn't an option (or option argument) -in nmap is treated as a target host. As mentioned before, you can -optionally append /mask to a hostname or IP address in order to scan -all hosts with the same initial bits of the 32 bit IP -address. You can use the same powerful syntax as the port -specifications to specify targets like '150.12.17.71-79.7.*'. '*' is -just a shortcut for 0-255, remember to escape it from your shell if -used.

    - -
  • detection of down hosts: Some scanners allow you to scan large -networks, but they waste a huge amount of time scanning 65535 ports of -a dead host! By default, nmap pings each host to make sure it is up -before wasting time on it. It also does thin in parallel, to speed -things up. You can change the parrallel ping lookahead with '-L' and -the ping timeout with '-T'. You can turn pinging off completely with -the '-D' command line option. This is useful for scanning networks -like microsoft.com where ICMP echo requests can't get through. Nmap -is also capable of bailing on hosts that seem down based on strange -port scanning errors. It is also meant to be tolerant of people who -accidentally scan network addresses, broadcast addresses, etc.

    - -
  • detection of your IP address: For some reason, a lot of scanners -ask you to type in your IP address as one of the parameters. Jeez, I -don't want to have to 'ifconfig' and figure out my current address -every time I scan. Of course, this is better then the scanners I've -seen which require recompilation every time you change your address! -nmap first tries to detect your address during the ping stage. It -uses the address that the echo response is received on, as that is the -interface it should almost always be routed through. If it can't do -this (like if you don't have host pinging enabled), nmap tries to -detect your primary interface and uses that address. You can also use --S to specify it directly, but you shouldn't have to (unless you want -to make it look like someone ELSE is SYN or FIN scanning a -host.

    -
- -Some other, more minor options:
-
- -v (verbose): This is highly recommended for interactive use.  Among other
-useful messages, you will see ports come up as they are found, rather than
-having to wait for the sorted summary list.
-
- -r (randomize): This will randomize the order in which the target host's
-ports are scanned.
-
- -q (quash argv): This changes argv[0] to FAKE_ARGV ("pine" by default).
-It also eliminates all other arguments, so you won't look too suspicious in
-'w' or 'ps' listings.
-
- -h for an options summary.
-
- -R show and resolve all hosts, even down ones.
-
- -Also look for
http://www.insecure.org/nmap, -which is the web site I plan to put future versions and more -information on. In fact, you would be well advised to check there -right now. (If that isn't where you are reading this). - -
Example -Usage
-

- -To launch a stealth scan of the entire class 'B' networks 166.66.0.0 and -166.67.0.0 for the popularly exploitable imapd daemon:
-
-# nmap -Up 143 166.66.0.0/16 166.67.0.0/16
-
-To do a standard tcp scan on the reserved ports of host -<target>:
-
-> nmap target
-
-To check the class 'C' network on which warez.com sits for popular -services (via fragmented SIN scan):
-
-# nmap -fsp 21,22,23,25,80,110 warez.com/24
-
-To scan the same network for all the services in your /etc/services -via (very fast) tcp scan:
-
-> nmap -F warez.com/24
-
-To scan secret.pathetic.net using the ftp bounce attack off of -ftp.pathetic.net:
-
-> nmap -Db ftp.pathetic.net secret.pathetic.net
-
-To find hosts that are up in the the adjacent class C's 193.14.12, -.13, .14, .15, ... , .30:
-
-> nmap -P '193.14.[12-30].*'
-
-If you don't want to have to quote it to avoid shell interpretation, -this does the same thing:
-
-> nmap -P 193.14.12-30.0-255
-
- - - diff --git a/docs/nmap_french.1 b/docs/nmap_french.1 deleted file mode 100644 index 71a92a4ba..000000000 --- a/docs/nmap_french.1 +++ /dev/null @@ -1,950 +0,0 @@ -.\" nmap version 3.00, August 2002 -.\" This definition swiped from the gcc(1) man page -.de Sp -.if n .sp -.if t .sp 0.4 -.. -.TH NMAP 1 -.SH NOM -nmap \- Outil d'exploration rИseau et analyseur de sИcuritИ -.SH SYNOPSIS -.B nmap -[Type(s) de scan] [Options] -.SH DESCRIPTION - -.I Nmap -a ИtИ conГu pour que les administrateurs systХmes et les curieux -puissent analyser de grands rИseaux pour dИterminer les hТtes actifs et les -services offerts. -.I nmap -supporte un grand nombre de techniques d'analyse\ : UDP, TCP -connect(), TCP SYN (mi ouvert), ftp proxy (attaque par rebond), -Reverse-ident, ICMP (balayage de ping), FIN, balayage de ACK, Xmas Tree, balayage -de SYN, Protocoles IP, et Null scan. Voir la section -.I Types de scans -pour plus de dИtails. Nmap offre Иgalement des caractИristiques avancИes -comme la dИtection du systХme d'exploitation distant via l'empreinte -TCP/IP, l'analyse furtive, le dИlai dynamique et les calculs de retransmission, -l'analyse parallХle, dИtection de hТtes inactifs via -des pings parallХles, l'analyse avec leurres, la dИtection des ports filtrИs, -analyse directe (sans portmapper) des RCP, l'analyse avec fragmentation, -et une notation puissante pour dИsigner les hТtes et les ports. -.PP -Des efforts significatifs ont ИtИ consacrИs pour que nmap soit utilisable -par des utilisateurs non-root. Malheureusement, la plupart des interfaces -noyaux critiques (comme les raw sockets) requiХrent les privilХges root. -Nmap devrait donc Йtre lancИ en tant que root autant que possible -(mais pas en setuid root, Иvidemment). -.PP -Le rИsultat de l'exИcution de nmap est habituellement une liste -de ports intИressants sur les machines analysИes. Nmap donne pour -chaque port le nom du service, le numИro, l'Иtat et le protocole. -L'Иtat peut Йtre ╚\ open\ ╩, ╚\ filtered\ ╩ ou ╚\ unfiltered\ ╩. -╚\ Open\ ╩ signifie que la machine cible accepte les connexions sur ce port. -╚\ Filtered\ ╩ signifie qu'un pare-feu, un filtre ou un autre obstacle rИseau -protХge le port et empЙche nmap de dИtecter si le port est ouvert. -╚\ Unfiltered\ ╩ signifie que le port est fermИ et qu'aucun pare-feu n'a -interfИrИ avec nmap. -Les ports ╚\ Unfiltered\ ╩ sont les plus courants et ne sont affichИs -que lorsque la majoritИ des ports analysИs sont dans l'Иtat ╚\ filtered\ ╩. -.PP -En fonction des options utilisИes, nmap peut aussi rapporter les caractИristiques -suivantes du systХme d'exploitation distant\ : -type de systХme d'exploitation, sИquencement TCP, noms des utilisateurs -qui ont lancИ les programmes qui Иcoutent sur chaque port, le nom DNS, -et d'autres choses encore. -.SH OPTIONS -Les options ayant du sens ensemble peuvent gИnИralement Йtre combinИes. -Certaines options sont spИcifiques Ю certains modes d'analyses. -.I nmap -essaye de dИtecter et de prИvenir l'utilisateur -en cas de combinaisons d'options dИmentes ou non supportИes. -.Sp -Si vous Йtes impatient, vous pouvez passer directement -Ю la section des -.I exemples -Ю la fin, qui illustre l'usage courant. Vous pouvez aussi lancer -.B nmap -h -pour un bref rappel de toutes les options. -.TP -.B TYPES DE SCANS -.TP -.B \-sS -TCP SYN scan\ : Cette technique est souvent appelИe scan -╚\ mi ouvert\ ╩, parce qu'on ouvre une connexion TCP incomplХte. -On envoie un paquet SYN, comme pour une vИritable ouverture de connexion -et on attend une rИponse. Un SYN ou ACK indique -que le port est sous Иcoute, en revanche un RST signifie que personne n'Иcoute -sur ce port. -Si un SYN ou ACK est reГu, un RST est immИdiatement envoyИ pour interrompre -la connexion. -Le principal avantage de cette technique est que peu de sites l'archiveront. -dans leurs logs. -Malheureusement vous avez besoin des privilХges root pour construire -ces paquets SYN sur mesure. C'est le scan par dИfaut pour les utilisateurs -qui ont les privilХges root. -.TP -.B \-sT -TCP connect() scan\ : C'est la forme la plus simple de scan TCP. -L'appel systХme connect() fournit par votre systХme d'exploitation -est utilisИ pour ouvrir une connexion sur tous les ports intИressants -de la cible. Si le port est sur Иcoute, -connect() rИussira, sinon le port est injoignable. -Le principal avantage de cette technique est qu'elle ne nИcessite pas -de privilХges particuliers. Presque tous les utilisateurs de toutes les machines Unix -sont libres d'utiliser cet appel systХme. -.Sp -Ce type de scan est facilement dИtectable par l'hТte cible -puisque les logs de la cible montreront un ensemble de connexions -et de messages d'erreurs pour les services qui ont acceptИ la connexion -qui a ИtИ immИdiatement coupИe. -C'est le scan par dИfaut pour les utilisateurs normaux (non root). -.TP -.B \-sF \-sX \-sN -Stealth FIN, Xmas Tree, ou Null scan modes\ : Parfois mЙme -un SYN scan n'est pas suffisamment discret. -Certains pare-feux et filtreurs de paquets regardent les -SYNs vers les ports interdits, et des programmes comme Synlogger et -Courtney peuvent dИtecter ces scans. En revanche, ces scans avancИs -devrait pourvoir passer sans problХmes. -.Sp -L'idИe est qu'un port fermИ est requis pour -rИpondre au paquet de test par un RST, alors -que les ports ouverts doivent ignorer les paquets en question -(voir RFC 793 pp 64). Le FIN scan utilise -un paquet FIN nu comme testeur, alors que le scan Xmas tree -active les drapeaux URG et PUSH du paquet FIN. Le scan Null, dИsactive tous -les drapeaux. Malheureusement Microsoft (comme d'habitude) -a dИcidИ d'ignorer complХtement le standard et de faire les choses Ю sa faГon. -C'est pourquoi ce type de scan ne fonctionne pas contre les systХmes sous -Windows95/NT. Le cТtИ positif est que c'est un bon moyen de distinguer deux -plates-formes. -Si le scan trouve des ports ouverts, vous savez que la machine cible n'est -pas sous Windows. Si un -sF,-sX, ou -sN scan montre tous les ports -fermИs, et qu'un scan SYN (-sS) montre tous les ports ouverts, la machine cible -fonctionne probablement sous -Windows. Ceci est moins utile depuis que nmap a son propre dИtecteur de systХme -d'exploitation intИgrИ. D'autres systХmes ont le mЙme problХme que Windows\ : -Cisco, BSDI, HP/UX, MVS, et IRIX. -La plupart envoient des resets depuis les ports ouverts au lieu d'ignorer -le paquet. -.TP -.B \-sP -Ping scanning\ : Parfois vous voulez juste savoir quels sont les hТtes -actifs d'un rИseau. -Nmap peut le faire pour vous en envoyant des paquets d'Иcho ICMP Ю chaque adresse IP du rИseau spИcifiИ. -Les hТtes qui rИpondent sont actifs. Malheureusement, certains sites comme -microsoft.com, bloquent les paquets d'Иcho. -Toutefois nmap peut aussi envoyer un paquet TCP ack au port 80 (par dИfaut). -Si vous recevez un RST en retour, la machine est active. Une troisiХme -technique consiste Ю envoyer un paquet SYN et d'attendre un RST ou un SYN/ACK. -Pour les utilisateurs non-root, la mИthode connect() est utilisИe. -.Sp -Par dИfaut (pour les utilisateurs root), nmap utilise la technique -ICMP et ACK en parallХle. Vous pouvez changer l'option -.B \-P -dИcrite plus tard. -.Sp -Remarquez que le ping est fait par dИfaut de toutes faГons -et seuls les hТtes qui rИpondent sont analysИs. -N'utilisez cette option que si vous voulez faire un balayage de -ping -.B sans -faire d'analyse de ports. -.TP -.B \-sU -UDP scans\ : Cette mИthode est utilisИe pour dИterminer les ports UDP -(User Datagram Protocol, RFC 768) qui sont ouverts sur l'hТte -Cette technique consiste Ю envoyer un paquet udp de 0 octet Ю chaque -port de la machine cible. Si on reГoit un message ICMP ╚\ port unreachable\ ╩, -alors le port est fermИ. Autrement nous supposons qu'il est ouvert. -.Sp -Certaines personne pensent que l'analyse UDP est inutile. -J'ai pour habitude de leur rappeler le trou rИcent dans rcpbind sous Solaris. -Rpcbind peut dissimuler un port UDP non documentИ quelque part au dessus -de 32\ 770. Comme dИcouvrir un tel port sans scanner UDP\ ? -Il y a aussi le programme -cDc Back Orifice backdoor qui cache un port UDP configurable -sur les machines Windows. Sans mЙme mentionner tous les services courants -qui utilisent UDP tels que snmp, tftp, NFS, etc. -.Sp -Malheureusement l'analyse UDP peut Йtre particuliХrement longue puisque la plupart -des hТtes implИmente une suggestion de la RFC 1812 (section -4.3.2.8) pour limiter le dИbit des messages d'erreurs ICMP. Par exemple, -le noyau Linux (dans net/ipv4/icmp.h) limite la gИnИration de -message ╚\ destination unreachable\ ╩ Ю 80 pour 4 secondes, avec -une pИnalitИ de 1/4 secondes si ce nombre est dИpassИ. -Solaris a des limites encore plus strictes (Ю peu prХs 2 messages par -seconde) et l'analyse nИcessite encore plus de temps. -.I Nmap -dИtecte cette limite de dИbit et ralentit plutТt que d'inonder inutilement -le rИseau avec des paquets qui seront ignorИs par la machine cible. -.Sp -Comme d'habitude, Microsoft a ignorИ la suggestion RFC -et n'a pas implИmentИ de limitation de taux dans les machines -Win95 et NT. C'est pourquoi nous pouvons analyser -les 65K ports d'une machine Windows -.B trХs -rapidement. Wahoo ! -.TP -.B \-sO -IP protocol scans\ : Cette mИthode est utilisИe -pour dИterminer les protocoles IP supportИs par l'hТte. -La technique consiste Ю envoyer des paquets IP bruts sans entЙte de protocole -Ю chaque protocole spИcifiИ sur la machine cible. -Si nous recevons un message ICMP ╚\ protocol unreachable\ ╩, -alors le protocole n'est pas utilisИ. Autrement nous supposons qu'il est -ouvert. Remarquez que certains hТtes (AIX, HP-UX, Digital UNIX) -et les pare-feux peuvent ne pas renvoyer les -messages ╚\ protocol unreachable\ ╩, faisant apparaНtre ouverts -tous les protocoles. -.Sp -Comme cette technique est trХs similaire Ю l'analyse des ports UDP, la -limitation du dИbit ICMP peut aussi apparaНtre. -Mais comme le champ protocole d'IP n'a que 8 bits, il y a au plus 256 -protocoles, donc la durИe restera raisonnable. -.TP -.B \-sI -scan paresseux : cette mИthode de scan avancИe autorise un scan TCP -vИritablement aveugle de la cible (aucun paquet ne sera envoyИ Ю la cible -depuis votre vИritable adresse IP). ю la place, une attaque unilatИrale -exploite la prИdiction de la sИquence d'identificateur de fragmentation IP -de l'hТte zombie pour glaner des informations sur les ports ouverts de la cible. -Les systХmes de dИtections d'intrusion indiqueront que le scan provient de la -machine zombie spИcifiИe (qui doit Йtre active et vИrifier un certain nombre de -critХres). J'envisage de donner plus d'explication Ю http://www.insecure.org/nmap/nmap_documentation.html -dans un futur proche. -.TP -.Sp -En plus d'Йtre extraordinairement furtive (grБce Ю sa nature aveugle), ce scan -permet de s'affranchir des relations de confiance entre machines -fondИes sur l'IP. La liste de ports montre les ports ouverts -.I tels que les voit l'hТte zombie. -Aussi, vous pouvez essayer de scanner une cible en utilisant diffИrents zombies -Ю qui elle fait confiance (via les rХgles de filtrage des routeurs/paquets). -иvidemment cette information est cruciale pour orienter l'attaque. Autrement -votre test de pИnИtration va consommer des ressources considИrables -appartenant au systХme intermИdiaire, pour s'apercevoir en fin de compte -qu'il n'y a pas de relation de confiance entre l'hТte cible -et l'IP de la machine zombie. -.Sp -Vous pouvez ajouter un deux-point suivi par le numИro de port si vous -voulez tester un port particulier sur l'hТte zombie pour les changement IPID. -Autrement Nmap utilisera le port qu'il utilise par dИfaut pour les pings TCP. -.TP -.B \-sA -ACK scan\ : C'est une technique avancИe qui est utilisИ pour dИcouvrir -les rХgles des pare-feux et pour savoir si on a affaire Ю un pare-feu ou un simple -filtreur de paquets qui bloquent les paquets SYN entrant. -.Sp -Ce type d'analyse envoie un paquet ACK (avec un numИro -d'acquittement/sИquence alИatoire) aux ports spИcifiИs. -Si un RST vient en retour, les ports sont classИs comme -non filtrИs. Si rien ne revient (ou alors un message ICMP -╚\ unreachable\ ╩), les ports sont classИs comme filtrИs . Remarquez -que -.I nmap -n'affiche pas les ports non filtrИs. -Aussi, si -.B aucun -port n'est affichИ dans la sortie, c'est souvent un signe que tous -les tests ont fonctionnИ (et retournИ RSTs). Ce scan ne montrera Иvidement -jamais de port ouvert. -.TP -.B \-sW -Window scan\ : C'est une analyse avancИe trХs similaire au -ACK scan, sauf qu'il peut parfois dИtecter aussi bien des -ports ouverts que filtrИs/non filtrИs grБce Ю une anomalie -dans la taille de la fenЙtre TCP rapportИe par certains systХmes. -Parmi les systХmes vulnИrables se trouvent certaines versions de -AIX, Amiga, BeOS, BSDI, Cray, Tru64 UNIX, DG/UX, OpenVMS, Digital -UNIX, FreeBSD, HP-UX, OS/2, IRIX, MacOS, NetBSD, OpenBSD, -OpenStep, QNX, Rhapsody, SunOS 4.X, Ultrix, VAX, et -VxWorks. Voir les archives de la liste de diffusion nmap-hackers pour une liste -exhaustive. -.TP -.B \-sR -RPC scan. Cette mИthode fonctionne en combinaison -avec diverses mИthodes d'analyse de port de nmap. -Il prend tous les ports TCP/UDP ouverts et les inonde de -commandes SunRPC NULL pour dИterminer ceux qui sont -des ports RPC, et si c'est le cas, le programme et son numИro de version -qui les servent. -Vous pouvez obtenir la mЙme information -que 'rpcinfo -p' mЙme si le portmapper cible est derriХre un -pare-feu (ou protИgИ par un wrapper TCP). Les leurres ne fonctionnent pour le -moment pas avec les scans RCP, et je dois ajouter le support pour les leurres -dans les scans UPD RCP. -.TP -.B \-sL -scan-liste. Cette mИthode gИnХre une liste d'IP/nom sans les pinger ou les -scanner. La rИsolution de nom DNS sera rИalisИe sauf si vous utilisez -n. -.TP -.B \-b -attaque par rebond FTP\ : Une caractИristique intИressante du -protocole ftp (RFC 959) est le support des connexions \fBproxy\fR. -En d'autres termes, je dois Йtre capable de me connecter depuis -mechant.com au serveur FTP de cible.com et demander que le serveur envoie -un fichier N'IMPORTE Oы sur Internet. гa fonctionnait bien -en 1985 quand la RFC a ИtИ Иcrite. Mais dans l'Internet d'aujourd'hui -nous ne pouvons pas nous permettre d'avoir des pirates qui dИtournent -des serveurs ftp et envoient des donnИes n'importe oЫ dans Internet. -J'avais Иcrit en 1995 que ce dИfaut du protocole ╚\ peut Йtre utilisИ pour -envoyer des courriers et nouvelles intracables, -matraquer des serveurs de sites, saturer les disques, -essayer de contourner les pare-feux et gИnИralement Йtre difficile Ю repИrer\ ╩. -On peut aussi l'exploiter pour faire un scan -des ports TCP depuis un serveur ftp ╚\ proxy\ ╩. Ainsi, vous pouvez vous -connecter Ю un serveur ftp derriХre un pare-feu et scanner les ports -sans Йtre bloquИ (139 est un bon nombre). Si le serveur ftp -autorise la lecture et l'Иcriture dans certains rИpertoires -(tel que /incoming), vous pouvez envoyez des donnИes arbitraires -aux ports que vous avez trouvИ ouvert (nmap ne le fera toutefois pas pour vous) -.Sp -L'argument passИ Ю l'option \fB-b\fR est l'hТte que vous voulez utiliser comme -proxy, dans la notation URL standard. Le format est\ : -.I username:password@server:port. -Tout sauf -.I server -est optionnel. Pour dИterminer les serveurs qui sont -vulnИrables Ю cette attaque, vous pouvez voir mon article dans -.I Phrack -51. Une version mise Ю jour est disponible Ю l'URL -http://www.insecure.org/nmap. -.TP -.B OPTIONS GиNиRALES -Aucune n'est nИcessaire, mais certaines peuvent Йtre trХs utiles. -.TP -.B \-P0 -Ne pas essayer de ping sur les hТtes avant de les analyser. -Cela permet l'analyse des rИseaux qui ne permettent pas les requЙtes -ou les rИponses ICMP Ю travers leurs pare-feux. -Microsoft.com en est un exemple, et vous devez -toujours utiliser -.B \-P0 -ou -.B \-PT80 -pour faire une analyse de port sur microsoft.com. -.TP -.B \-PT -Utilise TCP "ping" pour dИterminer les hТtes actifs. Au lieu -d'envoyer une requЙte d'Иcho ICMP et d'attendre une rИponse, nous -envoyons des paquets TCP ACK dans le rИseau cible -(ou contre une machine) et attendons des rИponses pour conclure. -Les hТtes devraient rИpondre par un -RST. Cette option prИserve l'efficacitИ des scan -des hТtes qui sont actifs mais autorise l'analyse des -hТtes/rИseaux qui bloquent les paquets de ping. -Pour les utilisateurs non root, -nous utilisons connect(). Pour spИcifier le port de destination -du test utilisez -PT. Le port par dИfaut est -80, car ce port n'est pas souvent filtrИ. -.TP -.B \-PS -Cette option utilise des paquets SYN (demande de connexion) Ю la place -des paquets ACK pour les utilisateurs ROOT. Les hТtes actifs devrait rИpondre -par un RST (ou, rarement par un SYN | ACK). -.TP -.B \-PI -Cette option utilise un vИritable paquet ping (requЙte d'Иcho ICMP). -Il recherche les hТtes actifs et aussi regarde les adresses -de diffusion des sous-rИseaux. Il y a des adresses IP -qui sont joignable de l'extИrieur et qui sont traduites -en une diffusion de paquet entrant dans un rИseau. -гa devrait Йtre supprimИ, si dИcouvert, car Гa permet un grand nombre -d'attaques de dИni de service. -.TP -.B \-PP -utilise un paquet ICMP de requЙte d'estampille temporelle (code 13) pour -dИterminer les hТtes qui Иcoutent. -.TP -.B \-PM -Fait la mЙme chose que -.B \-PI -et -.B \-PP -sauf qu'il utilise une requЙte de masque de sous-rИseau (ICMP code 17). -.TP -.B \-PB -C'est le ping par dИfaut. Il utilise les balayages ACK ( -.B \-PT -) et ICMP ( -.B \-PI -) en parallХle. De cette maniХre, vous pouvez passer les pare-feux qui ne filtrent -que l'un des deux types de paquets. -.TP -.B \-O -Cette option active l'identification de l'hТte distant via l'empreinte -TCP/IP. Autrement dit, nmap utilise un ensemble de techniques -pour dИtecter les subtilitИs dans la pile rИseau du systХme d'exploitation -de l'ordinateur que vous Йtes en train d'analyser. Il utilise ces informations -pour crИer une ╚\ empreinte\ ╩ qui est comparИe avec sa base de donnИes -d'empreintes connues (le fichier nmap-os-fingerprints) pour retrouver le type -de systХme que vous Йtes en train d'analyser. -.Sp -Si Nmap est incapable de deviner le systХme d'exploitation de la machine, -et que les conditions sont bonnes (par exemple, au moins un port est ouvert) -Nmap fournira une URL que vous pourrez utiliser pour soumettre si vous -connaissez avec certitude le nom du systХme d'exploitation Ю qui appartient -cette nouvelle empreinte. -Vous contribuerez ainsi Ю augmenter le nombre de systХmes d'exploitations -dИtectable par nmap et la la prИcision de la dИtection. Si vous laissez -une adresse IP dans le formulaire, la machine pourra Йtre analysИe lorsque -nous ajouterons l'empreinte (pour valider que Гa marche). -.Sp -L'option \-O active aussi plusieurs autres tests. L'un d'entre eux est la mesure -de ╚\ uptime\ ╩ (durИe ИcoulИe depuis le dernier redИmarrage du systХme), qui utilise l'estampille TCP (RFC 1323) pour deviner la date du -dernier redИmarrage de la machine. Ceci n'est rapportИ que pour les machines -qui fournissent cette information. -.Sp -Un autre test activИ par \-O est la classification de la prИdiction -de la sИquence TCP. C'est une mesure qui dИcrit approximativement la difficultИ -d'Иtablir une connexion TCP forgИe contre l'hТte distant. C'est utile -pour exploiter les relations de confiances fondИes sur l'IP source -(rlogin, firewall filters, etc) ou pour cacher la source d'une attaque. -La valeur rИelle de la difficultИ est calculИe sur un Иchantillon et peut -fluctuer. Il est gИnИralement plus appropriИ d'utiliser une classification -par nom tel que ╚\ worthy challenge\ ╩ ou ╚\ trivial joke\ ╩. Ceci n'est -rapportИ dans la sortie normale qu'avec l'option -v. -.Sp -Si le mode verbeux (\-v) est activИ en mЙme temps que \-O, -la gИnИration de sИquence IPID est aussi rapportИe. -La plupart des machines appartiennent Ю la classe incrИmentale, -ce qui signifie qu'elle incrИmente le champ ID dans l'entЙte -IP pour chaque paquet envoyИ. Ce qui les rend vulnИrables -Ю la collecte d'information avancИe et aux attaques par -usurpation. -.TP -.B \-I -Active l'analyse TCP reverse ident. Dave Goldsmith -dans un message Ю Bugtraq en 1996, a fait remarquer que le protocole -ident (rfc 1413) autorise la dИcouverte du nom d'utilisateur qui -possХde un processus connectИ via TCP, mЙme si le processus n'est pas Ю -l'instigateur de la connexion. Vous pouvez ainsi vous connecter au port -http et utiliser identd pour dИcouvrir si le serveur tourne sous root. -Ceci ne peut Йtre fait qu'avec une connexion TCP complХte sur le port cible -(i.e. l'option d'analyse -sT). Quand -.B \-I -est utilisИ, l'identd de l'hТte distant est interrogИ pour chaque port -ouvert trouvИ. иvidemment Гa ne fonctionne pas si l'hТte n'utilise pas identd. -.TP -.B \-f -Cette option oblige les analyses FIN, XMAS, ou NULL -Ю utiliser de petit paquets IP fragmentИs. L'idИe est de partager -l'entЙte TCP en plusieurs paquets pour rendre leurs dИtections plus difficile -par les filtres et les systХmes de dИtection d'intrusion, et les autres -enquiquineurs qui tentent de dИtecter ce que vous Йtes en train de faire. -Faites attention avec ceci, certains programmes ont des difficultИs avec ces -petits paquets. Mon sniffer favori plante immИdiatement lorsqu'il reГoit le -premier fragment de 36 octets. -Cette option est inefficace contre les filtreurs de paquets et les pare-feux -qui rИassemblent les fragments IP -(comme l'option CONFIG_IP_ALWAYS_DEFRAG dans le noyau Linux), -certains rИseaux ne peuvent pas supporter cette perte de performance -et ne rИassemblent pas les paquets. -.Sp -Remarquez que je n'ai pas encore fait fonctionner cette option sur tous les -systХmes. гa marche parfaitement sur les machines Linux, FreeBSD et OpenBSD -et certaines personnes m'ont rapportИ leurs succХs avec d'autres saveurs -d'Unix. -.TP -.B \-v -Mode verbeux. C'est une option hautement recommandИe qui fournit beaucoup -d'informations sur ce que vous Йtes en train de faire. Vous pouvez l'utiliser -deux fois pour un effet plus important. Utiliser -.B \-d -une paire de fois si vous voulez vraiment devenir fou avec le dИfilement de -l'Иcran\ ! -.TP -.B \-h -Cette option affiche un bref rИcapitulatif des options de nmap. -Comme vous l'avez sans doute remarquИ, cette page de manuel n'est pas vraiment -un ╚\ bref rИcapitulatif\ ╩. :) -.TP -.B \-oN -Enregistre les rИsultats de vos analyses dans un -format -.B lisible par un humain -dans le fichier spИcifiИ en argument. -.TP -.B \-oX -Enregistre le rИsultat de vos analyses dans un format -.B XML -dans le fichier spИcifiИ en argument. Ceci permet Ю des programmes -d'interprИter facilement les rИsultats de nmap. -Vous pouvez donner l'argument '\fB-\fR' (sans les guillemets) pour envoyer la sortie sur la sortie standard -(pour les pipelines shells, etc). -Dans ce cas la sortie normale sera supprimИe. -Regardez attentivement les messages d'erreurs si vous utilisez ceci (ils sont -encore envoyИs sur la sortie d'erreur standard). -Notez aussi que \fB-v\fR peut afficher des informations supplИmentaires. -La dИfinition de type de document (DTD) dИfinissant la structure de la sortie -XML est disponible Ю http://www.insecure.org/nmap/data/nmap.dtd . -.TP -.B \-oG -Enregistre les rИsultats de vos analyses dans une forme adaptИe pour -.B grep. -Ce format simple fournit toutes les informations sur une ligne. C'est le -mИcanisme prИfИrИ des programmes qui interagissent avec nmap, mais dИsormais nous -recommandons plutТt la sortie XML (-oX). Ce format simple ne contient pas autant d'informations -que les autres formats. Vous pouvez donner l'argument ╚\fB-\fR╩ (sans les guillemets) pour envoyer la sortie sur la sortie standard -(pour les pipelines shells, etc). -Dans ce cas la sortie normale sera supprimИe. -Regardez attentivement les messages d'erreurs si vous utilisez ceci (ils sont -encore envoyИs sur la sortie d'erreur standard). -Notez aussi que \fB-v\fR peut afficher des informations supplИmentaires. -.TP -.B \-oA -indique Ю nmap d'enregistrer dans tous les formats majeurs (normal, grep et -XML). Vous fournissez le prИfixe du nom de fichier et les sorties auront -respectivement les suffixes .nmap, .gnmap et .xml . -.TP -.B \-oS -enregistre les rИsultats de vos analyses en format -.B script kiddie -(NdT\ : C'est un langage dans lequel certaines lettres sont remplacИes par des chiffres/symboles -typiquement exemple A devient 4, E devient 3, etc. Cette langue est utilisИe par -les ╚\ cowboyz\ ╩ d'Internet. -Cette population folklorique amuse beaucoup les autres internautes, au point qu'il existe une option pour eux dans nmap) -V0u$ poUV3z dOnn3r l'4rgUm3nt '\fB-\fR' (s4ns l3$ guIll3m3ts) poUr 3nvoy3r l4 sOrti3 sUr l4 $orti3 $t4nd4rd. -.TP -.B \--resume -L'analyse d'un rИseau qui a ИtИ annulИe par un Ctrl-C, problХme de rИseau, etc. -peut Йtre reprise en utilisant cette option. -logfilename doit Йtre soit un log normal (-oN) soit -un log lisible par une machine (-oM) d'une analyse avortИe. -Aucune autre option ne peut Йtre donnИe (ce sont obligatoirement les mЙmes que -celles du scan avortИ). -Nmap dИmarrera sur la machine aprХs la derniХre machine qui a ИtИ analysИe avec succХs dans le -fichier de log. -.TP -.B \--append_output -indique Ю Nmap d'Иcrire Ю la fin des fichiers de sortie au lieu de les Иcraser. -.TP -.B \-iL -Lit les spИcifications de la cible depuis le fichier spИcifiИ -plutТt que depuis la ligne de commande. Le fichier doit contenir une liste -d'hТtes, d'expressions de rИseaux sИparИes par des espaces, tabulations ou retour chariots. -Utilisez le tiret -pour lire depuis stdin (comme la fin d'un pipe). -Voyez la section \fIspИcification de cible\fR -pour plus d'information sur les expressions que vous pouvez mettre dans le fichier. -.TP -.B \-iR -Cette option indique Ю Nmap de gИnИrer ses propres hТtes -Ю analyser par tirage alИatoire :). гa ne finit jamais. -гa peut Йtre utile pour un Иchantillon d'Internet pour estimer diverses choses. -Si vous vous ennuyez, essayez -.I nmap \-sS \-iR \-p 80 -pour rechercher des serveurs web Ю regarder. -.TP -.B \-p -Cette option spИcifie les ports que vous voulez essayer. -Par exemple '-p 23' n'essayera que le port 23 of de l'hТte -cible. '\-p 20-30,139,60000-' analysera les ports entre 20 et 30, le port -139, et tous les ports supИrieurs Ю 60000. Le comportement par dИfaut est d'analyser tous -les ports de 1 Ю 1024 ainsi que tous les ports listИs dans les fichiers de services fournis avec nmap. -Pour l'analyse par IP (-sO), ceci spИcifie le numИro de protocole que vous voulez analyser -.Sp -Lorsque vous scannez les ports TCP et UPD vous pouvez spИcifier un protocole -particulier en prИfixant les numИros de ports par ╚\ T\ ╩: ou ╚\ U:\ ╩. -L'effet du spИcificateur dure jusqu'Ю ce que vous en spИcifiez un autre. -Par exemple, l'argument ╚\ -p U:53,111,137,T:21-25,80,139,8080\ ╩ -scannera les ports UDP 53, 111 et 137 ainsi que les ports TCP mentionnИs. -Remarquez que pour scanner UDP et TCP, vous devez spИcifier -sU et au moins une -analyse TCP (telle que -sS, -sF ou -sT). Si aucune spИcification de -protocole n'est indiquИe, les numИros de ports sont ajoutИs Ю tous les -protocoles. -.TP -.B \-F Fast scan mode. -SpИcifie que vous ne voulez analyser que les ports listИs -dans le fichier des services livrИ avec nmap (ou le fichier des protocoles pour --sO). -C'est Иvidemment plus rapide que d'analyser les 65535 ports d'un hТte. -.TP -.B \-D -rИalise un scan avec leurres. Du point de vue de l'hТte distant, les hТtes -leurres apparaНtront comme s'ils analysaient aussi le rИseau cible. Ainsi, -les systХmes de dИtection d'intrusion ne pourront pas savoir parmi l'ensemble -des IP qui semblent les scanner quelle est l'IP qui effectue rИellement -l'analyse et quelles IP ne sont en rИalitИ que d'innocent leurres. -Bien que ceci puisse Йtre contrИ par -path tracing, response-dropping, et d'autres mИcanismes actifs, -c'est gИnИralement une technique efficace pour dissimuler son adresse IP. -.Sp -SИparez chaque hТte-leurre par des virgules, et vous pouvez optionnellement -utiliser '\fBME\fR' (Moi) comme l'un des leurres pour reprИsenter -la position que vous voulez utiliser pour votre adresse. -Si vous utilisez '\fBME\fR' au delЮ de la 6Хme position, la plupart des dИtecteurs de scan -(mЙme l'excellent scanlogd de Solar Designer) seront incapables de voir votre adresse IP. -Si vous n'utilisez pas '\fBME\fR', nmap choisira une position alИatoire. -.Sp -Remarquez que les hТtes leurres doivent Йtre actifs -ou vous risquez accidentellement de faire une inondation SYN sur vos cibles. -Il est aussi presque facile de dИterminer qui est en train de scanner si seul une -seule machine est active sur le rИseau. Vous pouvez vouloir utiliser des adresses IP -Ю la place des noms (ainsi les rИseaux leurres ne vous verront pas dans les logs du serveurs de nom). -.Sp -Remarquez Иgalement que quelques dИtecteurs (stupides) de scan bloqueront -les hТtes qui tentent des scans de ports. Aussi vous pouvez par inadvertance -bloquer l'accХs des machines leurres Ю la machine cible. -Ceci peut provoquer de grave problХmes aux machines cibles si le leurre s'avХre Йtre -sa passerelle internet ou mЙme ╚\ localhost\ ╩. Il faut donc utiliser prudemment cette option. -La vraie morale de cette histoire est que les dИtecteurs de scan ne doivent pas prendre de -mesures contre les machines qui semblent les analyser, car il se peut que ce soit des leurres\ ! -.Sp -Les leurres sont utilisИs pour le scan initial (en utilisant ICMP, -SYN, ACK, ou autre chose) et pendant la vИritable phase de scan. Les leurres sont aussi -utilisИs pendant la dИtection de l'hТte distant ( -.B \-O -). -.Sp -Il ne faut pas oublier que d'utiliser un trop grand nombre de leurres -peut ralentir -le scan et mЙme le rendre imprИcis. De plus certains -fournisseurs d'accХs Ю Internet (FAI) filtreront vos paquets usurpИs, bien que la plupart -n'applique aucune restriction sur les paquets usurpИs. -.TP -.B \-S -Dans certaines circonstances, -.I nmap -est incapable de dИterminer l'adresse source. -.I Nmap -vous avertira si c'est le cas). Dans cette situation, utilisez -\-S avec votre adresse IP (ou l'interface depuis laquelle vous voulez envoyer les paquets). -.Sp -Une autre utilisation possible de ce drapeau est d'usurper le scan pour faire croire -aux cibles que -.B quelqu'un d'autre les scanne. -Imaginez une entreprise qui se croit rИguliХrement scannИe par un concurrent\ ! -Ce n'est pas l'utilisation premiХre ni le but principal de ce drapeau. -Je pense que c'est juste une possibilitИ intИressante pour les personnes qui sont au courant -avant qu'elles n'en accusent d'autres de les scanner. -.B \-e -est gИnИralement requis pour ce type d'utilisation. -.TP -.B \-e -indique l'interface rИseau Ю utiliser pour envoyer et recevoir les paquets. -\fBNmap\fR devrait Йtre capable de dИtecter ceci mais il vous prИviendra s'il n'y parvient pas. -.TP -.B \-g -SpИcifie le numИro de port source dans le scan. -Beaucoup de pare-feux et de filtreur de paquets naОfs -feront une exception dans leurs rХgles pour autoriser le passage des paquets -DNS (53) ou FTP-DATA (20) pour Иtablir une connexion. -иvidemment Гa rИduit complХtement les avantages de sИcuritИ d'un pare-feu -puisque les intrus n'ont qu'Ю se dИguiser en FTP ou DNS en modifiant leur -port source. иvidemment pour un scan UDP vous devriez utiliser -53 en premier et pour les scans TCP vous devriez utiliser -20 avant 53. -Remarquer que ce n'est qu'une requЙte -- nmap ne le fera que s'il y parvient. -Par exemple, vous ne pouvez pas faire des analyse en parallХle avec un seul port. -Aussi \fBnmap\fR changera le port source mЙme si vous utilisez \fB-g\fR. -.Sp -Sachez qu'il y a une petite pИnalitИ de performance sur certains scans si vous utilisez -cette option, parce que j'enregistre parfois des informations utiles dans le numИro de port -source. -.TP -.B \--data_length -Normalement nmap envoie des paquets minimalistes qui ne contiennent que l'en-tЙte. -Ainsi, les paquets TCP font 40 octets et les requЙtes d'Иcho ICMP, 28 octets. -Cette option indique Ю Nmap d'ajouter le nombre spИcifiИ d'octets initialisИs Ю 0 -Ю la plupart des paquets qu'il envoie. La dИtection de systХme d'exploitation -(-O) n'est pas affectИe, mais la plupart des paquets de ping et de scan de port -le sont. гa ralentit les choses, mais Гa peut Йtre un peu moins voyant. -.TP -.B \-n -Dit Ю Nmap de ne -.B JAMAIS -faire de rИsolution DNS inverse sur une adresse IP active. Comme DNS est -souvent lent, -Гa peut aider Ю accИlИrer les choses. -.TP -.B \-R -Dit Ю Nmap de -.B TOUJOURS -faire la rИsolution DNS inverse des adresses IP cibles. Normalement -ceci n'est fait que pour les machines vivantes. -.TP -.B \-r -Dit Ю Nmap -.B DE NE PAS -changer alИatoirement l'ordre dans lequel les ports seront analysИs. -.TP -.B \-\-randomize_hosts -Dit Ю nmap de mИlanger chaque groupe comprenant jusqu'Ю 2048 hТtes avant de les analyser. -Ceci rend les scans moins Иvidents Ю de nombreux systХmes de surveillance rИseau, -particuliХrement quand vous le combinez avec des options -pour ralentir le timing (voir ci-dessous). -.TP -.B \-M -SpИcifie le nombre maximum de sockets qui seront utilisИs en parallХle -pour le scan TCP connect() (celui par dИfaut). C'est utile pour -ralentir lИgХrement le scan et Иviter de crasher les machines cibles. Une autre -approche consiste Ю utiliser \fB-sS\fR, qui est gИnИralement plus facile Ю gИrer -pour les machines. -.TP -.B OPTIONS TIMING -gИnИralement nmap parvient Ю s'ajuster correctement -aux caractИristiques du rИseau et Ю analyser aussi vite que possible -tout en minimisant la probabilitИ d'Йtre dИtectИ. -Cependant, il y a des cas oЫ les timings par dИfaut -de Nmap ne correspondent pas Ю vos objectifs. Les options suivantes -permettent un contrТle fin des timings\ : -.TP -.B -T -Ce sont les diffИrentes politiques de timing pour communiquer de -maniХre pratique vos prioritИs Ю nmap. - -.B Paranoid -analyse -.B trХs lentement -dans l'espoir d'Иviter d'Йtre repИrИ par les systХme de dИtection d'intrusion. -Il sИrialise tous les scans (pas de scan parallХle) et attend au moins -5 minutes entre les envois de paquets. - -.B Sneaky -c'est la mЙme chose, sauf qu'il attend 15 secondes entre les envois de paquets. - -.B Polite -essaye de minimiser la charge sur le rИseau et de rИduire la probabilitИ de -crasher des machines. Il sИrialises les test et attend -.B au moins -0,4 secondes entre chaque. - -.B Normal -c'est le comportement par dИfaut de Nmap, qui essaye de s'exИcuter aussi -vite que possible sans surcharger le rИseau ou oublier des -hТtes/ports. - -.B Aggressive -ajoute un dИcompte de 5 minutes par hТte et n'attends jamais les rИponses -individuelles plus de 1.25 secondes. - -.B Insane -ne convient qu'aux rИseaux ultra-rapides oЫ vous ne risquez par de perdre -d'informations. Il ajoute un dИcompte de 75 -secondes et n'attend les rИponses individuelles que pendant -0,3 secondes. Il permet de balayer trХs rapidement les rИseaux. -Vous pouvez aussi rИfИrencer ces modes par numИro (0-5). -Par exemple, '-T 0' donne le mode Paranoid et '-T 5' le mode Insane. -.Sp -Ces modes timings NE devrait PAS Йtre utiliser en combinaison avec les contrТles -de bas niveau donnИs ci-dessous. -.TP -.B --host_timeout -SpИcifie la durИe que \fBnmap\fR est autorisИe Ю consacrer -Ю l'analyse d'un hТte unique avant d'abandonner cette IP. -Par dИfaut il n'y a pas de temps limite pour un hТte. -.TP -.B --max_rtt_timeout -SpИcifie la durИe maximale que \fBnmap\fR peut laisser s'Иcouler en attendant -une rИponse Ю ses tests avant de retransmettre ou de laisser tomber. -La valeur par dИfaut est 9\ 000. -.TP -.B --min_rtt_timeout -Quand les hТtes cibles commencent Ю Иtablir un modХle de rИponse trХs -rapidement, \fBnmap\fR diminuera la durИe accordИe par test. -Ceci augmente la vitesse du scan, mais peut conduire Ю la perte de paquets -quand une rИponse prend plus de temps que d'habitude. -Avec ce paramХtre vous pouvez garantir que \fBnmap\fR attende au moins -une certaine durИe avant de laisser tomber un test. -.TP -.B --initial_rtt_timeout -SpИcifie le dИcompte du test initial. Ce n'est gИnИralement utile -que lors de l'analyse d'hТte derriХre un pare-feu avec -P0. -Normalement \fBnmap\fR obtient de bonnes estimations Ю partir -du ping et des premiers tests. Le mode par dИfaut est 6\ 000. -.TP -.B --max_parallelism -SpИcifie le nombre maximum de scans que \fBnmap\fR est autorisИ Ю mener en parallХle. -Positionner ceci Ю 1 signifie que \fBnmap\fR n'essayera jamais de -scanner plus d'un port Ю la fois. Ce nombre affecte aussi les autres scans -parallХle comme le balayage de ping, RPC scan, etc. -.TP -.B --scan_delay -SpИcifie la durИe -.B minimum -que \fBnmap\fR doit laisser s'Иcouler entre ses envois. C'est utile pour rИduire la -charge du rИseau ou pour ralentir le dИbit du scan afin de ne pas atteindre -le seuil de dИclenchement des systХmes de dИtection d'intrusion. - -.SH SPиCIFICATION DE CIBLE -Tout ce qui n'est pas une option ou un argument d'option -est traitИ par nmap comme une spИcification d'hТte. -Le cas le plus simple et une liste de nom d'hТtes ou d'adresse IP sur la ligne -de commande. -Si vous voulez analyser un sous rИseau d'adresses IP vous pouvez ajouter -.B '/mask' -au nom d'hТtes -.B mask -doit Йtre compris entre 0 (scanner tout internet) et 32 (scanner un seul -hТte). Utiliser /24 pour analyser des adresses de classe 'C' -et /16 pour la classe 'B'. -.Sp -\fBNmap\fR utilise une notation puissante pour spИcifier une adresse IP -en utilisant des listes/intervalles pour chaque ИlИment. -Ainsi vous pouvez analyser tout un rИseau de classe B -192.168.*.* en spИcifiant '192.168.*.*' ou '192.168.0-255.0-255' ou -mЙme '192.168.1-50,51-255.1,2,3,4,5-255'. Et bien sШr, vous pouvez utiliser -la notation mask : '192.168.0.0/16'. Elles sont toutes Иquivalentes -Si vous utilisez des astИrisques ('*'), souvenez-vous que la plupart des -shells nИcessitent que vous les prИcИdiez par des anti-slash ou que vous les -protИgiez par des guillemets. -.Sp -Une autre chose intИressante Ю faire et de dИcouper Internet\ : -au lieu de scanner les hТtes dans une classe 'B', -scanner '*.*.5.6-7' pour analyser toutes les adresses IP se terminant -par .5.6 ou .5.7. Pour plus d'informations sur la spИcification -des hТtes Ю analyser, voyez la section -.I exemples. -.SH EXEMPLES -Voici quelques exemples d'utilisation de \fBnmap\fR du plus simple au plus compliquИ. -Remarquez que les noms et adresses sont utilisИes pour rendre les choses -plus concrХtes. ю leur place vous devriez substituer les noms et adresses -de -.B votre propre rИseau. -Je ne pense pas que l'analyse de ports d'autres rИseaux soit illИgale, ni -que l'analyse de ports doit Йtre considИrИe par les autres comme une attaque. -J'ai analysИ des centaines de milliers de machines et je n'ai reГu -qu'une seule plainte. Mais je ne suis pas juriste et certaines personnes pourraient -Йtre ennuyИes par les tests de -.I nmap. -Aussi demandez prИalablement la permission ou utilisez \fBnmap\fR -Ю vos risques et pИrils. -.Sp -.B nmap -v cible.exemple.com -.Sp -Cette option analyse tous les ports TCP rИservИs sur la machine -cible.exemple.com . Le \-v signifie d'activer le mode verbeux. -.Sp -.B nmap -sS -O cible.exemple.com/24 -.Sp -Envoie un scan SYN furtif contre chaque machine active parmi -les 255 machines de classe 'C' qui sont sur cible.exemple.com. -Il essaye aussi de dИterminer quel systХme d'exploitation fonctionne sur -chaque hТte. Ceci nИcessite les privilХges root en raison du scan SYN et -de la dИtection de systХme d'exploitation. -.Sp -.B nmap -sX -p 22,53,110,143,4564 "198.116.*.1-127" -.Sp -Envoie un scan Xmas tree Ю la premiХre moitiИ -de chacun des 255 sous-rИseaux de l'espace d'adresse de classe B -198.116. Nous sommes en train de tester si les systХmes font fonctionner sshd, -DNS, pop3d, imapd, ou port 4564. Remarquez que les scan Xmas -ne fonctionnent pas contre les machines Microsoft en raison de leur pile TCP -dИficiente. Le mЙme problХme se produit aussi avec les machines -CISCO, IRIX, HP/UX, et BSDI. -.Sp -.B nmap -v --randomize_hosts -p 80 '*.*.2.3-5' -.Sp -PlutТt que de se concentrer sur une plage spИcifique d'IP, -il est parfois intИressant de dИcouper l'ensemble d'Internet et -d'analyser un petit Иchantillon de chaque tranche. Cette commande -trouve tous les serveurs web sur des machines dont l'adresse IP -se termine par .2.3, .2.4 ou .2.5 . -Si vous Йtes root, vous pouvez aussi ajouter \fB-sS\fR. -Vous trouverez plus de machine intИressantes en commenГant Ю 127, aussi -vous utiliserez '127-222' Ю la place de la premiХre astИrisque -car cette section possХde une plus grande densitИ de machine intИressantes. -.Sp -.B host -l company.com | cut '-d ' -f 4 | ./nmap -v -iL - -.Sp -Fait un transfert DNS pour dИcouvrir les hТtes de company.com -et utiliser leurs adresses IP pour alimenter -\fInmap\fR. -Les commandes ci-dessus sont pour mon ordinateur GNU/Linux. -Vous pouvez avoir besoin d'autres commandes/options pour d'autres systХmes d'exploitations. -.SH BOGUES -Bogues\ ? Quels bogues\ ? Envoyez-moi tout ce que vous trouverez. -Les patchs sont les bienvenus. Souvenez-vous -que vous pouvez aussi envoyer les empreintes de nouveaux systХmes -d'exploitation pour enrichir la base de donnИes. -Si une empreinte appropriИe est trouvИe, Nmap -affichera l'URL Ю laquelle vous pourrez l'envoyer. -.SH AUTEUR -.Sp -Fyodor -.I -.SH DISTRIBUTION -La derniХre version de -.I nmap -peut Йtre obtenu depuis -.I http://www.insecure.org/nmap/ -.Sp -.I nmap -est (C) 1995-2001 par Insecure.Com LLC -.Sp -.I libpcap -est aussi distribuИe avec nmap. Il est copyrightИ par -Van Jacobson, Craig Leres et Steven McCanne, tous du -Lawrence Berkeley National Laboratory, University of -California, Berkeley, CA. La version distribuИe avec nmap -peut Йtre modifiИe, les sources d'origine sont disponibles -Ю ftp://ftp.ee.lbl.gov/libpcap.tar.Z . -.Sp -Ce programme est un logiciel libre, vous pouvez -le redistribuer et/ou le modifier sous les termes de la -GNU General Public License telle que publiИe par -par la Free Software Foundation\ ; -Version 2. Ceci garantit votre droit d'utiliser, modifier -et redistribuer Nmap sous certaines conditions. -Si cette licence est inacceptable pour vous, Insecure.Org -pourrait Иventuellement vendre d'autres licences. -(contacter \fBfyodor@dhp.com\fR). -.Sp -Les sources sont fournies avec ce logiciel -car nous croyons que les utilisateurs ont le droit de savoir exactement ce que -fait un programme avant de le lancer. Ceci vous permet aussi d'auditer le -logiciel pour rechercher des trous de sИcuritИ -(aucun n'a ИtИ trouvИ jusqu'Ю prИsent). -.Sp -Le code source vous permet aussi de porter Nmap vers de nouvelles plates-formes, -corriger des bogues et ajouter de nouvelles caractИristiques. -Vous Йtes vivement encouragИ Ю envoyer vos modifications -Ю \fBfyodor@insecure.org\fR pour une Иventuelle incorporation dans -la distribution principale. En envoyant ces modifications Ю -Fyodor ou Ю quelqu'un de la liste de diffusion de dИveloppement -de insecure.org, il est supposИ que vous offrez Ю -Fyodor le droit illimitИ et non exclusif de rИutiliser, -modifier et relicencier le code. C'est important parce que l'impossibilitИ -de relicencier le code a provoquИ des problХmes dИvastateurs dans d'autres -projets de logiciel libre (comme KDE et NASM). -Nmap sera toujours disponible en Open Source. -Si vous dИsirez spИcifier des conditions particuliХres de licence pour vos -contributions, dites-le nous simplement quand vous nous les envoyez. -.Sp -Ce programme est distribuИ dans l'espoir d'Йtre utile, mais -.B SANS AUCUNE GARANTIE -mЙme la garantie implicite relative Ю la -.B QUALITи MARCHANDE -ou -.B D'APTITUDE ю UNE UTILISATION PARTICULIхRE. -Voir la licence GPL (c'est le fichier COPYING de la -distribution \fInmap\fR. -.Sp -Remarque\ : Nmap a dИjЮ fait planter certaines -applications, des piles TCP/IP et mЙme des systХmes d'exploitations mal Иcrits. -Par consИquent -.B Nmap ne devrait jamais Йtre utilisИ contre des systХmes qui ont une mission -critique Ю moins que vous ne soyez prЙt Ю souffrir d'une Иventuelle -interruption de service. Nous reconnaissons ici que \fbnmap\fR -peut crasher vos systХmes et rИseaux mais nous ne sommes pas responsables -des dИgБts que Nmap pourrait provoquer. -.Sp -En raison du lИger risque de crashs et parce que quelques personnes -mal intentionnИes utilisent nmap pour les reconnaissances prИliminaires Ю une -attaque, certains administrateurs deviennent furieux et se plaignent quand leurs -systХmes sont scannИs. C'est pourquoi il est plus sage de demander la permission -avant de lancer l'analyse d'un rИseau. -.Sp -Nmap ne devrait jamais Йtre lancИ avec des privilХges (par exemple suid root) -pour des raisons de sИcuritИ. -.Sp -Toutes les versions de Nmap postИrieures Ю la 2.0 sont compatibles -an 2000. Il n'y a aucune raison de penser que les versions antИrieures ont des -problХmes, mais nous ne les avons pas testИes. -.SH TRADUCTION -SИbastien Blanchet, 2002 -.SH RELECTURE -GИrard Delafond diff --git a/docs/nmap_german.1 b/docs/nmap_german.1 deleted file mode 100644 index da4234f96..000000000 --- a/docs/nmap_german.1 +++ /dev/null @@ -1,991 +0,0 @@ -.\" This definition swiped from the gcc(1) man page -.de Sp -.if n .sp -.if t .sp 0.4 -.. -.TH NMAP 1 -.SH NAME -nmap - Auswertungstool fuer Netzwerke und Security Scanner -.SH SYNTAX -.B nmap -[Scan-Typ(en)] [Optionen] -.SH BESCHREIBUNG - -.I Nmap -wurde entwickelt, um Systemadministratoren und kuriosen Individuen die -Moeglichkeit zu geben, ansprechbare Systeme und die durch sie bereitgestellten -Dienste in grossen Netzwerken zu identifizieren. -.I nmap -unterstuetzt eine Vielzahl verschiedener Scanning-Techniken, wie zum Beispiel -UDP, TCP connect(), TCP SYN (half open), FTP-Proxy (bounce attack), -Reverse-ident, ICMP (Ping-Suchlauf), FIN, ACK-Suchlauf, Xmas-Tree, -SYN-Suchlauf, IP-Protocol und Null-Scan. -Siehe Absatz -.I Scan-Typen -fuer mehr Informationen. Ebenso ermoeglicht nmap eine Vielzahl von -zusaetzlichen Moeglichkeiten, wie das Erkennen von Betriebssystemen mittels -TCP/IP-Fingerprinting, Stealth-Scanning, dynamische Verzoegerungen und -Uebertragungswiederholungs-Berechnungen, paralleles Scanning, Entdecken -abgeschalteter Systeme mittels parallelem Scanning, Decoy-Scanning, entdecken -von Port-Filtering, direktes RPC-Scanning (ohne Portmapper), fragmentiertes -Scanning sowie flexible Ziel und Port Spezifizierung. -.PP -Ein Grossteil der Arbeit wurde in die Moeglichkeiten fuer non-root Benutzer -investiert. Leider benoetigen viele exotische Techniken (z.B. die Kernel-nahen -raw sockets) root-Privilegien. Aus diesem Grund sollte nmap stets als root -genutzt werden, sofern dies moeglich ist (natuerlich kein setuid root). -.PP -Das Resultat eines nmap-Durchlaufs ist normalerweise eine Liste saemtlicher -interessanter Ports der gescannten Geraete (falls vorhanden). Sofern eine -Zuweisung stattfinden kann, benennt nmap die well-known Ports direkt mit ihrem -Service-Namen, Portnummer, Status und Protokoll. Der Status ist -entweder 'open', 'filtered' oder 'unfiltered'. Open (dt. offen) bedeutet, dass -das Zielsystem auf diesem Port Verbindungen anzunehmen in der Lage ist. -Filtered (dt. gefiltert) weist darauf hin, dass ein dediziertes -Firewall-System, TCP/IP-Filter oder Netzwerk-Element die Arbeit von nmap -behindert und somit keine verlaesslichen Rueckschluesse gemacht werden -koennen. Unfiltered (dt. ungefiltert) heisst, dass nmap den Port kennt, jedoch -beim Zugriff keinerlei Filter-Mechanismen ausgemacht werden konnten. Der -ungefilterte Status wird in den meisten aller Faelle vorhanden sein, weshalb -ein solcher nur immer dann ausgwiesen wird, wenn die meisten der gescannten -Ports gefiltert (engl. filtered) sind. -.PP -Jenachdem, welche Optionen angewandt wurden, ist nmap in der Lage Auskunft -ueber die folgenden Charakteristiken des Zielsystems zu geben: Genutztes -Betriebssystem, TCP-Sequenznummern, Benutzername der an die Ports gebundene -Software, DNS-Name, ob es sich um ein Smurf-System handelt und viele mehr. -.SH OPTIONEN -Das Zusammenspiel verschiedener Optionen ist immer dann moeglich, wenn dies -auch Sinn macht. Einige Parameter koennen nur in Verbindung mit spezifischen -Scan-Methoden genutzt werden. -.I nmap -versucht unlogische und nicht unterstuetzte Kombinationen von Parametern -abzufangen und den Benutzer entsprechend zu warnen. -.Sp -Falls Sie ungeduldig sind, koennen Sie den Abschnitt -.I Beispiele -ueberspringen. Darin werden typische Befehlseingaben gezeigt. Ebenso kann -.B nmap -h -ausgefuehrt werden, um eine kurze Optionsreferenz ausgeben zu lassen. -.TP -.B SCAN-TYPEN -.TP -.B -sS -TCP SYN-Scan: Diese Technik wird oft als "halb-offen" (engl. "half-open") -bezeichnet, da keine volle TCP-Verbindung zustande kommt. Der Scanner schickt -ein TCP-Datagramm mit gesetzter SYN-Flagge an das Zielsystem, so wie dies im -Rahmen des Drei-Wege-Handschlags von TCP normalerweise auch der Fall ist. Nun -wird auf eine positive Rueckmeldung des Zielsystems gewartet. Kommt ein Paket -mit gesetzter SYN/ACK-Flagge zurueck, so wird der Zielport als im Status -LISTENING (dt. abhoerend) identifiziert. Im Gegenzug deutet ein RST-Datangramm -auf einen geschlossenen Port (engl. closed) hin. Wird ein SYN/ACK-Datagramm -entgegengenommen, schickt nmap (bzw. der Betriebssystem-Kernel) automatisch -ein RST zurueck, um den Verbindungsaufbau zu abzubrechen. Der primaere Vorteil -dieser Vorgehensweise ist, dass viele Systeme solcherlei Zugriffe nicht -protokollieren (Die meisten Applikationen interessieren sich nur fuer -vollstaendig etablierte Verbindungen). Leider setzt diese Scan-Technik -root-Privilegien voraus, da eine Generierung verhaeltnismaessig exotischer -Paket-Sequenzen von Noeten ist. Dies ist die standardmaessige Scan-Methode -fuer priviligierte Benutzer. -.TP -.B -sT -TCP connect()-Scan: Dies ist die klassische Form des TCP-Portscannings. Der -connect()-System-Call, der das Betriebssystem zur Verfuegung stellt, wird -immer dann genutzt, wenn eine Verbindung zum Port eines Zielsystems -hergestellt werden soll. Befindet sich der Zielport im Status LISTENING, so -wird der connect()-Zugriff erfolgreich ausfallen. Der entscheidende Vorteil -dieser Methode ist, dass keine erweiterten Rechte zur Durchfuehrung -erforderlich sind. Jeder Benutzer der meisten UNIX-Systeme ist in der Lage -solcherlei Zugriffe durchzufuehren. -.Sp -Diese Scan-Technik ist einfach zu entdecken und wird mit groesster -Wahrscheinlichkeit in den Protokoll-Dateien des Zielsystems auftauchen. Dies -ist der standardmaessig aktivierte Scan-Typ fuer unprivilegierte Anwender. -.TP -.B -sF -sX -sN -Stealth FIN-, Xmas-Tree- oder Null-Scan-Modis: Es gibt Momente, wo SYN-Scans -nicht heimlich genug ausfallen. Einige Firewall-Systeme (z.B. Packet-Filter) -sind in der Lage verdaechtige SYN-Aktivitaeten zu erkennen; ebenso koennen -Programme wie Synlogger oder Courtney die SYN-Portscans als solche ausweisen. -Diese erweiterten Scan-Techniken koennen somit in manchen Faellen ungehindert -die gewuenschten Resultate liefern. -.Sp -Die Idee ist, dass geschlossene Ports auf solcherlei Zugriffe mit einem -RST-Datagramm antworten muessten, waehrend ansprechbare Ports die Anfragen -ignorieren sollten (siehe RFC 793, S. 64). Der FIN-Scan nutzt ein -TCP-Datagramm mit gesetzter FIN-Flagge, waehrend der Xmas-Tree-Scan die -TCP-Flaggen FIN, URG und PSH aktiviert. Der Null-Scan schaltet alle optionalen -Flags ab. Leider ignoriert einmal mehr Microsoft die gaengigen Standards und -reagiert auf die exotischen Scan-Techniken ganz unerwartet. Dies bedeutet, -dass diese Scanning-Methoden nicht gegen Windows 9x, ME, NT, 2000 und XP -funktionieren. Auf der anderen Seite ist dies natuerlich hervorragend, wenn es -um das Identifizieren der TCP/IP-Implementierung von Microsoft geht: Findet -einer dieser Scans einen offenen Port, so kann davon ausgegangen werden, dass -es sich beim Zielsystem nicht um ein Windows handelt - Im Gegenzug deuten -unrealistisch viele offene Ports auf eine Windows-Maschine hin. Es gilt sich -jedoch noch die Meinung einer klassischen Scan-Methode (z.B. SYN) einzuholen. -Es gibt noch einige andere Betriebssysteme, die sich aehnlich demjenigen von -Microsoft verhalten. Dies sind zum Beispiel Cisco, BSDI, HP/UX, MVS und IRIX. -All diese retournieren ein Reset, auch wenn es sich um einen ansprechbaren -Port handelt. Mittlerweile ist diese knifflige Unterscheidungs-Arbeit mittels -exotischer Scanning-Techniken eher weniger wichtig, da nmap eine erweiterte -Methode fuer das Erkennen des eingesetzten Betriebssystems mitbringt. -.TP -.B -sP -Ping-Scanning: Manchmal ist es lediglich gefragt, welche Hosts in einem -Netzwerk aktiv sind. nmap kann diese Frage beantworten, indem eine ICMP echo -request-Anfrage an jede IP-Adresse im spezifizierten Netzwerk geschickt wird. -Hosts, die mit einer ICMP echo reply antworten, koennen als aktiv ausgewiesen -werden. Viele gewissenhafte Firewall- und Systemadministratoren filtern bzw. -verwerfen unnoetigen ICMP-Verkehr. nmap greift sodann auf eine andere Technik -zurueck. Es wird ein TCP-Datagramm mit gesetzter ACK-Flagge an einen -potentiell offenen Port des Zielsystems geschickt (standardmaessig TCP-Port -80). Wird ein RST zurueckgeschickt, so ist das Zielsystem vorhanden und -ansprechbar. Eine dritte Technik greift auf ein SYN-Datagramm zurueck, das auf -ein RST oder SYN/ACK wartet. Alle non-root Benutzer fuehren einen -connect()-Zugriff durch. -.Sp -Standardmaessig (bei root-Benutzern) fuehrt nmap beides - ICMP- und -ACK-Technik - parallel durch. Dies kann durch das Heranziehen der spaeter noch -detaillierter beschriebenen Option -.B -P -geaendert werden. -.Sp -Wichtig ist zu wissen, dass der Ping-Zugriff standardmaessig stets erfolgt. -Abhaengig der Erreichbarkeit eines Systems wird ein solches dann gescannt. -Benutzen Sie diese Option lediglich dann, wenn es um das Durchfuehren eines -Ping-Suchlaufs ( -.B ohne -Portscan) geht. -.TP -.B -sU -UDP-Scans: Diese Methode wird stets dann herangezogen, wenn es um das -Identifizieren der offenen UDP-Ports (siehe RFC 768) eines Systems geht. Diese -Technik basiert darauf, dass ein UDP-Datagramm mit 0 Byte an Nutzdaten an -jeden Port des Zielsystems geschickt wird. Erhalten wir eine ICMP port -unreachable-Nachricht, so ist der Zielport geschlossen. Andererseits handelt -es sich um einen offenen Port. -.Sp -Einige Leute denken, dass UDP-Scanning sinnlos ist. Ich moechte in diesem -Zusammenhang auf die Luecke in Solaris' rpcbind hinweisen. rpcbind kann an -einem undokumentierten UDP-Port ueber 32770 gefunden werden. Bei diesem -Angriff und der vorangehenden Auswertung ist es sodann zu einem hohen Grad -irrelevant, ob Port 111 durch eine Firewall blockiert wird oder nicht. Ebenso -existiert das populaere, von cDc entwickelte Backdoor namens Back Orifice, das -durch einen frei waehlbaren UDP-Port Windows-Maschinen kontrollieren laesst. -Und nicht zu vergessen die vielen potentiell verwundbaren Dienste, die auf UDP -zurueckgreifen: SNMP, TFTP, NFS, etc. -.Sp -Traurigerweise ist UDP-Scanning in den meisten Faellen schmerzhaft langsam, -seitdem viele Betriebssystem-Entwickler der Empfehlung von RFC 1812 (Absatz -4.3.2.8) nachgekommen sind, die Anzahl ausgehender ICMP-Fehlernachrichten zu -limitieren. Zum Beispiel definiert der Linux-Kernel (in net/ipv4/icmp.h) die -Anzahl ausgehender ICMP destination unreachable-Fehlermeldungen auf 80 fuer 4 -Sekunden, mit einer 1/4 Sekunde Zusatz fuer jeden Uebertritt. Solaris weist -einiges striktere Limitierungen auf (2 Nachrichten pro Sekunde), weshalb ein -UDP-Portscan gegen ein Solaris-System sehr lange dauert. -.I nmap -ist in der Lage solcherlei Limitierungen zu erkennen und mit einem dynamischen -Verlangsamen der Geschwindigkeit zu reagieren. Dies verhindert das Verstopfen -des Netzwerks mit unnoetigen Paketen, die sowieso vom Zielsystem ignoriert -werden wuerden. -.Sp -Einmal mehr typisch, ignoriert Microsoft die Empfehlungen des RFCs, weshalb -eine Einschraenkung ausgehender ICMP-Fehlermeldungen gaenzlich bei der -TCP/IP-Implementierung auf Windows 9x und NT fehlt. Das scannen saemtlicher -UDP-Ports auf einer Windows-Maschine ist somit kein groesseres Problem. -.TP -.B -sO -IP protocol-Scans: Diese Methode kommt dann zum Tragen, wenn herausgefunden -werden will, welche IP-Protokolle vom Zielsystem unterstuetzt werden. Diese -Technik basiert darauf, dass fuer jedes IP-Protokoll ein RAW IP-Paket mit -fehlendem Protokoll-Header an das Zielsystem geschickt wird. Erhalten wir eine -ICMP protocol unreachable-Fehlermeldung, so koennen wir davon ausgehen, dass -das besagte Protokoll nicht unterstuetzt wird. Faellt das Resultat anders aus, -kann mit einer Protokoll-Unterstuetzung gerechnet werden. Es ist wichtig zu -bemerken, dass einige Betriebssysteme (z.B. AIX, HP-UX und Digital UNIX) und -Firewall-Loesungen auf das Versenden der ICMP protocol -unreachable-Fehlermeldungen gaenzlich verzichten. Das Resultat eines solchen -Verhaltens ist die durch nmap generierte Ausgabe, dass saemtliche Protokolle -"offen" sind. -.Sp -Aufgrund dessen, dass diese Scan-Methode in ihren Grundzuegen auf den -Prinzipien des UDP-Portscannings aufbaut, spielt die Rate der potentiell -generierten ICMP-Fehlermeldungen eine beachtliche Wichtigkeit. Da das -IP-Protokoll Feld nur 8 Bits hat, muessen lediglich 256 Protokolle gescannt -werden, was sich in einem angemessenen Zeitrahmen erledigen laesst. -.TP -.B -sI -Idlescan: Diese erweiterte Scan-Technik ermoeglicht ein blindes Scannen der -TCP-Port eines Ziels (dies bedeutet, dass keinerlei Pakete mit der richtigen -IP-Absenderadresse verschickt werden). Stattdessen wird eine einzigartige -Attacke angewandt, die die Berechenbarkeit der IP Fragmentation ID eines -Zombie-Hosts ausnutzt. Intrusion Detection-Systeme werden den Scan-Versuch -dem spezifizierte Zombie-System zuschreiben (welches ansprechbar sein und -bestimmte Kriterien erfuellen muss). Ich habe eine Publikation zu diesem -Thema verfasst, die sich unter http://www.insecure.org/nmap/idlescan.html -findet. -.Sp -Neben der vollkommenen Sicherheit, nicht direkt erkannt werden zu koennen, -ermoeglicht dieser Scan-Typ das Erkennen von IP-basierenden -Vertrauensbeziehungen zwischen Geraeten. Das Port-Listing zeigt die offenen -Ports -.I aus der Sicht des Zombie-Systems. -Es ist sodann Moeglich das effektive Zielsystem durch verschiedene Zombies -scannen zu lassen, die eine bestehende Vertrauensbeziehung haben (via Router- -oder Packetfilter-Regeln). Ganz offensichtlich ist dies eine gewichtige -Information, wenn es um das Priorisieren von Angriffszielen geht. Andererseits -muessten Penetration Tester zuerst muehsam ein System kompromittieren, bis -verlaesslich gesagt werden kann, ob ueberhaupt die erforderliche -Vertrauensbeziehung besteht. -.Sp -Durch einen Doppelpunkt laesst sich die Portnummer des Zombiesystems -definieren. Ohne diese Angabe waehlt nmap den Standardport, der auch bei -TCP-Pings Verwendung findet (TCP-Port 80). -.TP -.B -sA -ACK-Scan: Auf diese erweiterte Scan-Technik wird normalerweise immer dann -zurueckgegriffen, wenn es um das Identifizieren eines Firewall-Regelwerks -geht. Zusaetzlich kann diese Methode eine Determinierung des Vorhandenseins -einer Stateful Inspection, die eingehende SYN-Pakete blockt, ermoeglichen. -.Sp -Dieser Scan-Typ schickt ein ACK-Paket (mit zufaellig gewaehlten -Bestaetigungs-/Sequenznummern) an den spezifizierten Zielport. Kommt ein RST -zurueck, wird der besagte Port als "unfiltered" (dt. ungefiltert) eingestuft. -Erhalten wir keine Rueckantwort (oder kommt ein ICMP unreachable zurueck), so -weist nmap den Port als "filtered" (dt. gefiltert) aus. Wichtig ist, dass -.I nmap -normalerweise keine "unfiltered" ausgibt. So sind -.B keine -Ports in der Ausgabe ein Indiz dafuer, dass alle Zugriffe durchgekommen sind -(und ein RST verursacht haben). Dieser Scan wird die Ports nie in einem -"open" (dt. offenen) Status zeigen. -.TP -.B -sW -Window-Scan: Diese erweiterte Scan-Technik ist dem ACK-Scan sehr aehnlich. -Ausser, dass hiermit manchmal auch offene, ungefilterte und gefilterte Ports -durch eine Anomalie in der durch die Betriebssysteme gewaehlten TCP window -size entdeckt werden koennen. Systeme, die gegen diese Attacke verwundbar sind, -sind einige Versionen von AIX, Amiga, BeOS, BSDI, Cray, Tru64 UNIX, DG/UX, -OpenVMS, Digital UNIX, FreeBSD, HP-UX, OS/2, IRIX, MacOS, NetBSD, OpenBSD, -OpenStep, QNX, Rhapsody, SunOS 4.x, Ultrix, VAX and VxWorks. Siehe das Archiv -der nmap-Hackers Mailingliste fuer eine vollstaendige Auflistung. -.TP -.B -sR -RPC-Scan: Diese Methode arbeitet in Kombination mit den meisten moeglichen -Scan-Typen von nmap zusammen. Jeder als offen identifizierte TCP- und UDP-Port -wird mit einer Vielzahl von SunRPC-Nullkommandos ueberflutet, um eine -Identifizierung von RPC-Ports vorzunehmen. Falls ein solcher gefunden wurde, -wird der Programmname und die Version ausgelesen, sofern diese Information zur -Verfuegung gestellt wird. Diese Vorgehensweise ist ebenso mit dem Heranziehen -von 'rpcinfo -p' moeglich; besonders dann, wenn des Zielsystems Portmapper -hinter einer restriktiven Firewall steht oder durch einen TCP-Wrapper -geschuetzt wird. Decoy-Scans arbeiten zur Zeit nicht mit RPC-Scans zusammen. -Irgendwann wird vielleicht Decoy-Scanning im Zusammenhang mit UDP-RPC-Scans -moeglich sein. -.TP -.B -sL -List-Scan: Diese simple Methode generiert eine Liste aller IP-Adressen und -Hostnamen, ohne die Zielsysteme direkt anzusprechen (Ping oder Portscan). -Eine Namensaufloesung ueber DNS findet stets statt, sofern dies nicht durch -das Heranziehen von -n unterbunden wird. -.TP -.B -b -FTP-Bounce Attacke: Ein interessantes "Feature" des File Transport Protocols -(RFC 959) ist die Unterstuetzung von "Proxy"-FTP-Verbindungen. Mit anderen -Worten ist es moeglich, sich von boese.com auf ziel.com zu verbinden und -eine Datei ueberall hin zu schicken. Nun, dies hat wohl ausgezeichnet -funktioniert, als 1985 das besagte RFC geschrieben wurde. In der heutigen -Zeit ist es nicht mehr ohne weiteres Moeglich, sich auf fremde FTP-Server zu -verbinden und nach Belieben Dateien zu versenden. *Hobbit* schrieb 1995 -folgendes zu dieser Schwachstelle: "[This protocol flaw] can be used to post -virtually untraceable mail and news, hammer on servers at various sites, fill -up disks, try to hop firewalls, and generally be annoying and hard to track -down at the same time." Bei dieser Scanning-Methode wird ein als Proxy -fungierender FTP-Server genutzt, um die offenen Ports eines Zielsystems -ausfindig zu machen. Beispielsweise kann dadurch zu einem hinter einer -Firewall positionierten FTP-Server verbunden werden, um danach interne, durch -das Firewall-Element gegen externe Zugriffe geschuetzte Ports (z.B. die -NetBIOS-Ports) anzusprechen. Falls auf dem FTP-Server ein Verzeichnis -existiert, bei dem sowohl Lese- als auch Schreibrechte vorhanden sind (z.B. -/incoming), kann eine semi-manuelle Uebergabe von Daten an die Zielports -durchgefuehrt werden (nmap nimmt einem diese Arbeit nicht ab). -.Sp -Das mit der Option '-b' uebergebene Argument, spezifiziert den als Proxy -gewollten Host, wobei die standard URL-Notation gilt. Das Format lautet -.I Benutzername:Passwort@Server:Port. -Alles, ausser -.I Server -ist optional. Wie eine Determinierung der gegen diese Zugriffsform verwundbare -Server vorgenommen werden kann, kann in meinem Artikel in -.I Phrack -51 nachgelesen werden. Eine aktualisierte Version ist auf der -.I nmap -Webseite (http://www.insecure.org/nmap) verfuegbar. -.TP -.B GENERELLE OPTIONEN -Keine der folgenden Optionen ist erforderlich. Einige von ihnen koennen jedoch -nuetzlich sein. -.TP -.B -P0 -Verhindert das Pingen eines Hosts, bevor er gescannt wird. Dies ermoeglicht -das Scannen von Netzwerken, die keine ICMP echo requests (oder responses) -aufgrund einer restriktiv konfigurierten Firewall zulassen. microsoft.com ist -ein Beispiel fuer ein solches Netzwerk, in dem diese Funktion stets genutzt -werden sollte. Gebrauchen Sie -.B -P0 -oder -.B -PT80 -wenn ein Portscan gegen microsoft.com durchgefuehrt werden soll. -.TP -.B -PT -Benutzt einen TCP-Ping, um die Erreichbarkeit eines Hosts zu verifizieren. -Anstatt ICMP echo request-Abfragen zu verschicken und auf die entsprechenden -ICMP echo reply-Rueckantworten zu warten, wird auf ein TCP-Datagramm mit -gesetzter ACK-Flagge gesetzt. Ansprechbare Systeme sollten mit einem RST -antworten. Diese Funktion ist immer dann anzuwenden, wenn Systeme oder -Netzwerke gescannt werden sollen, die keine Erreichbarkeitsueberpruefung -mittels ICMP zulassen und trotzdem zuerst die Erreichbarkeit identifiziert -werden soll. Bei non-root Benutzern wird connect() angewandt. Um den Zielport -des Zugriffs zu spezifizieren, kann -PT herangezogen werden. Der -Standardport ist einmal mehr TCP/80 (HTTP), da dieser eher selten durch einen -Filter gedeckt wird. -.TP -.B -PS -Diese Option benutzt fuer root-Benutzer SYN (Verbindungsanforderungen) anstatt -ACK-Pakete. Ansprechbare Hosts sollten mit einem RST (oder in seltenen Faellen -mit einem SYN/ACK) antworten. Das Setzen des Zielports kann auf die selbe Art -wie beim zuvor erlaeuterten -PT umgesetzt werden. -.TP -.B -PI -Diese Option nutzt einen klassischen Ping (ICMP echo request), um die -Erreichbarkeit von Systemen und Broadcast-Adressen von Subnetzen zu -identifizieren. Letztere sind extern erreichbare IP-Adressen, die eine -Umwandlung zu einem internen Broadcast des Subnetzes durchfuehren. Solcherlei -sollten verhindert werden, denn sie sind Voraussetzung fuer eine Reihe von -Denial of Service-Attacken (Smurf ist die bekannteste Variante). -.TP -.B -PP -Benutzt eine ICMP timestamp-Anfrage (Typ 13, Code 0), um ansprechbare Hosts zu -finden. -.TP -.B -PM -Das Gleiche wie -.B -PI -und -.B -PP -, ausser, dass eine ICMP address mask request (Typ 17, Code 0) zum Tragen kommt. -.TP -.B -PB -Dies ist der standardmaessig gewaehlte Ping-Typus. Er benutzt beide Techniken, -ACK ( -.B -PT -) und ICMP echo requests ( -.B -PI -), die jeweils parallel durchgefuehrt werden. Auf diese Weise koennen -Firewall-Elemente ausgetrickst werden, die eine der beiden Protokolle (nicht -beide) filtern. Der Zielport fuer den TCP-Zugriff kann auf die gleiche Weise -gesetzt werden, wie im zuvor erklaerten -PT. -.TP -.B -O -Diese Option aktiviert das Identifizieren des am Zielsystem eingesetzten -Betriebssystems anhand des TCP/IP-Fingerabdrucks (engl. TCP/IP fingerprint). -Es wird eine Anzahl spezifischer Tests umgesetzt, die das typische Verhalten -der jeweiligen TCP/IP-Implementierungen erkennen koennen sollen. Die -gegebenen Informationen stellen quasi einen 'Fingerabdruck' dar, der mit der -Datenbank der bekannten Betriebssystem-Fingerabdrucke (die -nmap-os-fingerprints Datei) verglichen wird. -.Sp -Falls nmap nicht in der Lage ist, eine mehr oder weniger eindeutige -Identifikation des am Zielsystem eingesetzten Betriebssystems vorzunehmen und -die gegebenen Bedingungen gut sind (mindestens ein ansprechbarer Port), gibt -nmap eine URL aus, bei der neu gefundene Fingerprints eingesendet werden -koennen. Dies setzt natuerlich voraus, dass Sie sich eindeutig im Klaren -darueber sind, um was fuer ein Betriebssystem es sich handelt. Durch diesen -Schritt koennen Sie aktiv an der Erweiterung der Datenbank mithelfen, wodurch -sie attraktiver fuer saemtliche Benutzer wird. Falls Sie beim Einsenden des -neuen Fingerabdrucks die IP-Adresse des Zielsystems mitangeben, muessen Sie -damit rechnen, dass es von uns zu Ueberpruefungszwecken gescannt wird. -.Sp -Die Option -O aktiviert ebenso einige weitere Tests. Einer dieser ist das -Messen der "Uptime". Hierzu wird das Timestamp-Feature von TCP genutzt (RFC -1323), um erkennen zu koennen, wann das Zielsystem das letzte mal neu -gestartet wurde. Diese Funktionalitaet wird natuerlich nur dann genutzt werden -koennen, wenn das Zielsystem diese Information auch entsprechend bereitstellt. -.Sp -Ein anderer Check, der durch die Option -O aktiviert wird, ist die -Klassifizierung der Berechenbarkeit der TCP-Sequenznummer des Zielsystems. -Das Ergebnis dieses Tests sagt aus, wie schwer es ist, eine bestehende -Verbindung des Zielsystems zu uebernehmen. Dies ist dann nuetzlich, wenn -auf IP-Adressen basierende Vertrauensbeziehungen (z.B. rlogin und -Firewall-Filter) missbraucht oder die Quelle eines Angriffs versteckt werden -sollen. Die mitgelieferte Difficulty-Number ist statistisch berechnet und kann -jeweils leicht abweichen. Zusaetzlich wird in knappen Worten (z.B. "worthy -challenge" or "trivial joke") der Zustand beschrieben. All dies wird nur dann -ausgegeben, wenn der Parameter -v mitangegeben wurde. -.Sp -Wenn die Option -O zusammen mit dem Verbose-Modus (-v) genutzt wird, wird -ebenso die Sequenz-Generierung der IPID ausgewiesen. Die meisten Geraete -werden als "incremental" klassifiziert, was bedeutet, dass sie fuer jedes -verschickte Paket eine Inkrementierung des ID-Felds im IP-Header vornehmen. -Ein solches Verhalten macht sie verwundbar gegen eine Reihe verschiedener -Auswertungs- und Spoofing-Attacken. -.TP -.B -6 -Diese Option aktiviert die IPv6-Unterstuetzung. Saemtliche Ziele muessen mit -IPv6 zurecht kommen, sofern diese Option genutzt werden soll. Das -Spezifizieren der Ziele kann ganz normal ueber den DNS-Namen (AAAA record) -oder IPv6-Adresse (z.B. 3ffe:501:4819:2000:210:f3ff:fe03:4d0) geschehen. -Momentan sind TCP connect()- und Ping-Scans von nmap unterstuetzt. Falls UDP- -oder andere Scan-Typen genutzt werden sollen, lohnt sich ein Blick auf -http://nmap6.sourceforge.net/ . -.TP -.B -I -Hiermit wird das TCP reverse ident-Scanning aktiviert. Wie Dave Goldsmith in -einem Bugtraq-Posting aus dem Jahre 1996 publiziert hat, ermoeglicht das -ident-Protokoll (RFC 1413) das Identifizieren des Besitzers eines -TCP-Dienstes. So kann zum Beispiel eine Verbindung zum HTTP-Port des -Zielsystems hergestellt werden, um danach mittels ident herauszufinden, ob -der Webserver als root laeuft. Dies kann nur mit der Hilfe eines full-connect -TCP-Portscans (-sT) geschehen. Wenn -.B -I -aktiviert wird, wird der identd des Zielsystems fuer jeden als offen -identifizierten Port abgefragt. Logischerweise funktioniert diese ganze -Prozedur nicht, wenn das Zielsystem keinen identd aktiv hat. -.TP -.B -f -Diese Option erreicht, dass der durchgefuehrte SYN-, FIN-, Xmas- oder -Null-Scan mit fragmentierten IP-Paketen arbeitet. Die Idee ist, dass der -TCP-Header ueber mehrere Pakete verteilt werden soll, wodurch eine -Inspizierung durch Firewall- oder Intrusion Detection-Systeme erschwert wird. -Bei dieser Funktion ist Vorsicht geboten, denn viele der verbreiteten -Netzwerkanwendungen kommen mit derlei Datenverkehr nicht klar. Beispielsweise -erhielt ich bei meinem liebsten Sniffer ein segemtation fault, nachdem das -erste 36-byte Fragment eingelesen wurde. Danach kam gar ein 24-byte Paket! -Waehrend diese Methode keinen Erfolg bei Elementen verspricht, die eine -Warteschlange fuer IP-Fragmente haben (wie dies mittels der Option -CONFIG_IP_ALWAYS_DEFRAG unter Linux normalerweise der Fall ist), koennen -andere Umgebungen den enormen Aufwand fuer eine solche Analyse nicht tragen, -verzichten darauf und koennen deshalb ausgetrickst werden. -.Sp -Es bleibt zu bemerken, dass diese Option nicht auf allen Betriebssystemen -einwandfrei genutzt werden kann. Es arbeitet ohne Zwischenfaelle auf meinem -Linux, FreeBSD und OpenBSD; einige Leute berichten gar, dass es auch auf -anderen *NIX funktioniert. -.TP -.B -v -Verbose-Modus: Diese, eine sehr zu empfehlende Option, ermoeglicht eine -erweiterte Ausgabe von Informationen. Eine doppelte Nutzung ergibt einen -doppelt so grossen Effekt. Ebenso kann -.B -d -einige Male aktiviert werden, falls Sie wirklich vor einem ueberlasteten -Bildschirm verrueckt werden wollen! -.TP -.B -h -Diese handliche Funktion zeigt eine Kurzreferenz der nmap-Parameter. Wie Sie -vielleicht gemerkt haben, handelt es sich bei dieser man-Page nicht unbedingt -um eine 'handliche Kurzreferenz' :) -.TP -.B -oN -Dies protokolliert die Resultate des Scans in einem normalen, fuer -.B Menschen lesbaren -Format in eine durch ein Argument spezifizierte Datei. -.TP -.B -oX -Dies protokolliert die Resultate des Scans als -.B XML -in die durch ein Argument spezifizierte Datei. Dadurch koennen andere -Programme unkompliziert die durch nmap generierten Informationen auswerten und -verarbeiten. Durch das Argument '-' (ohne Anfuehrungszeichen) kann die -Ausgabe auf stdout (fuer Pipeline-Verarbeitung, etc.) umgeleitet werden. In -diesem Fall wird die normale Bildschirmausgabe unterdrueckt. Achtung vor -Fehlermeldungen (diese werden nach wie vor nach stderr geschickt). Ebenso ist -wichtig, dass '-v' in den meisten Faellen einige zusaetzliche Informationen -gewaehrleisten koennen wird. Die Dokumententypendefinition (engl. Document -Type Definition, abk. DTD), die fuer die XML-Ausgabe genutzt wird, steht unter -http://www.insecure.org/nmap/data/nmap.dtd bereit. -.TP -.B -oG -Dies protokolliert die Resultate des Scans in eine -.B grepbare -Form in eine durch ein Argument spezifizierte Datei. Dadurch wird ein simples -Format angestrebt, welches alle Informationen auf einer Zeile ausgibt, weshalb -ganz einfach ein grep fuer Ports, OS-Informationen oder IP-Adressen umgesetzt -werden kann. Dieses einfache Format stellt meistens nicht so viele -Informationen bereit, wie dies bei anderen Ausgabevarianten der Fall ist. -Diese Form war die urspruenglich, fuer die Verarbeitung durch externe Programme -vorgehesene Dokumentierungs-Ausgabe. Mittlerweile ist jedoch XML empfohlen -(-oX). Einmal mehr kann die Angabe von '-' (ohne Anfuehrungszeichen) eine -Ausgabe auf stdout erzwingen (fuer Pipeline-Verarbeitung, etc.). Auch hier -wird die normale Ausgabe unterdrueckt. Ebenso werden Fehlermeldungen wie -ueblich auf stderr ausgegeben. Und '-v' wird in den meisten Faellen einige -zusaetzliche Informationen gewaehrleisten koennen. -.TP -.B -oA -Dies veranlasst nmap in der Form ALLER wichtigen Formate (normal, grepbar und -XML) zu protokollieren. Sie geben den Dateinamen an, wobei nmap die -Erweiterungen in Form von basis.nmap, basis.gnmap und basis.xml automatisch -anfuegen wird. -.TP -.B -oS -Dies protokolliert die Resultate der Scans in einem fuer -.B s| -Ein Netzwerk-Scan, der durch das Druecken von Control-C unterbrochen wurde, -kann durch diese Option reaktiviert werden. Der Protokoll-Dateiname muss -entweder eine normale (-oN) oder durch Maschinen verarbeitbare (-oM) -Scan-Protokoll-Datei sein. Die Angabe abweichender oder zusaetzlicher Optionen -ist nicht moeglich - Sie werden vom abgebrochenen Scan uebernommen. nmap wird -mit der zuletzt in der Protokoll-Datei erfolgreich gescannt vermerkten -Maschine starten. -.TP -.B --append_output -Weist nmap an, die Scan-Resultate an die spezifizierten Protokoll-Datei -anzuhaengen, anstatt die besagten Dateien zu ueberschreiben. -.TP -.B -iL -Liest die Ziel-Spezifizierung ZUERST von der angegebenen Datei ein, und erst -danach von der Kommandozeileneingabe. Die Datei sollte eine Liste von Hosts -oder Netzwerken enthalten, die jeweils durch ein Leer-, Tabulator- oder -Neuezeile-Zeichen getrennt sind. Benutzen Sie einen Bindestrich (-) als -.I Eingabe-Dateiname -, falls Sie wollen, dass nmap die Zielspezifizierungen von stdin liest (wie -im Zusammenhang mit einer Pipe). Siehe den Absatz -.I Ziel-Definition -fuer zusaetzliche Informationen zu der gueltigen Ausdrucksweise. -.TP -.B -iR -Diese Option weist nmap an, zufaellig generierte Hosts zu scannen :). Dies hat -kein Ende. Eine solche Funktion ist zum Beispiel fuer eine statistische -Auswertung innerhalb des Internets nuetzlich. Falls Sie einmal wirklich sehr -gelangweilt sein sollten, so versuchen Sie -.I nmap -sS -iR -p 80 -um Webserver-Systeme zu finden. -.TP -.B -p -Diese Option spezifiziert, welche Ports gescannt werden sollen. Zum Beispiel -wird '-p 23' lediglich einen Zugriff auf den Port 23 (Telnet) der Zielsysteme -durchfuehren. '-p 20-30,139,60000-' scannt die Ports zwischen 20 und 30, -Port 139 und alle Ports groesser als 60000. Standardmaessig werden saemtliche -well-known Ports zwischen 1 und 1024 sowie alle in der services-Datei von nmap -gelisteten Dienste gescannt. Fuer einen IP-Protokoll-Scan (-sO) kann mit -dieser Option die zu scannende Protokoll-Nummer (0-255) angegeben werden. -.Sp -Werden gleichzeitig TCP- und UDP-Ports gescannt, so kann das jeweilige -Protokoll durch ein vorangestelltes "T:" oder "U:" angewaehlt werden. Die -mitgegebenen Ports gelten so lange fuer das spezifizierte -Uebertragungsprotokoll, bis ein anderes angegeben wird. Zum Beispiel werden -mit dem Argument "-p U:53,111,137,T:21-25,80,139,8080" die UDP-Ports 53, 111 -und 137 sowie die TCP-Ports 21 bis 25, 80, 139 und 8080 gescannt. Wichtig ist, -dass bei einem gleichzeitigen TCP- und UDP-Scan neben der Angabe von -sU -mindestens eine TCP-Scan-Variante mitangegeben werden muss (zum Beispiel -sS, --sF oder -sT). Wird bei der Wahl der Zielports auf das spezifizieren eines -Protokolls verzichtet, bezieht sich die Option auf saemtliche -Uebertragungsprotokolle. -.TP -.B -F -Schneller Scan-Modus (engl. Fast scan mode): Dies gibt an, dass Sie lediglich -die in der services-Datei von nmap gelisteten Dienste scannen wollen (oder bei --sO die Protokolle der protocols-Datei). Selbstverstaendlich ist dies viel -schneller, als saemtliche 65535 Ports eines Hosts zu ueberpruefen. -.TP -.B -D -Veranlasst einen sogenannten Decoy-Scan (dt. Lockvolgel). Bei diesem sieht es -so aus, als wuerde eine Reihe zusaetzlicher Hosts die Zielumgebung scannen. -Ein Intrusion Detection-System wird zwischen 5 und 10 Portscans verschiedener -IP-Adressen protokollieren, wobei ohne weiteres nicht genau festgestellt -werden kann, welches System den Scan wirklich durchfuehrt. Waehrend diese -Methode durch Router Path Traceing, Response-Dropping und andere "aktive" -Mechanismen niedergeschlagen werden kann, ist es doch eine extrem effektive -Technik, um die eigene IP-Adresse zu verstecken. -.Sp -Die jeweiligen Lockvoegel koennen durch ein Komma getrennt werden. Optional -kann durch die Angabe von 'ME' (dt. mich) die eigene Position in der -Zugriffsreihenfolge gewaehlt werden. Falls 'ME' in die sechste oder noch eine -spaetere Position gesetzt wird, sind einige Portscan-Detektoren (z.B. Solar -Designers scanlogd) nicht in der Lage, die richtige IP-Adresse anzuzeigen. -Falls Sie 'ME' nicht mitangeben, wird nmap eine zufaellige Position bestimmen. -.Sp -Achtung, die als Decoys angegebenen Hosts sollten vom Zielsystem erreichbar -sein. Andernfalls ist es durchaus moeglich, dass dieses durch einen SYN-Flood -in die Knie gezwungen wird. Zudem ist es relativ einfach zu erkennen, welches -System den Scan durchfuehrt, wenn nur dieses eine System wirklich im Netzwerk -aktiv ist. Es lohnt sich IP-Adressen anstatt Hostnamen bei der Spezifizierung -der Lockvogel-Systeme anzugeben (so ist keine Namensaufloesung noetig und die -Protokoll-Eintraege in den Nameservern bleibt aus). -.Sp -Ebenso weisen einige (dumme) "Portscan-Detektoren" Firewalling-Funktionalitaet -auf, und sie unterbinden die Verbindungsmoeglichkeit jeglichen Systems, das -einen Portscan durchfuehrt. So kann es durchaus sein, dass die -Verbindungsmoeglichkeit des Zielsystems zu den Lockvoegeln verhindert wird. -Dies ist dann problematisch, wenn es sich um ein wichtiges System, wie zum -Beispiel das Standard-Gateway, handelt. Also, es gilt vorsichtig im Umgang -mit dieser Option zu sein. Die Moral dieser Geschichte ist, dass -Portscan-Detektoren mit automatisierter Strike-Back Funktionalitaet keine gute -Idee sind - Hinter jedem Portscan koennte sich ein Lockvogel verbergen! -.Sp -Die Lockvoegel werden im initialen Ping-Scan (ICMP, SYN oder ACK) und waehrend -der eigentlichen Portscan-Phase verwendet. Ebenso finden sie beim Durchfuehren -einer Betriebssystem-Erkennung ( -.B -O -) Verwendung. -.Sp -Es bleibt zu sagen, dass zu viele Lockvoegel einen Scan verlangsamen und -ineffizienter machen koennen. Ebenso filtern einige ISPs gespoofte Pakete -heraus, obwohl dies zur Zeit die wenigsten machen. -.TP -.B -S -Unter bestimmten Umstaenden ist -.I nmap -nicht in der Lage, Ihre Quell-IP-Adresse zu identifizieren ( -.I nmap -wird Ihnen dies mitteilen). In einer solchen Situation kann mit der Hilfe der -Option -S die IP-Adresse (der gewuenschten Schnittstelle) festgelegt werden. -.Sp -Eine andere Moeglichkeit dieser Option ist die Quelle des Scans zu spoofen, so -dass das Zielsystem glaubt, dass -.B jemand anderes -die Zugriffe durchfuehrt. Stellen Sie sich vor, dass eine Firma ploetzlich von -ihrem Konkurrenten einen Scan verzeichnet! Dies ist nicht der Hauptnutzen -dieser Option. Ich denke lediglich, dass diese Theorie einen guten Grund -bereitstellt, nicht sofort jeden als Scanner zu beschimpfen, nur weil es -scheint, dass von ihm ein Scan gestartet wurde. -.TP -.B -e -Weist nmap an, ueber welche Schnittstelle die Daten verschickt und empfangen -werden sollen. nmap sollte in der Lage sein diesen Umstand von sich aus zu -erkennen. Falls dem nicht so ist, kann diese Option herangezogen werden. -.TP -.B -g -Definiert den Quellport fuer die Scans. Einige naive -Firewall-Implementierungen machen bei DNS (53) und FTP-DATA (20) eine Ausnahme -und lassen solcherlei Verbindung entgegen der Bestimmungen im Regelwerk zu. -Obschon dieser Umstand ganz einfach durch Angreifer ausgenutzt werden kann, um -sich als FTP- oder DNS-System maskierend einen Vorteil zu verschaffen. Fuer -einen UDP-Scan sollte 53 als erstes ausprobiert werden. Bei einem TCP-Scan -bieten sich 20 und 53 an. Achtung, es handelt sich bei dieser Option lediglich -um eine Anfrage, die nicht zwingend in jeder Situation von nmap umgesetzt -werden will und kann. Zum Beispiel ist eine ISN-Analyse nicht von System:Port -zu System:Port moeglich, so dass nmap eine dynamische Portzuweisung -durchfuehrt, auch wenn anderes durch -g angegeben wurde. -.Sp -Seien Sie gewarnt, dass diese Option bei einigen Scan-Varianten -Performance-Einbussen mit sich bringt. -.TP -.B --data_length -Normalerweise verschickt nmap moeglichst kleine Pakete, die lediglich aus dem -Header bestehen. So weisen TCP-Datagramme im Normalfall eine Laenge von 40 und -ICMP echo request-Anfragen 28 Bytes auf. Diese Option weist nmap an, die -verschickten Pakete um Null-Bytes zu verlaengern. Pakete zur Erkennung des -Betriebssystens (-O) sind nicht betroffen. Ganz im Gegensatz zu -Ping-Zugriffen und Portscan-Paketen. Dies verlangsamt natuerlich die Zugriffe -unter Umstaenden - Aber ebenso kann es die Unauffaelligkeit des Scans -erhoehen. -.TP -.B -n -Sagt nmap, dass -.B NIE -reverse DNS-Aufloesungen von als aktiv identifizierten IP-Adressen -durchgefuehrt werden sollen. Da DNS oft langsam ist, kann diese Option die -Zugriffe beschleunigen. -.TP -.B -R -Sagt nmap, dass -.B IMMER -reverse DNS-Aufloesungen von als Ziel spezifizierten IP-Adressen durchgefuehrt -werden sollen. Dies wird im Normalfall nur immer dann durchgefuehrt, wenn ein -Zielsystem als aktiv identifiziert werden konnte. -.TP -.B -r -Sagt nmap, dass -.B KEINE -zufaellige Wahl beim Scannen der Ports gewuenscht ist. -.TP -.B --ttl