phong
phong

Reputation: 310

Can nmap run multiple nmap script with multiple arguments in one command?

I want to run multiple nmap scripts, each of which takes in one or multiple arguments.

For example, I want to run 3 scripts: sc1, sc2, sc3.

sc1 uses args: sc1.ag1, sc1.ag2, sc1.ag3

sc2 uses args: sc2.ag1, sc2.ag2

sc3 uses args: sc3.ag1

Is it possible to run a command like this?

nmap --script sc1,sc2,sc3 --script-args=sc1.ag1,sc1.ag2,sc1.ag3,sc2.ag1,sc2.ag2,sc3.ag1 192.168.111.111

Upvotes: 1

Views: 11861

Answers (1)

bonsaiviking
bonsaiviking

Reputation: 5995

Yes, that is allowed. You should be careful with quoting for your shell, since script args can contain spaces and quote characters.

You may also be interested in the --script-args-file option, which allows you to put each script argument on a separate line of a text file. The newline acts the same as the comma (",") in your example.

Script specification is covered in the online documentation.

Upvotes: 1

Related Questions