Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lua FFI #7

Open
freb opened this issue Mar 14, 2017 · 2 comments
Open

Lua FFI #7

freb opened this issue Mar 14, 2017 · 2 comments

Comments

@freb
Copy link
Contributor

freb commented Mar 14, 2017

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/

@freb
Copy link
Contributor Author

freb commented Mar 14, 2017

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

@freb
Copy link
Contributor Author

freb commented Jul 24, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant