Metasploit (part 6) msfvenom

Video Activity

This video concludes the Metasploit basics. In this video, the instructor teaches about msfvenom. This is an encapsulation of two different Metasploit tools. You can set a specific encoder and payload with certain keyboard commands.

Join over 3 million cybersecurity professionals advancing their career
Sign up with
Required fields are marked with an *

Already have an account? Sign In »

14 hours 26 minutes
Video Description

This video concludes the Metasploit basics. In this video, the instructor teaches about msfvenom. This is an encapsulation of two different Metasploit tools. You can set a specific encoder and payload with certain keyboard commands.

Video Transcription
Okay, Now let's look at our last example for a menace plate basics on. We can move on to actually penetration, testing our targets.
We want you to tool called a message venom. We're going to build a standalone payload.
This example. So it was a rhythm is an encapsulation of two different medicine boy tools. If we go to the user, share medicinally dash framework again
and see or menace wait tools accusing miss if update
it was says Council must see alive for years I must have been on
and we also see MSF payload and ESA in code. So immersive payload builds a standalone payload so we can use the maddest white payload system to make various kinds of payloads like we make execute a bles. We can make Rochelle Co to drop into an exploit which will do an exploit development
and we can run it through a myself in code in code will, as the name implies, encode the payload
who it will
used various encoders. We saw one Chicago and I already on it will encode the payload, get riveting bad characters, and pra penned a decoder who can decode itself back into its original form once that thin memory that's being executed was a venom that we're going to use. This encapsulates those two tools
into one, so we could just use one tool.
If you do, just must've payload, and I must have been code before. You can continue to use them
if that's what you're familiar with. But I'm going to use him. It's often, um,
all right, so we can do it. Must've been, um, Dash H for health
and I will show us our help momentarily. Here we go. We're not going to use all of these here. We're going to see it. Must've been, um, a few times in this class. We will use it for making shell code and exploit development.
And we will use it
a few other times. That may be helpful in our contest. We may find some places we might want to upload something, for instance,
and we may also use it during avoiding anti virus. No, a few different times will come up from space and bad characters, for instance, will use those during exploit development. Need to set in a certain amount of space in memory. And there'll be bad characters we need to avoid. Based on what particle? We're talking to you. That was my very
we can set a specific encoder
like That's psychotic and I and coder we don't need that here was going to do a very simple example of making a malicious execute herbal
kind of run off the screen. Here at the top, we have dash p for the payload, considered a specific payload. We can also list out the halos with Dash L.
There's some other options as well. Like docile will show us the options Dodge X. We can actually put it inside of another executed bles. We put our payload inside of inexcusable. Use it along with this dash K option, which the payload in a separate thread. If the user runs this
execute herbal, it'll look like the original one. It'll still function normally, but it will have this
extra functionality of our payload.
So be useful for making a Trojan.
So when I see that later on,
all right, so let's do. For our example, I want to set the payload as Windows interpreter Reverse TC piece that is the default payload for our most of our windows exploits. So If you don't set a payload on Windows, exploit. This is probably what you'll get,
so we want Dash P Windows. Last interpreter sized Reverse Underscore. TCP Again. My interpreter is medicine Wade. Special payloads. It has additional functionality on top of just a regular command shell. We'll use it extensively in this class, but we haven't really seen it yet. He dashed over the options
Can. We haven't seen this one's. We're not sure what the options are going to be.
Give it a second to load.
There's going to have to ask on the sly.
All right, so usual suspects for verse payload L host and L Port. We need to tell it who to call back to.
Unlike MSF cli, we want to specify our options like this. So we would say L host equals on the I P address or Callie Yuzhin I p. Config.
To find out if you need to make sure your I P addresses are correct, they're not. Then
we will have some problems. L host equals I P address for Callie, and you can also change l court as well from the default for 44 for an available port will work.
Now we need the four match that's gonna be dash if we come back.
does f for format that says, you know Daz Daz helped ash formats.
You find out what our format available formats are so does Does help the formats.
Well, show us all the available for months.
We want to make it execute a bill. Here we have some other options as well. Like l steal Ellis p B b A power shell war on. We also can have it
put out Raul Shell code informs that work with the syntax of various programming languages. When we do exploit development will be working with python who use this python format for our shell code. But for now, we just want the XY So dash f for format
and e x e. We don't need to set any bad characters. This best find the space you're specifying encoder? Here we
basically just want to make it execute a ble that when the user runs, it just runs this window's interpreter. Reverse TCP payload. So there won't be in a graphical user interface. It will just send the shell back to us with the reverse connection that will be my interpreter.
All right, so let's put it into a file. All this call it an interpreter. You see, we do need to put it in a file. If we don't just write it to the screen, which is useful for shell code, but not very useful for executed bols.
It will generate this payload and put it in the trip. Richard Doty etc.
We'll take just a minute to finish.
And that complains that we didn't set a platform, but it grabs windows from the payloads and went with the architecture describes x 86 it doesn't have any occurs, but doesn't even include us. It doesn't matter.
Who do you want to do is copy this file
to bar the reader VW. That is the default location where the Apache Web server serves pages from
that is copies that file there. Would you need to make sure the Apache web server started? It does not start up by the fault. When you turn on Kelly who do service. Ah, Patty to and then start already running here may not be.
What if I come over to X pee wee? In this case, we're just going to
download the file. We're going to play the user,
so we will only do social engineering. Look at other ways of getting a user to run something on our behalf.
Let's not run it just yet.
We actually need to do something on the Cali side first. So far, we've run our exploits. Other enemies of console or a miss that cli. Actually, the first thing it does after we type exploit or biggie in the case of Emma's FC Ally is it sets up a payload handler based on one of our payload we chose. So we've tried to bind
Shell in a river shell, so it sets up different handlers
based on
what payload we choose.
But here, with him as a venom, we're not going to have a payloads handler set up automatically. So if we just go ahead and run that on the X P system, it'll run just fine. It's just there's nothing to catch it over here on the Cali side. There's no port listening for, um, interpreter connection.
We can't just using that carrot like we did during our Lennox section,
because that cat's not going to know how to finish the stage payload as well as its not going to know howto speaking interpreter.
So we are actually going to have to use medicine. Boyd, slow start up in most of console. We're going to use a special model called multi slash handler that is specifically designed to deal with this particular problem of catching incoming payloads.
I need a handler that were launched outside of the framework. So in this case, who used it? Must've been, um, to create a standalone excusable on. We just need a handler to deal with its payload.
So multi handler will be ideal for that.
So, as usual, immersive council takes a little while to start. If you add more memory here being it will be faster. If we have that resource available encouraged, you just take advantage of it.
You won't have to sit here like me. There we go. So different. Ask you at this time.
We do it in Vaux on multi slash handler. It's full name is exploits large multi use flash handler,
but we can drop off the first part as usual.
So this model is a stub that provides all the features of the Medicis boy payload System Tau exploits that have been launched outside of the framework. Exactly what we need Some way to
handle our payload.
So let's use multi slosh handler.
Now we're in the context of
that handler. So if we show our options, basically it says nothing. So what we need to do is actually tell it what payload we want to handle. The handler will be different based on what payload we want.
In our case, we want Windows
Perverse underscore. TCP. So we wanted to come out exactly the same as what we set in in this film.
Who now, would you show options?
We see our options for Ritter. Pretty reverse TCP you get when you to set our options and again in
Ms of Consul was they set option to set, and then what? We want to save it. To show no option equals like we do in Imus of See Ally, or it was a venom.
Please shut the ice. The address of Callie here and you can run. I've configured right inside of a missive council. We don't have to exit out. We can exact commands right inside of MSF console.
Weaken. Sit. L host
And we did set L port to 1234 Always the one I used for some reason for my examples,
we do need to set it to the same port here. Otherwise, our handler will be listening on their own port when his expert you will call back to port for four or it'll call back to a 1234 and we would be listening by default on 4444 But we wouldn't actually catch the incoming interpreter session who do need to set it
the same way that we can say exploit.
We don't automatically get a session here like we did with our exploits, where this time we're not dependent on any exploited all. It's just a payload. So we're instead expecting the user to run it for us, so we don't need any particular vulnerability.
We'll get into client sides and social engineering. We'll see a lot more of this that in some cases, even if the system is fully pat,
we just asked the user, Hey, can you exploit yourself for me? And unfortunately, more often than not, that will actually work
without too much trouble. So we'll see more of that a bit later on this kind of play the user in this case
and just come over here and click. Ron,
it's not signed. Who could, of course, sign it.
But let's be realistic. When Isis ever stopped anybody from running anything, we didn't click, run, and again, there's no gooey over here. It doesn't actually do anything.
Besides, we're on the payload. We could use that Dash X and does Kay Option and MSF venom, which we will do later on to make a Trojan. So it does actually do something on the window side. We did get him interpreter session here. If we come back to Mrs Consul on Callie
so we can say help get our basic commands. We are systems defecate. Do get you idea. Actually, we're not system. I lied with our
s 08067 We were system. It's We exploited the S and B server. Who are we instead? We are the user. Georgia. I'm currently logged in as the user. Georgia over here is that makes sense. Store just started this process. It's not system at all. Were, in fact, a user. We are on administrative user so we may have ways. We could perhaps
easily become system.
She, like our has dump options so we could try that. You get some password. Hash is that was easy
have things like Do Kilo gaining or take a picture, a screenshot
and drop into a shell. Encourage you to spend some time with mature Peter. We will use various interpreter commands. We just basically have the basics here. There are some other
interpreter commands we can use. We can load additional extension form interpreter. We can run post modules on it. We can run the interpreter scripts. We'll do all of that when we get into post exploitation, but I encourage you to spend some time in interpreter. Now, if you want to
before you go on to the next videos, it's it's pretty cool just to play with.
I encourage you to deviate from what I do. I'm just going to show a few examples of various things as we go through the course, so there'll be lots more you can do on your own, and I encourage you to do so
to get the most out of this class so that I thought were going to do for our basics of using medicine bullet
and we will come back to miss Split over and over throughout the class. So I just wanted to get the basics down and you come back to these videos so we don't have to keep going over the basics every time. We will use it pretty much in every module and the entire class.
So now it's actually it started contesting.
Up Next