We've been able to take a couple of commands and run things like opening Not
epad and play around with the macro features and understanding the basics of
being able to run commands within that macro field for Office.
It's a bit of command injection, if you will, and then not just previous skill.
But now we're going to hop on over here and you can see that I have my Excel
spreadsheet pulled up. I'm going to
full screen that for you real quick and within my spreadsheet, you can see here
that I do not have a total.
I've cleared it out. Now we've amended this macro on the button to not only
give us the total, but to give us computer information.
What do you mean? I hear you asking. Well, inside of our VB script editor for
the macros, you could see here that aside from button click that was doing what
it was doing.
Before, which was the sum result, we also have included a profile variable
along with a path and a command line run that I have highlighted in blue for us
.
What this is doing is it's calling the command prompt to run IP config slash
all.
And it's going to send the results to a text document that a couple lines up
where you see path equal is going to be the output.text file on the desktop.
So essentially, when we go back into a cell Excel and run this, not only are we
going to get a total of 1825.
I also had a message box that was an indicator for me to let me know when this
completed. So I ran through the whole script.
This was the last line and it's done. Now I'm going to go ahead and click OK on
my little message box.
Then I'm going to minimize everything and what do you know here on my desktop?
I have output.text.
And if I open it up, we can see that I have the full IP config slash all of our
system here.
Now I know what you're thinking. I had that set up all along beforehand because
it was behind the windows, but I'm on to you and I'm on to me.
OK, going to delete this right click empty recycling bin. Go back to Excel.
Clear that cell out.
And I'm going to there we go. So you see the desktop. I'm going to click button
one.
And done and boom. Shaka Laka. There's the output.text file with the same IP
config slash all information. Now why is this important?
Well, we're starting to see where we can actually take some of the tricks that
we've learned earlier in this course and inject them inside of the actual macro
scripting itself.
We're going to go even further as the skill continues, but I just wanted to
point this out real quick that this is one of the things that one of many
things that we can do to be able to get a system and user information on a
system that is running Microsoft Office and employing those macros.
Now this gets even more expansive like we were talking about with the BIOD and
personal devices while ago because this Windows 10 box that I have inside of my
virtual environment here is a normal Windows 10 box.
Essentially, it has the single user that has local admin rights on the system
because that's just how Windows 10 is developed by default for home use,
whether it be a home edition professional doesn't matter.
It's always set up when there's a single user unless it's added in a domain and
has a group policy setting or a local security policy security setting, or let
's say that like one of us in the side of this course right now.
No better and we're going to be locking our system down. This is not how my
personal system runs here. This is just inside the environment and a default
setup to show you the differences and what is possible.
Now, as we continue, we're going to expand even further and see if we can
expand that VV script code to incorporate something along the lines of sending
information across the wire and doing some backdoor channeling.