We've gone through collected information and now we want to send it to a remote
system,
preferably a CaliBoxum sometime, for whatever reason.
And we want to do it as quietly as possible and preferably as quickly as
possible.
So let's take a look at a macro modification that I made and see how we did it
and using the tools
that are already within Windows so we don't have to use any directory or file
traversing
to create new things.
Now specifically we're taking a look at this line up here and that's where we
're using the
shell command. This might be familiar because we used it earlier in the skill
itself to be able
to introduce the branding of notepad.exe. Well this time we're using it to use
curl
and you may remember curl from earlier in the course where we actually used it
to be able to
push and pull from websites and crawl a little bit.
And we're using it here to push a file to a specified source on the internet.
Specifically our CaliBox and the same VM environment is set up as an FTP server
.
And curl is going to send out -t for a file to send the output.txt file that we
generated with
IP config earlier in the skill.
And we have FTP 192.168.2.11.128 be in the target.
And you'll notice on the end there's a dash dash user there followed by FTP
user
semicolon. Nothing. Well there's actually a password there you just don't see
it.
I set FTP user to no password. And so generally if there's a password assigned
to
a account for something like this it would be user semicolon and whatever the
password is.
In this case since there's no password it's just semicolon followed by closing
out of the quotation
marks to close the command out. So the FTP is set up on the CaliBox to receive
that particular user with no password and I set it up like that on purpose.
See in this kind of environment we're not necessarily worried about our
Cali system getting popped by pen testers from the other side. We're already in
the system itself
either through macros or different other methods like files and manipulations
that we've done already.
And we're just trying to send data from point A to point B.
Now there is another consideration about ports and things like that we'll come
back to that in a
minute. I just want to point out that this right here is how I got to be able
to send all the
information to the actual FTP server. And in fact if you look above there's
three lines right there
where I called out three more variables for host user and password. I'm going
to delete those in
the code that I have below because I was working on something else and I just
forgot to remove that.
I basically ran it down to one single line so that way we can keep it as tight
and concise as
possible. So let's zoom out real quick. We can go and see that we have our
output.txt file here.
I'm going to go over to our Cali box real quick and inside of our Cali system
you can see I have
two windows. One is a terminal one is a folder. The folder on the top right
where the warning is
because I have that open as root is where all of our files are going to be
going by default because
I'm running down here pure dash FTP. Now this is I haven't set up as default
and everything like
that. It's basically tied to the local IP address on 421 and it's just in a
running state to be able
to accept FTP connections. So let's go ahead and pop over to the Windows 10. If
we're going to
save real quick or actually I want to delete those three labs out there for us.
There we go.
Then I'm going to save. We're going to go over to our Excel spreadsheet.
Right here. There we go. We want to delete our total so that way we can see it
regenerate there.
Hit the button and we got it done. Let's go over to the Cali box real quick
and you can see there that we have output.text. Let's go ahead and open that up
.
You can see right here that we're taking a look at IP config for the actual
system that we were
just on inside of Windows. All this came from running macros and now we're able
to go from
the beginning of being able to generate a macro have a call in a program run a
command shell
and now we're able to send that data across the wire to a system on the outside
to keep that
information for us. Now I'm sure at this point you can definitely see where all
this is going and
the benefits.