I want to demonstrate how you can use FTP to upload
files from client to server also.
Let's explore that next.
Let's begin on the client by examining R3's config file,
which needs to be uploaded from client to server.
Again, this is a simple text file that should transfer quickly.
We can script the FTP client actions to eliminate FTP interaction.
Let's explore how that works.
The script is similar to the FTP active mode download script.
The first three lines are identical.
The next line is different,
this time using the put command instead of the get command.
This invokes an upload operation using the low-level FTP STOR command.
After that, we issue the list command on the server, which should reveal R3.cfg.
The introductory chatter is identical to the FTP active mode download,
which includes the feature and login exchanges.
The port command is still sent from client to server
because even in upload operations,
the server initiates the FTP data session to the client.
There is a new ALLO command, meaning allocate, but the command was ignored.
More on this in the packet capture.
The client accepts the FTP data session from the server and transfers the file.
Sometimes clients send commands to the server that
the server doesn't understand.
The server basically says,
I don't know what you're talking about and ignores the message.
In this case, these site commands don't exist on the server,
which is changing the file access times.
It isn't a big deal, so let's not fret over it.
At the end,
the client sends another port command directing the server to
connect to a new TCP port on the client,
again sourced from port 20.
The client issues the list command, and now we see R3.cfg present on the server.
Let's jump over to the server and ensure the file was transferred successfully.
So far,
I've demonstrated both uploading and downloading files with FTP active mode.
Let's explore the packet capture before moving on to more advanced demonstrations.