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

NSE script unable to add target ( target.add(...) ) on Archlinux #2496

Closed
mmpx12 opened this issue Jun 26, 2022 · 0 comments
Closed

NSE script unable to add target ( target.add(...) ) on Archlinux #2496

mmpx12 opened this issue Jun 26, 2022 · 0 comments
Labels

Comments

@mmpx12
Copy link

mmpx12 commented Jun 26, 2022

Adding target is not possible on Archlinux and Termux.

i'm trying to run this little script:

local target = require "target"

prerule = function()
    local status, err = target.add( "localhost","1.1.1.1" )
    print("status: " .. tostring(status))
    print("err: " .. err)
end

action = function() return true end

I'm running the script with:

nmap  --script ./test.nse --script-args=newtargets

And the ouput is:

Starting Nmap 7.92 ( https://nmap.org ) at 2022-06-26 16:17 UTC
ERROR: to add targets run with -sC or --script options.
status: false
err: failed to add new targets.
WARNING: No targets were specified, so 0 hosts scanned.
Nmap done: 0 IP addresses (0 hosts up) scanned in 0.29 seconds

I tried on docker with Debian, Ubuntu, Centos, Alpine and FreeBSD and it's working perfectly. However on Archlinux, Blackarch and also Termux with extra/nmap or blackarch/nmap it's not working.

Easy step for reproduce with docker:

docker run -it --rm archlinux:latest  bash -c 'pacman -Sy --noconfirm nmap &&
    echo """
local target = require \"target\"

prerule = function()
    local status, err = target.add( \"localhost\",\"1.1.1.1\" )
    print(\"status: \" .. tostring(status))
    print(\"err: \" .. err)
end

action = function() return true end
""" > test.nse && nmap  --script ./test.nse --script-args=newtargets'

And with debian (working):

< docker run -it --rm archlinux:latest  bash -c 'pacman -Sy --noconfirm nmap ;
---
> docker run -it --rm debian:latest  bash -c 'apt upgrade && apt install -y nmap ;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant