gpt4 book ai didi

ubuntu - Lua、nmap、sqlite3 和 ubuntu - 找不到模块 'luasql.sqlite3'

转载 作者:行者123 更新时间:2023-12-04 18:37:54 26 4
gpt4 key购买 nike

我需要使用 nmap 和 sqlite3,并在 ubuntu 机器上安装了 lua 5.1 和 lua-sql-sqlite3:

sudo apt-get install lua5.1; sudo apt-get install lua-sql-sqlite3

现在,当我这样做时:
$ lua
Lua 5.2.1 Copyright (C) 1994-2012 Lua.org, PUC-Rio
> drv = require "luasql.sqlite3"
> print(drv._VERSION)
LuaSQL 2.3.0

一切都很好,但是当我尝试使用此行运行 nmap nse scrint 时:
require "luasql.sqlite3"

我正在使用这个 nse 脚本 sqlite-output.nse用于使用 nmap 和 sqlite3。

我有错误:
$ sudo nmap --script=sqlite-output.nse localhost
[sudo] password for alex:

Starting Nmap 7.01 ( https://nmap.org ) at 2016-03-13 04:16 EET
NSE: Failed to load sqlite-output.nse:
sqlite-output.nse:7: module 'luasql.sqlite3' not found:
NSE failed to find nselib/luasql/sqlite3.lua in search paths.
no field package.preload['luasql.sqlite3']
no file '/usr/local/share/lua/5.2/luasql/sqlite3.lua'
no file '/usr/local/share/lua/5.2/luasql/sqlite3/init.lua'
no file '/usr/local/lib/lua/5.2/luasql/sqlite3.lua'
no file '/usr/local/lib/lua/5.2/luasql/sqlite3/init.lua'
no file './luasql/sqlite3.lua'
no file '/usr/local/lib/lua/5.2/luasql/sqlite3.so'
no file '/usr/local/lib/lua/5.2/loadall.so'
no file './luasql/sqlite3.so'
no file '/usr/local/lib/lua/5.2/luasql.so'
no file '/usr/local/lib/lua/5.2/loadall.so'
no file './luasql.so'
stack traceback:
[C]: in function 'require'
sqlite-output.nse:7: in function <sqlite-output.nse:1>
NSE: failed to initialize the script engine:
/usr/local/bin/../share/nmap/nse_main.lua:600: could not load script
stack traceback:
[C]: in function 'error'
/usr/local/bin/../share/nmap/nse_main.lua:600: in function 'new'
/usr/local/bin/../share/nmap/nse_main.lua:805: in function 'get_chosen_scripts'
/usr/local/bin/../share/nmap/nse_main.lua:1249: in main chunk
[C]: in ?

最佳答案

当您在文件系统中搜索“luasql”时,它安装在哪里?在我的机器上看起来像这样:

micha@squeak:~$ sudo find / -name luasql
/usr/lib/x86_64-linux-gnu/lua/5.2/luasql
/usr/lib/x86_64-linux-gnu/lua/5.1/luasql

nmap 是从 Ubuntu 存储库安装的还是自编译的?

编辑:如果你的 lua 库不在 nmap 的搜索路径中,你可以像这样创建一个软链接(soft link):
sudo ln -s /usr/lib/x86_64-linux-gnu/lua /usr/local/lib/lua

关于ubuntu - Lua、nmap、sqlite3 和 ubuntu - 找不到模块 'luasql.sqlite3',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35970937/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com