Search code examples
parsingzshnmap

Why am I generating an error when running a script in nmap on kali 2021 terminal: zsh: parse error near `\n'?


I'm getting an error every time I try to run a script in nmap on Kali 2021, I've copied it here: zsh: parse error near `\n' How do I resolve this? I'm a newbie so please be kind?! Syntax should be accurate so I need help. I've copied the code with the error below:

nmap --script ftp-vsftpd-backdoor -p 21 <10.0.0.10>
zsh: parse error near `\n'


Solution

  • < and > are shell metacharacters; you can't use them unquoted. The intention of the example in the manpage was that you replace <host> with the hostname, not that you insert the hostname between the angle brackets:

    nmap --script ftp-vsftpd-backdoor -p 21 10.0.0.10
    

    By the way, \n is the character which signals the end of a line, and zsh is flagging an error at the end of the line because > must be followed by the name of the file into which the command's output will be written (probably not what you want). You might want to read an introduction to using the shell.