Re: Nmap Script Engine on OpenWrt

Bruno <[email protected]> Thu, 5 Apr 2018 17:32:13 -0300
Newsgroups gmane.comp.security.nmap.devel
Message-ID <[email protected]>
The lua version on the OpenWRT device that is being used is Lua 5.1.5.

Trying with the "--with-liblua=included" option, it tried to compile 
liblua, however it still failed with the attached error log.

But it seems some progress were made. Do you have any other suggestions 
I could try?

Thanks Daniel

On 04/05/2018 10:30 AM, Daniel Miller wrote:
> Bruno,
>
> Thanks for following up. It appears that you might have a version of 
> Lua installed that is incompatible with Nmap. You can force Nmap to 
> build and statically link the Lua 5.3.3 source that's included with 
> Nmap by passing --with-liblua=included to configure. Let us know if 
> this fixes the issue for you.
>
> Dan
>
> On Mon, Apr 2, 2018 at 1:24 PM, Bruno <[email protected] 
> <mailto:[email protected]>> wrote:
>
>     Thanks Daniel Miller for your prompt answer,
>
>     I'm attaching the error log. (Not sure if it works for the dev
>     list. If it doesn't I will reply with the error on clear text).
>
>     Compiling with the "--without-liblua" works flawlessly.
>
>     On 04/02/2018 02:42 PM, Daniel Miller wrote:
>>     Bruno,
>>
>>     NSE doesn't make sense outside the context of Nmap, and many of
>>     the libraries it uses are compiled in to nmap itself. However,
>>     there shouldn't be any reason that it wouldn't compile on
>>     OpenWrt. Can you change the package's makefile so that it doesn't
>>     use --without-liblua in configure and then report what actually
>>     happens? What are the specific errors that happen?
>>
>>     Dan
>>
>>     On Mon, Apr 2, 2018 at 11:28 AM, Bruno <[email protected]
>>     <mailto:[email protected]>> wrote:
>>
>>         Is it possible to run NSE scritps, but without the nmap
>>         scripting?
>>
>>         I'm trying to run nmap scripting on OpenWRT, so the router
>>         let me know if there are vulnerabilities on my network to be
>>         patched. However, the nmap version for OpenWRT is missing
>>         scripting support
>>         (https://github.com/openwrt/packages/issues/4472
>>         <https://github.com/openwrt/packages/issues/4472>)
>>
>>         The scripts are written in lua. So, what I'm planning to do
>>         is run all the scripts available from lua itself. Do I have
>>         to rewrite part of NSE or is there an easy way to do it? Or
>>         is there a way to enable scripting on OpenWRT with liblua?
>>
>>         Thanks
>>
>>
>>         _______________________________________________
>>         Sent through the dev mailing list
>>         https://nmap.org/mailman/listinfo/dev
>>         <https://nmap.org/mailman/listinfo/dev>
>>         Archived at http://seclists.org/nmap-dev/
>>
>>
>
>

_______________________________________________
Sent through the dev mailing list
https://nmap.org/mailman/listinfo/dev
Archived at http://seclists.org/nmap-dev/
errorNmap.txt (text/plain, 4 KB)
arm-openwrt-linux-muslgnueabi-gcc-ar liblua.a lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o lundump.o lvm.o lzio.o lauxlib.o lbaselib.o lbitlib.o lcorolib.o ldblib.o liolib.o lmathlib.o loslib.o lstrlib.o ltablib.o lutf8lib.o loadlib.o linit.o 
/home/bruno/openwrt/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-7.3.0_musl_eabi/lib/gcc/arm-openwrt-linux-muslgnueabi/7.3.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ar: invalid option -- '.'
Usage: /home/bruno/openwrt/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-7.3.0_musl_eabi/lib/gcc/arm-openwrt-linux-muslgnueabi/7.3.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ar [emulation options] [-]{dmpqrstx}[abcDfilMNoPsSTuvV] [--plugin <name>] [member-name] [count] archive-file file...
       /home/bruno/openwrt/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-7.3.0_musl_eabi/lib/gcc/arm-openwrt-linux-muslgnueabi/7.3.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ar -M [<mri-script]
 commands:
  d            - delete file(s) from the archive
  m[ab]        - move file(s) in the archive
  p            - print file(s) found in the archive
  q[f]         - quick append file(s) to the archive
  r[ab][f][u]  - replace existing or insert new file(s) into the archive
  s            - act as ranlib
  t            - display contents of archive
  x[o]         - extract file(s) from the archive
 command specific modifiers:
  [a]          - put file(s) after [member-name]
  [b]          - put file(s) before [member-name] (same as [i])
  [D]          - use zero for timestamps and uids/gids (default)
  [U]          - use actual timestamps and uids/gids
  [N]          - use instance [count] of name
  [f]          - truncate inserted file names
  [P]          - use full path names when matching
  [o]          - preserve original dates
  [u]          - only replace files that are newer than current archive contents
 generic modifiers:
  [c]          - do not warn if the library had to be created
  [s]          - create an archive index (cf. ranlib)
  [S]          - do not build a symbol table
  [T]          - make a thin archive
  [v]          - be verbose
  [V]          - display the version number
  @<file>      - read options from <file>
  --target=BFDNAME - specify the target object format as BFDNAME
 optional:
  --plugin <p> - load the specified plugin
 emulation options: 
  No emulation specific options
/home/bruno/openwrt/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-7.3.0_musl_eabi/lib/gcc/arm-openwrt-linux-muslgnueabi/7.3.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ar: supported targets: elf32-littlearm elf32-bigarm elf32-little elf32-big plugin srec symbolsrec verilog tekhex binary ihex
Makefile:59: recipe for target 'liblua.a' failed
make[5]: *** [liblua.a] Error 1
make[5]: Leaving directory '/home/bruno/openwrt/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/nmap-ssl/nmap-7.60/liblua'
Makefile:165: recipe for target 'build-lua' failed
make[4]: *** [build-lua] Error 2
make[4]: Leaving directory '/home/bruno/openwrt/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/nmap-ssl/nmap-7.60'
Makefile:143: recipe for target '/home/bruno/openwrt/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/nmap-ssl/nmap-7.60/.built' failed
make[3]: *** [/home/bruno/openwrt/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/nmap-ssl/nmap-7.60/.built] Error 2
make[3]: Leaving directory '/home/bruno/openwrt/feeds/packages/net/nmap'
package/Makefile:107: recipe for target 'package/feeds/packages/nmap/compile' failed
make[2]: *** [package/feeds/packages/nmap/compile] Error 2
make[2]: Leaving directory '/home/bruno/openwrt'
package/Makefile:103: recipe for target '/home/bruno/openwrt/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/stamp/.package_compile' failed
make[1]: *** [/home/bruno/openwrt/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/stamp/.package_compile] Error 2
make[1]: Leaving directory '/home/bruno/openwrt'
/home/bruno/openwrt/include/toplevel.mk:216: recipe for target 'world' failed