Open freb opened 7 years ago
Looks like none of the nse libraries or scripts really call c code. The only exception is the nmap internal that are exposed. All the exposed internals that lua can call seem to appear in this file: https://github.com/nmap/nmap/blob/0bb1dc6dc23fdcabd5bbfa0ddc3a8b68bf84d5b1/nse_nmaplib.cc
Any of the lua libraries in /usr/share/nmap/nselib
that are .luadoc
files instead of .lua
are c libraries. The luadoc
files are just documentation and placeholders because the actual library is baked into the nmap c code which won't get parsed for the nmap nse documentation. Here is one example that is relatively small:
https://github.com/nmap/nmap/blob/0bb1dc6dc23fdcabd5bbfa0ddc3a8b68bf84d5b1/nse_fs.cc
Given the false positives with the
dns-brute2
script, I'd like to rewrite it in Go. But I'd like to keep it as an NSE. So it would be great to use FFI to pass the work off to Go, but still integrate with nmap. This approach would also open up a lot of possibilities for other tasks:https://scene-si.org/2017/03/13/calling-go-functions-from-lua/