Menu

Patches for 3.70

Discussion
os49477
2004-10-06
2013-03-14
  • os49477

    os49477 - 2004-10-06

    hatique,

      The patch for the Makefile.in should be below, I also have attached a patch to README.sql for the update (apply or not - just changes build instructions to reflect Makefile.in.patch and updates NMAP version #'s )

    I would be willing to create a single global "nmap-sql" patch that creates/changes all files in an nmap build tree when you release the 3.70 update to the public, if you'd like. 

    These should be fine against a 3.70 pulled from insecure.org and the README.sql from 0.0.3.tar.gz

    **-There are 2 patches below-**

    ---Copy/paste into Makefile.in.patch---

    --- Makefile.in 2004-10-06 18:52:48.000000000 +0900
    +++ Makefile.in 2004-10-06 18:56:02.000000000 +0900
    @@ -18,7 +18,7 @@
    CCOPT =
    LIBPCAPDIR = @libpcapdir@
    LIBPCREDIR = @LIBPCREDIR@
    -INCLS = -I$(LIBPCAPDIR)
    +INCLS = -I$(LIBPCAPDIR) -I/usr/include/mysql
    DEFS = @DEFS@ -DNMAP_VERSION=\"$(NMAP_VERSION)\" -DNMAP_NAME=\"$(NMAP_NAME)\" -DNMAP_URL=\"$(NMAP_URL)\" -DNMAP_PLATFORM=\"$(NMAP_PLATFORM)\" -DNMAPDATADIR=\"$(nmapdatadir)\"
    # For mtrace debugging -- see MTRACE define in main.cc for instructions
    # Should only be enabled during debugging and not in any real release.
    @@ -28,10 +28,11 @@
    # CFLAGS = $(CXXFLAGS)
    # CFLAGS = $(DEFS) $(INCLS)
    STATIC =
    -LDFLAGS = @LDFLAGS@ $(STATIC)
    +LDFLAGS = @LDFLAGS@ $(STATIC) -L/usr/lib/mysql -lmysqlclient -lz
    LIBS =  @LIBNBASE_LIBS@ @LIBNSOCK_LIBS@ @LIBPCRE_LIBS@ @LIBPCAP_LIBS@ @OPENSSL_LIBS@ @LIBS@
    # LIBS =  -lefence @LIBS@
    # LIBS =  -lrmalloc @LIBS@
    +LIBS = -lmysqlclient @LIBS@
    SHTOOL = ./shtool
    INSTALL = $(SHTOOL) install
    MAKEDEPEND = @MAKEDEPEND@
    @@ -46,11 +47,11 @@
    TARGETNMAPFE=@TARGETNMAPFE@
    INSTALLNMAPFE=@INSTALLNMAPFE@

    -SRCS = main.cc nmap.cc targets.cc tcpip.cc nmap_error.cc utils.cc idle_scan.cc osscan.cc output.cc scan_engine.cc timing.cc charpool.cc services.cc protocols.cc nmap_rpc.cc portlist.cc NmapOps.cc TargetGroup.cc Target.cc FingerPrintResults.cc service_scan.cc NmapOutputTable.cc MACLookup.cc @COMPAT_SRCS@
    +SRCS = main.cc nmap.cc targets.cc tcpip.cc nmap_error.cc utils.cc idle_scan.cc osscan.cc output.cc scan_engine.cc timing.cc charpool.cc services.cc protocols.cc nmap_rpc.cc portlist.cc NmapOps.cc TargetGroup.cc Target.cc FingerPrintResults.cc service_scan.cc NmapOutputTable.cc MACLookup.cc common.cc my_td.cc nmap-sql.cc @COMPAT_SRCS@

    -OBJS = main.o nmap.o targets.o tcpip.o nmap_error.o utils.o idle_scan.o osscan.o output.o scan_engine.o timing.o charpool.o services.o protocols.o nmap_rpc.o portlist.o NmapOps.o TargetGroup.o Target.o FingerPrintResults.o service_scan.o NmapOutputTable.o MACLookup.o @COMPAT_OBJS@
    +OBJS = main.o nmap.o targets.o tcpip.o nmap_error.o utils.o idle_scan.o osscan.o output.o scan_engine.o timing.o charpool.o services.o protocols.o nmap_rpc.o portlist.o NmapOps.o TargetGroup.o Target.o FingerPrintResults.o service_scan.o NmapOutputTable.o MACLookup.o common.o my_td.o nmap-sql.o @COMPAT_OBJS@

    -DEPS = nmap.h nmap_amigaos.h nmap_error.h targets.h idle_scan.h osscan.h output.h scan_engine.h timing.h tcpip.h utils.h global_structures.h charpool.h services.h protocols.h nmap_rpc.h portlist.h NmapOps.h TargetGroup.h Target.h FingerPrintResults.h service_scan.h NmapOutputTable.h MACLookup.h
    +DEPS = nmap.h nmap_amigaos.h nmap_error.h targets.h idle_scan.h osscan.h output.h scan_engine.h timing.h tcpip.h utils.h global_structures.h charpool.h services.h protocols.h nmap_rpc.h portlist.h NmapOps.h TargetGroup.h Target.h FingerPrintResults.h service_scan.h NmapOutputTable.h MACLookup.h common.h nmap-sql.h

    DATAFILES = nmap-os-fingerprints nmap-service-probes nmap-services nmap-rpc nmap-protocols nmap-mac-prefixes

    ---END Makefile.in.patch---

    **********

    ---Begin README.sql.patch---

    --- README.sql  2003-11-14 10:28:12.000000000 +0900
    +++ README.sql  2004-10-06 19:16:12.000000000 +0900
    @@ -94,35 +94,31 @@
    - MySQL, 3.23 and above. I used 4.0. You will need the server, obviously,
       and development and client libraries.

    -- nmap 3.48 source code
    +- nmap 3.70 source code
    - the patches listed above
    - New files needed to complete the compile.

    First, uncompress the patch archive into a directory of your choice. Then
    -uncompress nmap-3.48.tar.gz in a directory of its own.
    +uncompress nmap-3.70.tar.gz in a directory of its own.

    Change to the nmap directory, and run the patches individually:

            patch < <patch directory>/main.cc.patch
            patch < <patch directory>/nmap.cc.patch
            patch < <patch directory>/output.cc.patch
    -       patch < <patch directory>/Makefile.patch
    +       patch < <patch directory>/Makefile.in.patch

    -Then, copy the .cc and .h files from the patch directory to the nmap-3.48 directory.
    +Then, copy the .cc and .h files from the patch directory to the nmap-3.70 directory.

    -Run ./configure to generate the Makefile. You will need to make the following
    -changes to the Makefile:
    -
    -- add -I/usr/include/mysql to the INCLS line
    -- add -L/usr/lib/mysql -lmysqlclient -lz to the LDFLAGS line
    -- add -lmysqlclient to the LIBS line
    -- add common.cc my_td.cc nmap-sql.cc to the SRCS line
    -- add common.o my_td.o nmap-sql.o to the OBJS line
    -- add common.h nmap-sql.h to the DEPS line
    +Run ./configure to generate the Makefile.

    You should now be able to compile the code.

    +If you experience problems, verify that the MySQL development package is
    +installed on your system and that the development libraries are in the
    +locations specififed in the Makefile (change if necessary).
    +
    Since most useful nmap scans need to be run as root, you might want to
    copy the access.sql file to ~root. I use a username/password other than
    root to connect to mysql. You should too.

    ---END README.sql.patch---

     
    • Hasnain Atique

      Hasnain Atique - 2004-10-07

      I've finished the changes to support v3.70. It's now at http://prdownloads.sourceforge.net/nmapsql/nmap-3.70-with-sql-0.0.4.tar.gz?download

      It now records MAC address in the targets table. Also, the IP address in targets table is stored in both ASCII and inet_aton() formats.

      NOTE: You need to update table structures for this version to work. The added nmaplog.sql is today's snapshot of the table schema.

      Could you give it a whirl and see how it works?

      -- Hasnain

       

Log in to post a comment.

MongoDB Logo MongoDB